oracledba.help

Relink Oracle

<- SpecialTopics

TOC

Overview

There are executables in the Oracle home that should be relinked after OS patches. The following covers how to relink the Oracle DB and GI homes.
Reference Doc ID's: 220970.1, 220970.1, 743649.1. I also used MOS for this (SR 3-19143741691).

OS Upgrades

For major version OS Upgrades you may need to perform the steps identified in Doc ID 1559762.1. They are not usually necessary when applying OS Patches. For example, patching from Linux 7.4 to 7.6 via yum update -y only requires a relink.

Procedure: Standard DB Environment (non-GI)

As oracle user:

 sqlplus / as sysdba
 SQLPLUS> shutdown immediate
 lsnrctl stop

Make sure to shutdown all Oracle databases if multiple on this server.
As root user:

 yum update -y (or other Linux OS patch actions here)

As oracle user:

 cd $ORACLE_HOME/bin
 relink all

 lsnrctl start
 sqlplus / as sysdba
 SQLPLUS> startup

Relink log location: $ORACLE_HOME/install/relink.log

Procedure: RAC Environment

Perform the below on the node you are performing Linux patches on. Then proceed to next node.

As oracle user:

 -- Stop Oracle Instance on Node
 su - oracle
 srvctl stop instance -d oradb -i oradb1

As root user:

 -- Stop CRS on Node
 su -
 export GRID_HOME=/u01/app/12.1.0.2/grid
 export PATH=$GRID_HOME/bin:$PATH
 cd $GRID_HOME/bin
 crsctl stop crs

Keep this root console open. You will have to come back to it with this environment set.

As root, from a separate console session:

 -- Apply OS Patches
 Example: yum update -y

If need be: yum update -y --skip-broken

From initial root console:

 -- Unlock the GI Home
 cd $GRID_HOME/crs/install
 $GRID_HOME/perl/bin/perl rootcrs.pl -unlock

As grid user:

 -- Relink
 su - grid
 cd $ORACLE_HOME/bin
 relink all

Relink log location: $ORACLE_HOME/install/relink.log

From initial root console:

 -- Lock the GI Home
 cd $GRID_HOME/crs/install
 $GRID_HOME/perl/bin/perl rootcrs.pl -patch
 This step may take a few minutes. It also starts the CRS on node...

As grid user:

 -- QC Check CRS
 crsctl status res -t -init
 crsctl check cluster -all

As oracle user:

 -- Start Oracle Instance on Node
 su - oracle
 srvctl start instance -d oradb -i oradb1

Notes

If using Oracle Grid Infrastructure for Standalone Environments (Oracle Restart), see the Oracle Documentation for more information: https://docs.oracle.com/database/121/LADBI/oraclerestart.htm#LADBI999

It is recommended to use the Perl version that comes along with your Grid Infrastructure Install i.e Grid_home/perl/bin/perl rootcrs.pl -patch.

GI Standalone (Restart)

Please see: Doc ID 1536057.1 on MOS.

OS Version and Release Info

Kernel version: uname -r

 4.1.12-94.3.9.el7uek.x86_64

Release: cat /etc/redhat-release

 Red Hat Enterprise Linux Server release 7.4 (Maipo)