首页 » ORACLE 9i-23ai » 当Linux内核升级后,Oracle 数据库需要relink 执行文件吗?

当Linux内核升级后,Oracle 数据库需要relink 执行文件吗?

前几个月有个XD的客户遇到过linux bug导致OS频繁重启,当时整理了笔记<Troubleshooting Linux7 panic System crash shows exception RIP: pagetypeinfo_showfree_print>,巧合的是刚刚过去2个月另一个非XD用户使用OEL 7.7的客户也遇到了相同的问题,解决方法是升级内核,同事问升级内核后Oracle binary需要relink吗?我觉的是推荐,可能是非必须,记住这里说的是可能。

如升级Kernel-uek-4.14.35-1902.3.2(UEK5U2)  到V4.14.35-2047.505.1(UEK5U5), 官方的建议是当OS安装Patch还是升级都必须(must)relink 产品的可执行文件,执行前需要停掉ORACLE HOME目录所有在执行的程序,真的需要吗?

Relinking Oracle Home FAQ ( Frequently Asked Questions) (Doc ID 1467060.1)

4) When Manual relinking is required?

Manual relinking is required in below situations.

A) After OS upgrade, Generally OS Vendors guarantee operating system binary compatibility, therefore, no reinstall or relink of the Oracle software is required when upgrading these operating systems unless specifically stated otherwise.

“However Oracle recommends performing manual relinking of Oracle Home binaries after OS upgrade”.
B) After Operating system has been patched.( Recommended ).
C) Relinking phase during installation of Oracle Home has errors/warnings.
D) Application of a RDBMS patch failed in relinking phase.
E) Applications gives error for missing lib files in RDBMS home.
F) Troubleshooting RDBMS home binaries issue.
G) After manually modifying RDBMS home binary permissions.
H) Verifying Integrity of Oracle Home Binaries.
I) Resetting Oracle Home binaries permission.
J) To recreate binary executables.

Do we need to relink Oracle binaries after kernel upgrade?

  • In general, relinking is required only when some changes are made in some libraries that application binaries are statically linking.

  • System libraries (e.g. glibc) are usually not updated when you only update kernel along with other minimum necessary packages required for dependencies (e.g. kernel-firmware).

  • If you are using static libraries in your binaries then you will need to relink.

  • However we would not offer you any guarantee that everything is fine for oracle binaries without relinking after updating the kernel since Oracle just recommends that you must relink oracle binaries using relink shell script every time you apply an operating system patch or after an operating system upgrade.

  • Please contact Oracle Support if you need to know the exact reason why you must run relink shell script for Oracle binaries to be relinked every time you upgrade kernel even tough any system libraries that those binaries are statically linking.

  • Please note, we are not talking about prelinking here. Prelinking, which is completely different from relinking, is the operation upon which prelink modifies binaries to dynamically link them to binaries. It significantly improves application start up times (often on the order for 5x speedup). It shortens the time the OS spends dynamically linking a program (since its done ahead of time). Refer this article if you are not familiar with prelinking.

 

RAC: Frequently Asked Questions (RAC FAQ) (Doc ID 220970.1)

Do I need to relink the Oracle Clusterware / Grid Infrastructure home after an OS upgrade?
Using Oracle Clusterware 10g and 11.1, Oracle Clusterware binaries cannot be relinked. However, 
the client shared libraries, which are part of the home can be relinked, in most cases there should
 not be a need to relink them. See Document 743649.1 for more information.
Using Oracle Grid Infrastructure 11.2 and higher, there are some executables in the Grid home that can and 
should be relinked after an OS upgrade. 

我认为OTN Is relinking oracle binary mandatory after OS patching ?  说的还比较刻客观

Namely, it indicates that it should be safe to not relink oracle after OS patching, but recommends a relink is performed anyway.

From personal experience, a previous site I worked at did not relink oracle after patching. This was due to the fact that the host may have 20-30 Oracle databases and there simply was not the resource availability to carry out this level of relinking, especially if multiple hosts were patched during a maintenance window.

It didn’t appear to cause issues and I never saw this being cited as the cause for any of the SRs that were raised.

Personally, I’d relink, just for the peace of mind.

简而言之就是不relink如果正常启动也能用,做relink只求个心安,毕竟也就3-4分钟。

How to oracle RAC relink and kernel upgrade

1) as root user

Verify umask value is set as 022 
 umask 022

