Friday, January 9, 2015

Relink Oracle Grid Infrastructure Standalone (Oracle Restart) home and Database home after OS is upgraded from AIX 6.1 to 7.0

Oracle Database 11.2.0.3
Operating System AIX 7.0
The server system is upgraded from AIX 6.1 to 7.0, generally IBM guarantees operating system binary compatibility, therefore, no relink of the Oracle
software is required after the upgrade. However, Oracle recommends performing manual relinking of Oracle Home binaries after OS upgrade.

1.Stop Oracle databases (as owner of Oracle Database Home):
$ id  oracle
uid=207(oracle) gid=110(oinstall) groups=60005(dba),60015(asmdba)
$ . oraenv
ORACLE_SID = [oracle] ? ORADB
The Oracle base has been set to /u01/app/oracle
$ srvctl stop home -o /u01/app/oracle/product/11.2.0/db11203 -s stophome.txt -t immediate

2.Stop the OHAS stack (as owner of Oracle Restart Home):
$ id 
uid=208(grid) gid=110(oinstall) groups=60005(dba),60014(asmadmin),60015(asmdba)
$ . oraenv
ORACLE_SID = [grid] ? +ASM
The Oracle base has been set to /u01/app/grid
$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'host01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.FLASH.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host01'
CRS-2677: Stop of 'ora.DATA.dg' on 'host01' succeeded
CRS-2677: Stop of 'ora.FLASH.dg' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host01' succeeded
CRS-2677: Stop of 'ora.asm' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host01'
CRS-2677: Stop of 'ora.cssd' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'host01'
CRS-2677: Stop of 'ora.evmd' on 'host01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'host01' has completed
CRS-4133: Oracle High Availability Services has been stopped.

3. Remove audit files from Oracle Restart Home if applicable
SQL> show parameter  audit_file_dest

NAME TYPE VALUE
------------------------------------ ----------- ----------------------------------------------
audit_file_dest string /u01/app/grid/product/11.2.0/gi11203/rdbms/audit

Audit files are saved in Oracle Restart Home, we have to move (backup) audit files out of the home. Otherwise, the following 'unlock' step will take long time.
$ mv /u01/app/grid/product/11.2.0/gi11203/rdbms/audit/*.aud /u01/app/grid/backup

4. Connect as root user and unlock the Oracle Restart installation as follows:
# . oraenv
ORACLE_SID = [root] ? +ASM
The Oracle base has been set to /u01/app/grid
#
# echo $ORACLE_HOME
/u01/app/grid/product/11.2.0/gi11203
#
# $ORACLE_HOME/crs/install/roothas.pl -unlock
Using configuration parameter file: /u01/app/grid/product/11.2.0/gi11203/crs/install/crsconfig_params
Successfully unlock /u01/app/grid/product/11.2.0/gi11203

5. Relink the Oracle Restart installation (as owner of Oracle Restart Home):
$ . oraenv
ORACLE_SID = [grid] ? +ASM
The Oracle base remains unchanged with value /u01/app/grid
$
$ ls -l $ORACLE_HOME/rdbms/lib/config.o
-rw-r--r-- 1 grid oinstall 764 Oct 18 2013 /u01/app/grid/product/11.2.0/gi11203/rdbms/lib/config.o
$
$ mv $ORACLE_HOME/rdbms/lib/config.o $ORACLE_HOME/rdbms/lib/config.o.bak
$
$ ls -l $ORACLE_HOME/rdbms/lib/config.o*
-rw-r--r-- 1 grid oinstall 764 Oct 18 2013 /u01/app/grid/product/11.2.0/gi11203/rdbms/lib/config.o.bak
$
$ $ORACLE_HOME/bin/relink all
writing relink log to: /u01/app/grid/product/11.2.0/gi11203/install/relink.log
$

6. Check the relink log:
$ cat /u01/app/grid/product/11.2.0/gi11203/install/relink.log
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 12800 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-01-08_02-01-58PM. Please wait ...Please find the log file at /u01/app/grid/product/11.2.0/gi11203/install/relinkActions2015-01-08_02-02-06-PM.log
... ...
ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait_timeout64
... ...
ld: 0711-773 WARNING: Object /u01/app/grid/product/11.2.0/gi11203/lib/libxml11.a[lgx.o], imported symbol id__Q2_3std8numpunctXTc_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
... ...
ld: 0711-783 WARNING: TOC overflow. TOC size: 185792 Maximum size: 65536
... ...

Oops. Thousands of 'ld: 0711-773' and 'ld: 0711-783' warning messages! Don'g worry, that's expected while Oracle home is relinked on AIX, they can be safely ignored.
We can find new binary file created:
$ ls -l  /u01/app/grid/product/11.2.0/gi11203/bin/oracle*
-rwsr-s--x 1 grid oinstall 265201550 Jan 8 14:04 /u01/app/grid/product/11.2.0/gi11203/bin/oracle
-rwsr-s--x 1 grid oinstall 265345822 Jun 27 2014 /u01/app/grid/product/11.2.0/gi11203/bin/oracleO

7. Connect as root user and lock back the Oracle Restart installation
# $ORACLE_HOME/crs/install/roothas.pl -patch
Using configuration parameter file: /u01/app/grid/product/11.2.0/gi11203/crs/install/crsconfig_params
CRS-4123: Oracle High Availability Services has been started.

8. Verify OHAS services (As owner of Oracle Restart Home):
$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE host01
ora.FLASH.dg
ONLINE ONLINE host01
ora.LISTENER.lsnr
ONLINE ONLINE host01
ora.asm
ONLINE ONLINE host01 Started
ora.ons
OFFLINE OFFLINE host01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE host01
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE host01
ora.oradb.db
1 OFFLINE OFFLINE Instance Shutdown

9. Relink Database home  (as owner of Database home)
$ . oraenv
ORACLE_SID = [oracle] ? ORADB
The Oracle base remains unchanged with value /u01/app/oracle
$
$ ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle asmadmin 287983743 Jun 27 2014 /u01/app/oracle/product/11.2.0/db11203/bin/oracle
$
$ $ORACLE_HOME/bin/relink all
writing relink log to: /u01/app/oracle/product/11.2.0/db11203/install/relink.log
$
$ ls -l $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 287912357 Jan 8 15:17 /u01/app/oracle/product/11.2.0/db11203/bin/oracle
-rwsr-s--x 1 oracle asmadmin 287983743 Jun 27 2014 /u01/app/oracle/product/11.2.0/db11203/bin/oracleO

10. Start databases:
$ srvctl start home -o /u01/app/oracle/product/11.2.0/db11203 -s stophome.txt

 References:
"Relink All" On AIX Raises Many Warnings And "ld: 0706-032 Linking mode is not specified" for Liborasdk (Doc ID 809153.1)

No comments: