在windows上打Oracle的CPU補丁
作業系統資訊:Win server 2003 Enterprise Edition SP2
資料庫版本:10g Enterprise Edition Release 10.2.0.4.0 - Production
CPU補丁版本:CPU July 2011
步驟如下:
1. 下載CPU補丁
可以從Oracle官方的”Critical Patch Updates and Security Alerts“ (http://www.oracle.com/technetwork/topics/security/alerts-086861.html) 頁面檢視2011年7月份的CPU補丁在Windows平臺上對於的補丁號,再到metalink上下載。
2. 檢視資料庫資訊
Normal 0 false false false EN-US ZH-CN X-NONEset pagesize 99
col action_time for a30
col action for a30
col comments for a90
col object_name for a30
col object_type for a30
col comp_name for a50
col comp_id for a20
SQL> spool precheck.log
SQL> select instance_name,status from v$instance;
SQL> select * from v$version;
SQL> select sum(bytes)/1024/1024||'M' from dba_segments;
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
SQL> select ACTION_TIME, ACTION, COMMENTS from sys.DBA_REGISTRY_HISTORY;
SQL> select count(*) from dba_objects where status<>'VALID';
SQL> select object_name,object_type,owner,status from dba_objects where status<>'VALID';
SQL> spool off
Normal 0 false false false EN-US ZH-CN X-NONE3. 備份資料庫
H:\CPUPatch>rman target /
RMAN> configure default device type to disk;
RMAN> configure controlfile autobackup on;
RMAN> configure controlfile autobackup format for device type disk to 'H:\INTEL_DB_DUMPS\O03LSE3\rman\cf_O03LSE3_%F';
RMAN> backup database format 'H:\INTEL_DB_DUMPS\O03LSE3\rman\O03LSE3_%s_%p_%T_%t.bak' tag before_CPUPatch;
4. 備份Oracle home
在備份Oracle home之前,除了確保所有和Oracle相關的服務、程式都已停止之外,還要確保服務Distributed Transaction Coordinator也已停止。
把oracle home整個目錄拷貝至其它盤儲存
5. 打CPU補丁(Oracle binary部分)
H:\CPUPatch>set oracle_home=G:\oracle\ora102
檢視已經打過的補丁:
H:\CPUPatch>%ORACLE_HOME%\OPatch\opatch lsinventory
開始打補丁:
H:\CPUPatch>cd H:\CPUPatch\p12429519_10204_Win32\12429519
H:\CPUPatch\p12429519_10204_Win32\12429519>%ORACLE_HOME%\OPatch\opatch apply ---大概持續10分鐘
補丁成功之後,再執行以下命令確認:
H:\CPUPatch>%ORACLE_HOME%\OPatch\opatch lsinventory
有可能會出現類似以下錯誤:
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following files are active :
G:\oracle\ora102\bin\oraclient10.dll
G:\oracle\ora102\bin\orapls10.dll
G:\oracle\ora102\bin\oracommon10.dll
G:\oracle\ora102\bin\orageneric10.dll
G:\oracle\ora102\bin\oraplp10.dll
......................
這種錯誤是因為Oracle home中的某些dll還在被其它程式佔用,無法被覆蓋,解決方法可以參考(https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=418479.1)
我覺得最簡便的方法是下載微軟提供的一個小工具Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx),用這個工具檢視這些dll是被哪些程式佔用,然後手動殺掉這些程式即可。
6 打CPU補丁(資料庫部分)
啟動所有在第4步中停止的服務和程式。
cd /d %ORACLE_HOME%\BUNDLE\Patch45
sqlplus "/as sysdba"
SQL> @catcpu.sql ---大概持續30分鐘至1小時
7. 重編譯view
SQL> SELECT * FROM registry$history where ID = '6452863';
如果上面的語句有返回行數,則說明資料庫之前已經重編譯過view了,可略過此步驟。
如果沒有返回,則:
Normal 0 false false false EN-US ZH-CN X-NONESQL> SHUTDOWN IMMEDIATE
SQL> STARTUP UPGRADE
SQL> @?/cpu/view_recompile/view_recompile_jan2008cpu.sql
SQL> SHUTDOWN IMMEDIATE
8. 事後檢查
重新編譯無效物件:
@?/rdbms/admin/utlrp.sql
set line 150
set pagesize 99
col action_time for a30
col action for a30
col comments for a90
col object_name for a30
col object_type for a30
col comp_name for a50
col comp_id for a20
SQL> spool post_check.log
SQL> select instance_name,status from v$instance;
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
SQL> select ACTION_TIME, ACTION, COMMENTS from DBA_REGISTRY_HISTORY;
SQL> select owner,object_name,object_type,status from dba_objects where status<>'VALID';
SQL> select count(*) from dba_objects where status<>'VALID';
SQL> spool off
Normal 0 false false false EN-US ZH-CN X-NONE
資料庫版本:10g Enterprise Edition Release 10.2.0.4.0 - Production
CPU補丁版本:CPU July 2011
步驟如下:
1. 下載CPU補丁
可以從Oracle官方的”Critical Patch Updates and Security Alerts“ (http://www.oracle.com/technetwork/topics/security/alerts-086861.html) 頁面檢視2011年7月份的CPU補丁在Windows平臺上對於的補丁號,再到metalink上下載。
2. 檢視資料庫資訊
Normal 0 false false false EN-US ZH-CN X-NONEset pagesize 99
col action_time for a30
col action for a30
col comments for a90
col object_name for a30
col object_type for a30
col comp_name for a50
col comp_id for a20
SQL> spool precheck.log
SQL> select instance_name,status from v$instance;
SQL> select * from v$version;
SQL> select sum(bytes)/1024/1024||'M' from dba_segments;
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
SQL> select ACTION_TIME, ACTION, COMMENTS from sys.DBA_REGISTRY_HISTORY;
SQL> select count(*) from dba_objects where status<>'VALID';
SQL> select object_name,object_type,owner,status from dba_objects where status<>'VALID';
SQL> spool off
Normal 0 false false false EN-US ZH-CN X-NONE3. 備份資料庫
H:\CPUPatch>rman target /
RMAN> configure default device type to disk;
RMAN> configure controlfile autobackup on;
RMAN> configure controlfile autobackup format for device type disk to 'H:\INTEL_DB_DUMPS\O03LSE3\rman\cf_O03LSE3_%F';
RMAN> backup database format 'H:\INTEL_DB_DUMPS\O03LSE3\rman\O03LSE3_%s_%p_%T_%t.bak' tag before_CPUPatch;
4. 備份Oracle home
在備份Oracle home之前,除了確保所有和Oracle相關的服務、程式都已停止之外,還要確保服務Distributed Transaction Coordinator也已停止。
把oracle home整個目錄拷貝至其它盤儲存
5. 打CPU補丁(Oracle binary部分)
H:\CPUPatch>set oracle_home=G:\oracle\ora102
檢視已經打過的補丁:
H:\CPUPatch>%ORACLE_HOME%\OPatch\opatch lsinventory
開始打補丁:
H:\CPUPatch>cd H:\CPUPatch\p12429519_10204_Win32\12429519
H:\CPUPatch\p12429519_10204_Win32\12429519>%ORACLE_HOME%\OPatch\opatch apply ---大概持續10分鐘
補丁成功之後,再執行以下命令確認:
H:\CPUPatch>%ORACLE_HOME%\OPatch\opatch lsinventory
有可能會出現類似以下錯誤:
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following files are active :
G:\oracle\ora102\bin\oraclient10.dll
G:\oracle\ora102\bin\orapls10.dll
G:\oracle\ora102\bin\oracommon10.dll
G:\oracle\ora102\bin\orageneric10.dll
G:\oracle\ora102\bin\oraplp10.dll
......................
這種錯誤是因為Oracle home中的某些dll還在被其它程式佔用,無法被覆蓋,解決方法可以參考(https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=418479.1)
我覺得最簡便的方法是下載微軟提供的一個小工具Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx),用這個工具檢視這些dll是被哪些程式佔用,然後手動殺掉這些程式即可。
6 打CPU補丁(資料庫部分)
啟動所有在第4步中停止的服務和程式。
cd /d %ORACLE_HOME%\BUNDLE\Patch45
sqlplus "/as sysdba"
SQL> @catcpu.sql ---大概持續30分鐘至1小時
7. 重編譯view
SQL> SELECT * FROM registry$history where ID = '6452863';
如果上面的語句有返回行數,則說明資料庫之前已經重編譯過view了,可略過此步驟。
如果沒有返回,則:
Normal 0 false false false EN-US ZH-CN X-NONESQL> SHUTDOWN IMMEDIATE
SQL> STARTUP UPGRADE
SQL> @?/cpu/view_recompile/view_recompile_jan2008cpu.sql
SQL> SHUTDOWN IMMEDIATE
8. 事後檢查
重新編譯無效物件:
@?/rdbms/admin/utlrp.sql
set line 150
set pagesize 99
col action_time for a30
col action for a30
col comments for a90
col object_name for a30
col object_type for a30
col comp_name for a50
col comp_id for a20
SQL> spool post_check.log
SQL> select instance_name,status from v$instance;
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
SQL> select ACTION_TIME, ACTION, COMMENTS from DBA_REGISTRY_HISTORY;
SQL> select owner,object_name,object_type,status from dba_objects where status<>'VALID';
SQL> select count(*) from dba_objects where status<>'VALID';
SQL> spool off
Normal 0 false false false EN-US ZH-CN X-NONE
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26277071/viewspace-709550/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 打Oracle最新CPU patch與打臨時補丁的區別Oracle
- 在windows 打補丁遇到CODE=41的錯誤Windows
- oracle打補丁回顧Oracle
- Oracle EBS中打補丁Oracle
- Oracle補丁術語介紹 PSU CPU補丁Oracle
- ORACLE打補丁的方法和案例Oracle
- windows oracle 11201打補丁報錯WindowsOracle
- Oracle DG/ADG上CPU/PSU補丁安裝Oracle
- 使用OPatch給Oracle打補丁Oracle
- windows 打補丁後網路異常Windows
- Windows 10打個補丁 Office歇菜了Windows
- ORACLE11G DG打補丁Oracle
- Oracle資料庫打補丁方法Oracle資料庫
- oracle 小補丁能全部打嗎?Oracle
- 在RHAS2.1上打9205的補丁簡單總結!
- 【opatch】Oracle打補丁工具opatch簡介Oracle
- 給Oracle資料庫打補丁(轉)Oracle資料庫
- Oracle CPU補丁包查詢下載的方法Oracle
- 【UP_ORACLE】如何給Oracle DG打補丁(二)備庫安裝補丁步驟Oracle
- 【UP_ORACLE】如何給Oracle DG打補丁(三)主庫安裝補丁步驟Oracle
- Oracle RAC 19.3打19.5.1 RU補丁Oracle
- Oracle Goldengate 12c打pus補丁OracleGo
- Oracle的補丁Oracle
- [Oracle] CPU/PSU補丁安裝詳細教程Oracle
- 聊聊兩種給Grid Infrastructure打補丁的方法(上)ASTStruct
- weblogic的版本及打補丁Web
- 批處理打補丁的方法
- Oracle EBS APP & DB 打補丁過程簡述OracleAPP
- 給oracle打Patch 9352237補丁Oracle
- oracle 補丁Oracle
- ORACLE RAC的全自動 打補丁標準化文件Oracle
- 【補丁】Oracle補丁的知識及術語Oracle
- Linux檔案打補丁Linux
- SAP打補丁(Tcode:SPAM)
- oracle 19c rac打補丁常見錯誤Oracle
- oracle12c之 單機12.1.0.1打補丁Oracle
- 安裝oracle 11g RAC時打8670579?補丁Oracle
- Oracle打補丁時無法正確顯示英文Oracle