首页 > 数据库 > Oracle > 如何在19c上打补丁?
$ORACLE_HOME 为 oracle 软件安装目录 (/oracle/app/product/12.2.0/db_1)
$GRID_HOME 为 grid 安装目录 (/oracle/grid/crs_1)
<UNZIPPED_PATCH_LOCATION> 为 psu 安装包解压路径,本次实验改目录为 /soft
一、解压 opatch 工具
1.1 root 用户修改属组
|
1 |
# chown grid:oinstall p6880880_122010_Linux-x86-64.zip |
1.2 Grid 用户双节点执行:
|
1 |
$ unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME |
1.3 root 用户修改属组
|
1 |
# chown oracle:oinstall p6880880_122010_Linux-x86-64.zip |
1.4 Oracle 用户双节点执行:
|
1 |
$ unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME |
查看 opatch 当前版本
|
1
2
3
4 |
[oracle@s1-11g OPatch]$ opatch versionOPatch Version: 12.2.0.1.25
OPatch succeeded. |
二、解压补丁包
在双节点执行( grid 或 oracle 用户都可以)
|
1
2 |
$ cd /soft$ unzip p31750108_190000_Linux-x86-64.zip |
三、安装过程
检查 readme 文件:
|
1
2
3
4
5
6
7
8
9
10
11 |
31750108Patch Number Description Applicable Homes31771877
Database
Release
Update
19.9.0.0.201020
Only
DB Home
for
non-Oracle RAC setup. Both DB Homes
and
Grid Home
for
Oracle RAC setup.31772784 OCW Release
Update
19.9.0.0.201020 Both DB Homes
and
Grid Home31773437 ACFS Release
Update
19.9.0.0.201020
Only
Grid Home31780966 Tomcat Release
Update
19.0.0.0.0
Only
Grid Home
ORACLE_HOME=/oracle/app/product/12.2.0/db_1GRID_HOME=/oracle/grid/crs_1status file location=/soft/status.lstnode
name
=rac1,rac2 |
打补丁前准备:
1. 备份安装文件
|
1
2 |
tar cvf /ora_backup/oracle.tar oracletar cvf /ora_backup/grid.tar grid |
2. 备份数据文件
|
1
2 |
rmant target /backup
database
format
'/ora_backup/full_%U.bak'
plus archivelog; |
3. 关闭数据库
|
1 |
srvctl stop
database
-d orcl -o immediate |
自动打补丁过程:
预检查
双节点执行
|
1 |
/oracle/grid/crs_1/OPatch/opatchauto apply /soft/31750108 -analyze |
关闭 2 节点集群
|
1 |
/oracle/grid/crs_1/bin/crsctl stop has |
2 节点执行打 grid 补丁
|
1 |
/oracle/grid/crs_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/grid/crs_1 -nonrolling |
1 节点关集群 2 节点开集群
|
1
2 |
/oracle/grid/crs_1/bin/crsctl stop has/oracle/grid/crs_1/bin/crsctl start has |
2 节点打 grid 补丁
|
1
2 |
chmod 660 /oracle/oraInventory/ContentsXML/oui-patch.xml/oracle/grid/crs_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/grid/crs_1 -nonrolling |
1 节点打 db 补丁
|
1 |
/oracle/app/product/12.2.0/db_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/app/product/12.2.0/db_1 |
2 节点打 db 补丁
|
1 |
/oracle/app/product/12.2.0/db_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/app/product/12.2.0/db_1 |
加载 sql
|
1
2
3 |
srvctl start
database
-d orclcd $ORACLE_HOME/OPatch./datapatch -verbose |
回滚: 同时回滚
|
1 |
/oracle/grid/crs_1/OPatch/opatchauto
rollback
/soft/31750108 |
单独回滚 grid:
|
1 |
/oracle/grid/crs_1/OPatch/opatchauto
rollback
/oracle/grid/crs_1 |
单独回滚db:
|
1 |
/oracle/app/product/12.2.0/db_1/OPatch/opatchauto
rollback
-oh /oracle/app/product/12.2.0/db_1
|
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70013625/viewspace-3090001/ ,如需转载,请注明出处,否则将追究法律责任。