2) Before proceeding stop CRS as root user, and Disable Autostart of the Grid Infrastructure

# --set env
# crsctl disable crs
# crsctl stop crs

3) Upgrade/Patch the OS as root (-5min)

# root@:/home/grid/ [+ASM1] yum upgrade -y
-- or --
# yum update  kernel-uek-4.14.35-2047.533.3.el7uek.x86_64.rpm  shim-x64-15.6-1.0.7.el7.x86_64.rpm mokutil-15.6-1.0.7.el7.x86_64.rpm grub2-2.02-0.87.0.25.el7.9.11.x86_64.rpm grub2-common-2.02-0.87.0.25.el7.9.11.noarch.rpm grub2-efi-x64-2.02-0.87.0.25.el7.9.11.x86_64.rpm grub2-pc-2.02-0.87.0.25.el7.9.11.x86_64.rpm grub2-pc-modules-2.02-0.87.0.25.el7.9.11.noarch.rpm grub2-tools-2.02-0.87.0.25.el7.9.11.x86_64.rpm grub2-tools-extra-2.02-0.87.0.25.el7.9.11.x86_64.rpm grub2-tools-minimal-2.02-0.87.0.25.el7.9.11.x86_64.rpm kernel-uek-devel-4.14.35-2047.533.3.el7uek.x86_64.rpm libdtrace-ctf-1.1.0-2.el7.x86_64.rpm

4) As root OS user, please unlock the Grid Infrastructure Oracle Home (on every node) as follows:

# cd Grid_home/crs/install
# perl rootcrs.pl -unlock

Note:
On 12.1/12.2/19c releases, rootcrs.sh can be used instead of rootcrs.pl.
Command as “rootcrs.sh -unlock”

5) As the Oracle Grid Infrastructure owner (on every node) relink the Grid Infrastructure Oracle Home as follows (-3min):
As the grid infrastructure for a cluster owner:

$ ps -ef|grep oracle    -- make sure no oracle home file useage, such as crontab call.

$ export ORACLE_HOME=Grid_home
$ Grid_home/bin/relink all
$ echo $?


6) As the Oracle RDBMS owner oracle, relink the oracle database home (-3min)

#su - oracle
# export ORACLE_HOME=ORACLE DB home
# $ORACLE_HOME/bin/relink all

7) As root OS user again, please execute the next commands (on every node – 4 min):

# cd < Grid Infrastructure Oracle Home >/rdbms/install/
# ./rootadd_rdbms.sh
# cd < Grid Infrastructure Oracle Home >/crs/install
# perl rootcrs.pl -patch

Note: On 12.1, use “rootcrs.sh -patch”.
Note: On 12.2/21c, use “rootcrs.sh -lock” then “crsctl start crs”
Note: CRS services (CRS, CSS ASM instances, diskgroups, listeners, DB instances, etc.) will automatically start.

8) Please review the relink.log file located at the following directory (to confirm or discard any error):

$ < Grid Infrastructure Oracle Home>/install/relink.log
Note:
relinking script is a shell script and can be debugged as like any normal script as below:
$ sh -x relink all >relink_all.out 2>&1

9) check oracle binary permissions

$ ls -l `which oracle`

e.g
ls -al /u00/app/oracle/product/11.2.0.4/bin/oracle
-rwsr-s--x 1 oracle oinstall 448599912 May 19 20:20 /u00/app/oracle/product/11.2.0.4/bin/oracle

-- the group should be “asmadmin” to enable the RDBMS software to access the ASM disks. 
If it’s still “oinstall”, you have to change it as root. 
root@:/home/oracle/ [rdbms19] cd /etc/oracle
root@:/etc/oracle/ [rdbms19] ./setasmgid oracle_binary_path=/u00/app/oracle/product/11.2.0.4/bin/oracle
root@:/etc/oracle/ [rdbms19] exit
exit
oracle@:~/ [rdbms19] ls -al /u00/app/oracle/product/11.2.0.4/bin/oracle
-rwsr-s--x 1 oracle asmadmin 448599912 May 19 20:20 /u00/app/oracle/product/11.2.0.4/bin/oracle

10) Re-enable Autostart of the Grid Infrastructure as root

# crsctl enable crs

11) Check the status of the Oracle components on the node as grid or root

crsctl status resource -t

以上操作可以先做完一个节点重启并启动后验证正常,再相同的流程操作其它节点。

— enjoy —

打赏

,

对不起,这篇文章暂时关闭评论。