Oracle12c打补丁

补丁介质

p32579057_122010_Linux-x86-64.zip

p6880880_122010_Linux-x86-64.zip

本文主要介绍docker安装下补丁升级操作,补丁文件可官网下载

1、将文件上传至/root目录下,并将oracle oracle权限组

Oracle12c打补丁_第1张图片

2、容器内新建/opt/oracle/pach_ora目录

docker exec -it oracle /bin/bash

cd /opt/oracle/

mkdir pach_ora

3、将文件复制到容器内并解压

docker cp p32579057_122010_Linux-x86-64.zip oracledb:/opt/oracle/pach_ora

docker cp p6880880_122010_Linux-x86-64.zip oracledb:/opt/oracle/pach_ora

docker cp actions.xml oracledb:/opt/oracle/pach_ora

docker exec -it oracledb /bin/bash

cd /opt/oracle/pach_ora

unzip p32579057_122010_Linux-x86-64.zip && unzip p6880880_122010_Linux-x86-64.zip

4、将actions.xml 文件复制到指定目录

cd /opt/oracle/pach_ora

mv actions.xml /opt/oracle/pach_ora/32579057/32540149/32507738/etc/config/

chown -R oracle:oinstall actions.xml

5、关闭oracle服务和监听

shutdown immediate;

lsnrctl stop

6、OPatch升级备份升级

cd $ORACLE_HOME

mv OPatch/ OPatch_bk

cp -R /opt/oracle/pach_ora/OPatch/ ./

cd OPatch

7、检查补丁冲突

./opatch prereq CheckConflictAgainstOHWithDetail -ph /opt/oracle/pach_ora/32579057/32473172/

./opatch prereq CheckConflictAgainstOHWithDetail -ph /opt/oracle/pach_ora/32579057/32540149/26839277/

./opatch prereq CheckConflictAgainstOHWithDetail -ph /opt/oracle/pach_ora/32579057/32540149/31802727/

./opatch prereq CheckConflictAgainstOHWithDetail -ph /opt/oracle/pach_ora/32579057/32540149/32231681/

./opatch prereq CheckConflictAgainstOHWithDetail -ph /opt/oracle/pach_ora/32579057/32540149/32507738/

./opatch prereq CheckConflictAgainstOHWithDetail -ph /opt/oracle/pach_ora/32579057/32540149/32542421/

8、安装更新补丁

./opatch apply /opt/oracle/pach_ora/32579057/32473172/(成功)

./opatch apply /opt/oracle/pach_ora/32579057/32540149/26839277/(有警告)

./opatch apply /opt/oracle/pach_ora/32579057/32540149/31802727/(成功)

./opatch apply /opt/oracle/pach_ora/32579057/32540149/32231681/(有警告)

./opatch apply /opt/oracle/pach_ora/32579057/32540149/32507738/(有一个报错)

./opatch apply /opt/oracle/pach_ora/32579057/32540149/32542421/(有警告)

9、使用opatch 生效

./opatch lsinventory

10、启动数据库,执行脚本

sqlplus / as sysdba

Startup

@?/rdbms/admin/dbmsrman.sql

@?/rdbms/admin/prvtrmns.plb

11、退出执行最后一步

cd $ORACLE_HOME/OPatch

./datapatch -verbose

12、查询升级后版本

select * from dba_registry_history;

select * from dba_registry_sqlpatch;

select PATCH_ID, PATCH_UID,VERSION,ACTION, STATUS,ACTION_TIME,DESCRIPTION from dba_registry_sqlpatch;

你可能感兴趣的:(linux,运维,服务器)