oracle12c之 單機12.1.0.1打補丁
1、 下載最新的12.1.0.1的DB PSU 與 OPatch
p23054354_121010_Linux-x86-64.zip
p6880880_121010_Linux-x86-64.zip
2. 檢查資料庫當前OPatch版本
[oracle@host-172-16-3-132 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.1.0.1.0
OPatch succeeded.
3. 更新OPatch
[oracle@host-172-16-3-132 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_1
-- root使用者執行,/u01/app/oracle/product/12.1.0/dbhome_1/為oracle使用者下的$ORACLE_HOME路徑
[root@host-172-16-3-132 ~]# mv /u01/app/oracle/product/12.1.0/dbhome_1/OPatch /u01/app/oracle/product/12.1.0/dbhome_1/OPatch_bak
[root@host-172-16-3-132 u01]# ll p6880880_121010_Linux-x86-64.zip
-rw-r--r-- 1 oracle oinstall 80276058 Sep 12 18:16 p6880880_121010_Linux-x86-64.zi
[root@host-172-16-3-132 u01]# unzip p6880880_121010_Linux-x86-64.zip -d /u01/app/oracle/product/12.1.0/dbhome_1/
[root@host-172-16-3-132 u01]# chown -R oracle:oinstall /u01/app/oracle/product/12.1.0/dbhome_1/OPatch
4、 檢查OPatch
[oracle@host-172-16-3-132 u01]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.9
OPatch succeeded.
5. 解壓補丁檔案
[root@host-172-16-3-132 u01]# unzip p23054354_121010_Linux-x86-64.zip -d /u01/db_psu/
[root@host-172-16-3-132 u01]# chown -R oracle:oinstall /u01/db_psu/
6. 檢查補丁之間有無衝突
[root@host-172-16-3-132 u01]# cd db_psu/
[root@host-172-16-3-132 db_psu]# ls
23054354 PatchSearch.xml
[root@host-172-16-3-132 db_psu]# cd 23054354/
[root@host-172-16-3-132 23054354]# ls
19769486 20831107 21951844 23054354 README.txt
20299016 21352619 22291141 README.html
[oracle@host-172-16-3-132 23054354]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/db_psu/23054354 -oh $ORACLE_HOME
Oracle Interim Patch Installer version 12.2.0.1.9
Copyright (c) 2017, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.9
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2017-09-13_10-14-32AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
7. 為資料庫做冷備份 (如果不考慮安全性,這步可以省略,有點點風險)
使用root使用者備份oracle_home (將#ORACLE_HOME上級目錄整個備份)
tar -zcvpf db_20170913.tar.gz dbhome_1/
8. 關閉例項和監聽 (注意靜態監聽與oem)
[oracle@host-172-16-3-132 23054354]$ lsnrctl stop
[oracle@host-172-16-3-132 23054354]$ lsnrctl status
[root]#ps -ef|grep -v grep |grep LOCAL=NO|awk '{print $2}'|xargs kill -9
[oracle@host-172-16-3-132 23054354]$ sqlplus / as sysdba
SQL> shutdown immediate;
[oracle]$ netstat -an |grep 1158
9、 手動更新補丁
[oracle@host-172-16-3-132 23054354]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.9
Copyright (c) 2017, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.9
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2017-09-13_12-21-10PM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 19769486 20299016 20831107 21352619 21951844 22291141 23054354
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/dbhome_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '19769486' to OH '/u01/app/oracle/product/12.1.0/dbhome_1'
ApplySession: Optional component(s) [ oracle.network.cman, 12.1.0.1.0 ] not present in the Oracle Home or a higher version is found.
Composite patch 23054354 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2017-09-13_12-21-10PM_1.log
OPatch succeeded.
SQL> startup;
ORACLE instance started.
Total System Global Area 2371719168 bytes
Fixed Size 2853264 bytes
Variable Size 654313072 bytes
Database Buffers 1694498816 bytes
Redo Buffers 20054016 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;
Pluggable database altered.
10、 將補丁註冊到資料字典中:
注意:12C的補丁註冊改成了用datapatch工具,而不是以前版本的 @$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
[oracle@host-172-16-3-132 OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@host-172-16-3-132 OPatch]$ ./datapatch -verbose
Connecting to database...OK
Determining current state...
Currently installed SQL Patches:
PDB CDB$ROOT:
PDB PDB$SEED:
PDB PDB01:
.....
logfile: /u01/app/oracle/product/12.1.0/dbhome_1/sqlpatch/23054354/23054354_apply_ANDYCDB_PDB01_2017Sep14_04_41_10.log (no errors)
catbundle generate logfile: /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ANDYCDB_PDB01_GENERATE_2017Sep14_04_41_11.log (no errors)
catbundle apply logfile: /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ANDYCDB_PDB01_APPLY_2017Sep14_04_41_13.log (no errors)
SQL Patching tool complete on Thu Sep 14 04:41:53 2017
11、 驗證是否打補丁成功
col ACTION_TIME for a30;
col COMMENTS for a20;
col BUNDLE_SERIES for a10;
select ACTION_TIME,BUNDLE_SERIES,COMMENTS from dba_registry_history;
ACTION_TIME BUNDLE_SER COMMENTS
------------------------------ ---------- --------------------
14-SEP-17 03.46.47.445096 AM PSU Patchset 12.1.0.0.0
14-SEP-17 04.28.21.213333 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.28.32.004194 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.28.42.435304 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.28.53.797447 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.29.03.854827 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.29.14.465123 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.29.25.696294 AM PSU PSU 12.1.0.1.160719
8 rows selected
[oracle@12 OPatch]$ $ORACLE_HOME/OPatch/opatch lsinventory
Patch 23054354 : applied on Thu Sep 14 04:12:25 CST 2017
Unique Patch ID: 20238050
SQL> select count(*) from dba_objects where status<>'VALID';
COUNT(*)
----------
0
12、 啟動監聽
[oracle@12 OPatch]$ lsnrctl start
[oracle@12 OPatch]$ lsnrctl status
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2144947/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 11.2.0.3 單機 asm 儲存打psu 10補丁OracleASM
- oracle打補丁回顧Oracle
- Oracle EBS中打補丁Oracle
- Linux檔案打補丁Linux
- SAP打補丁(Tcode:SPAM)
- 使用OPatch給Oracle打補丁Oracle
- 單機 Oracle 11g(11.2.0.4)手動打補丁PSU(11.2.0.4.8)Oracle
- 12.1.0.1 及更高版本的資料庫安全補丁 (文件 ID 1603242.1)資料庫
- oracle 11g 單例項打補丁操作步驟Oracle單例
- weblogic的版本及打補丁Web
- ORACLE打補丁的方法和案例Oracle
- ORACLE11G DG打補丁Oracle
- opatch 工具打補丁使用說明
- Oracle資料庫打補丁方法Oracle資料庫
- oracle 小補丁能全部打嗎?Oracle
- 批處理打補丁的方法
- 【PATCH】Oracle12c升級補丁初體驗Oracle
- 到底打還是不打補丁:安裝第三方補丁(轉)
- windows 打補丁後網路異常Windows
- Windows 10打個補丁 Office歇菜了Windows
- 【opatch】Oracle打補丁工具opatch簡介Oracle
- 在windows上打Oracle的CPU補丁WindowsOracle
- 給Oracle資料庫打補丁(轉)Oracle資料庫
- 在RHAS2.1上打9205的補丁簡單總結!
- Oracle RAC 19.3打19.5.1 RU補丁Oracle
- Oracle Goldengate 12c打pus補丁OracleGo
- 怎樣為linux核心打補丁(轉)Linux
- 【UP_ORACLE】如何給Oracle DG打補丁(二)備庫安裝補丁步驟Oracle
- 【UP_ORACLE】如何給Oracle DG打補丁(三)主庫安裝補丁步驟Oracle
- 打Oracle最新CPU patch與打臨時補丁的區別Oracle
- Git 打補丁– patch 和 diff 的使用(詳細)Git
- Git 打補丁-- patch 和 diff 的使用(詳細)Git
- 關於12c安裝後打補丁
- Oracle EBS APP & DB 打補丁過程簡述OracleAPP
- Linux下為DB2 9.7打補丁LinuxDB2
- 在windows 打補丁遇到CODE=41的錯誤Windows
- 給oracle打Patch 9352237補丁Oracle
- 給HP-UX作業系統打補丁UX作業系統