oracledba.help
SpecialTopics

Relink Oracle

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.

Assumptions

Your Oracle environment includes:

  • ORACLE_HOME
  • PATH to include $ORACLE_HOME/bin
  • LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/lib

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.8 to 7.9 via yum update -y only requires a relink.

Procedure: Standard DB Environment (non-GI)

Disable Any Jobs Hitting Database

 crontab -l

Shutdown Database and Listener

 su - oracle
 sqlplus / as sysdba
 SQLPLUS> shutdown immediate
 lsnrctl stop

Make sure to shutdown all Oracle databases if multiple on this server.

Ensure Repo OK

 su -
 yum repolist
 yum search release-el8
For version 7: yum search release-el7

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

Perform OS Changes

 su -
 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 database startup disabled in the /etc/oratab.
  • Stop Packagekit (if need be on el7): systemctl stop packagekit; systemctl disable packagekit

Relink

 su - oracle
 cd $ORACLE_HOME/bin
 relink all
 Process runs...

Restart Database and Listener

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

Enable Any Jobs Hitting Database

 crontab -l

Procedure: RAC Environment

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

Stop Database Instance on Node

 su - oracle
 srvctl stop instance -d oradb -i oradb1

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

Perform OS Changes

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

Unlock the GI Home

 su -
 export GRID_HOME=/u01/app/12.1.0.2/grid
 export PATH=$GRID_HOME/bin:$PATH%
 cd $GRID_HOME/crs/install

 $GRID_HOME/perl/bin/perl rootcrs.pl -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

Relink

 su - grid
 cd $ORACLE_HOME/bin
 relink all

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

Lock the GI Home

 su -
 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...

QC Check CRS

 su - grid
 crsctl status res -t -init
 crsctl check cluster -all

Start Database Instance on Node

 su - oracle
 srvctl start instance -d oradb -i oradb1
  • cat /etc/redhat-release

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.14.35-1844.5.3.el7uek.x86_64

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.

Patch Session

The following session is for: OEL7\8, Redhat7\8 and AlmaLinux8.

  -- Get Version
  cat /etc/system-release
  cat /etc/redhat-release

  -- QC
  if el7: systemctl stop packagekit; systemctl disable packagekit; systemctl status packagekit
  yum repolist
  yum search release-eln:
    yum search release-el8
    yum search release-el7

  -- Oracle
  sqlplus / as sysdba
  SQLPLUS> shutdown immediate
  lsnrctl stop

  -- Patch OS
  yum update -y
  vi /etc/oratab
  shutdown -r now
  cat /etc/system-release
    7.x = 7.9
    8.x = 8.8

  -- Relink Oracle
  su - oracle
  cd $ORACLE_HOME/bin
  lsnrctl stop
  relink all
      tail -$ORACLE_HOME/install/make.log
      vi $ORACLE_HOME/install/make.log

  -- Restart Database and Listener
  su - oracle
  lsnrctl start
  sqlplus / as sysdba
  SQLPLUS> startup
  vi /etc/oratab

References

  • 1467060.1 - Relinking Oracle Home FAQ.
  • 842775.1 - Oracle Linux: Preparing for and Performing Kernel Upgrade
  • 1672116.1 - GRID Infrastructure startup on one node encounters CRS-4013: This command is not supported in a single-node configuration.
  • 1536057.1 - How To Relink The Oracle Grid Infrastructure Standalone (Restart) Installation Or Oracle Grid Infrastructure RAC/Cluster Installation (11.2 to 18.c).
  • Also: 220970.1 and 743649.1. I also used MOS for this (SR 3-19143741691).