oracle 12c打补丁的过程

补丁的过程大概如下
cat /etc/issue
uname -a
两个zip文件,传到/tmp下面opatch_p6880880_122010_Linux-x86-64.zip,p28822515_122010_Linux-x86-64.zip
打补丁的目录:/opt/oracle/product/12.2.0/dbhome/OPatch
先shutdown immediate; lsnrctl stop,并用ps -ef | grep oracle检查进程,如果有sqlplus,也要杀掉
24676    1    0    April    pts/0    00:00:00    /usr/local/bin/rlwrap sqlplus / as sysdba
24677    24676    0    April    pts/1    00:00:00    sqlplus / as sysdba
直接杀父进程即可,kill -9 24676
进入/tmp,解压这2个文件,以下命令均在oracle用户下执行:
unzip opatch_p6880880_122010_Linux-x86-64.zip
unzip p28822515_122010_Linux-x86-64.zip
cd /opt/oracle/product/12.2.0/dbhome,即cd $ORACLE_HOME
mv OPatch/ OPatch_bk
cp -R /tmp/OPatch/ ./
cd OPatch
./opatch prereq CheckConflictAgainstOHWithDetail -ph /tmp/28822515/
提示:OPatch succeeded.
ps -ef | grep oracle
./opatch apply /tmp/28822515/
如果没有关闭,或停止监听,或者关闭sqlplus,会出现:OPatch failed with error code 73
如果正常,会提示OPatch succeeded.
./opatch lsinventory
开库,跑一下:
sqlplus / as sysdba
@?/rdbms/admin/dbmsrman.sql
@?/rdbms/admin/prvtrmns.plb
./datapatch -verbose
显示:Installing Patches....    最后显示Batch installation complete.
进入sql,执行:@?/rdbms/admin/utlrp.sql    (林工说这句的作用是:编译失效对象)
我问:是不是在打补丁的过程中,有些对象失败了,重新编译下就好了,他说是的。

上一篇:How to Create an OCM Response file to Apply a Patch in Silent Mode - opatch silent (文档 ID 966023.1)


下一篇:纷享销客自定义函数:实战100例(全网最全,持续更新...)