Relink Oracle


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.

Ensure repo OK

 yum repolist
 yum search release-el7

If there are any issues you might want to rebuild the repo engine.

As root user:

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

 🠊 Some prefer to reboot after the above completes: shutdown -r now
  • If you reboot ensure you set /etc/oratab appropriately.
  • Stop Packagekit (if need be): systemctl stop packagekit; systemctl disable packagekit

As oracle user:

 cd $ORACLE_HOME/bin
 relink all

 lsnrctl start
 sqlplus / as sysdba
 SQLPLUS> startup
  • Relink log location: $ORACLE_HOME/install/relink.log
  • cat /etc/redhat-release

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/
 export PATH=$GRID_HOME/bin:$PATH
 cd $GRID_HOME/bin
 crsctl stop crs

 -- Apply OS Patches
 Example: yum update -y

 -- Unlock the GI Home
 cd $GRID_HOME/crs/install
 $GRID_HOME/perl/bin/perl -unlock
  • Keep this root console open. You will have to come back to it with this environment set.
  • You can change color of original root console prompt to make is easier to manage: export PS1="\e[0;31m[\u@\h \W]\$ \e[m "
  • If need be: yum update -y --skip-broken

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 -patch
 This step may take a few minutes. It also starts the CRS on node...

As grid user:

 -- QC Check CRS
 su - grid
 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
  • cat /etc/redhat-release


If using Oracle Grid Infrastructure for Standalone Environments (Oracle Restart), see the Oracle Documentation for more information:

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

GI Standalone (Restart)

Please see: Doc ID 1536057.1 on MOS.

OS Version and Release Info

Kernel version: uname -r


Release: cat /etc/redhat-release

 Red Hat Enterprise Linux Server release 7.6 (Maipo)

Disable Packagekit

 systemctl stop packagekit
 systemctl disable packagekit

Packagekit can cause Another app is currently holding the yum lock... or PackageKit messages.