- 相關(guān)推薦
關(guān)于[Oracle] Data Guard CPU/PSU補丁安裝的詳細教程
非Data Guard的補丁安裝教程可參考《[Oracle] CPU/PSU補丁安裝詳細教程》,Data Guard需要Primary和Standby同時打上補丁,所以步驟更復(fù)雜一些,其主要步驟如下:
1.在Primary停止日志傳輸服務(wù);
2.關(guān)閉Standby數(shù)據(jù)庫,在Standby的軟件上打補。ㄗ⒁猓翰恍枰獮镾tandby數(shù)據(jù)庫打補丁),啟動standby為mount狀態(tài),不啟用managed recovery;
3.關(guān)閉Primary,在Primary的軟件和數(shù)據(jù)庫本身都打上補。
4.啟動Primary數(shù)據(jù)庫,重新開啟日志傳輸服務(wù);
5.在Standby啟動Redo Apply,這樣Primary上補丁腳本就會自動同步至Standby;
6.檢查Primary和Standby是否都已安裝補丁。
下面是一個具體例子:
1. 在Primary停止日志傳輸服務(wù)
復(fù)制代碼 代碼如下:
sys@EPAY>select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
sys@EPAY>show parameter log_archive_dest_3
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_3 string SERVICE=sta ASYNC VALID_FOR=(O
NLINE_LOGFILES,PRIMARY_ROLE) D
B_UNIQUE_NAME=epaybk
log_archive_dest_30 string
log_archive_dest_31 string
sys@EPAY>alter system set log_archive_dest_state_3=defer scope=both;
System altered.
2.在Standby的Oracle軟件打上補丁
2.1 關(guān)閉數(shù)據(jù)庫實例,listener,ASM實例等
2.2 查看opatch的版本,如果不夠,就去下載最新的版本
2.3 在Standby的Oracle軟件上打補丁
2.4 啟動Standby到mount狀態(tài),啟動listener
(注意:Standby不需要對數(shù)據(jù)庫本身打補。
3. 在Primary上打補丁
3.1 關(guān)閉數(shù)據(jù)庫實例,listener,ASM實例等
3.2 查看opatch的版本,如果不夠,就去下載最新的版本
3.3 在Primary的Oracle軟件上打補丁
3.4 為Primary數(shù)據(jù)庫本身打補丁
復(fù)制代碼 代碼如下:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT
4. 在Primary啟動日志傳輸服務(wù)
4.1 啟動Primary listener,數(shù)據(jù)庫實例等
4.2 強制注冊services到listener
復(fù)制代碼 代碼如下:
sys@EPAY>alter system register;
System altered.
4.3 重新啟動日志傳輸服務(wù)
復(fù)制代碼 代碼如下:
sys@EPAY>alter system set log_archive_dest_state_3=enable scope=both;
System altered.
注意:啟動日志傳輸,在alert里有可能出現(xiàn)如下錯誤:
復(fù)制代碼 代碼如下:
------------------------------------------------------------
Check that the primary and standby are using a password file
and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
and that the SYS password is same in the password files.
returning error ORA-16191
------------------------------------------------------------
根據(jù)錯誤信息的提示,應(yīng)該是主庫在做CPU補丁的時候把sys密碼修改了,用主庫的密碼文件替換備庫的密碼文件即可解決該錯誤。
5. Standby啟動Redo Apply
5.1 open Standby 數(shù)據(jù)庫
5.2 啟用Redo Apply
復(fù)制代碼 代碼如下:
sys@EPAY>alter database recover managed standby database disconnect from session;
Database altered.
5.3 驗證Primary和Standby是否同步
在primary端查詢當前最大的歸檔日志序號:
復(fù)制代碼 代碼如下:
sys@EPAY>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
159
在standby端查詢已傳過來的歸檔日志:
復(fù)制代碼 代碼如下:
sys@EPAY>select sequence#, applied from v$archived_log;
5.4 從alert.log可用看出同步了3個日志文件(即把在primary打的補丁同步到了standby)
復(fù)制代碼 代碼如下:
alter database recover managed standby database disconnect from session
Attempt to start background Managed Standby Recovery process (epay)
Wed Jul 10 06:03:48 2013
MRP0 started with pid=29, OS id=15030
MRP0: Background Managed Standby Recovery process started (epay)
started logmerger process
Wed Jul 10 06:03:53 2013
Managed Standby Recovery not using Real Time Apply
Wed Jul 10 06:04:01 2013
Parallel Media Recovery started with 32 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Wed Jul 10 06:04:01 2013
Completed: alter database recover managed standby database disconnect from session
Media Recovery Log /data/oradata/epay/archivelog/1_157_814716635.dbf
Media Recovery Log /data/oradata/epay/archivelog/1_158_814716635.dbf
Media Recovery Log /data/oradata/epay/archivelog/1_159_814716635.dbf
Media Recovery Waiting for thread 1 sequence 160 (in transit)
6. 后期檢查補丁是否安裝成功
6.1 在primary, standby分別指向opatch lsinventory
6.2 在數(shù)據(jù)庫里檢查補丁是否安裝成功
【[Oracle] Data Guard CPU/PSU補丁安裝的詳細教程】相關(guān)文章:
教你安裝cpu的教程06-29
詳細的小米系統(tǒng)安裝教程解析06-28
廣聯(lián)達安裝算量軟件詳細教程08-04
u盤安裝原版xp系統(tǒng)詳細教程06-29
諾基亞5230主題安裝和刪除詳細圖解教程07-12
Dreamweaver cs6 怎么安裝 一步步詳細安裝教程07-14
openoffice安裝教程04-21
諾基亞e66手機主題的圖文安裝詳細教程07-12