[20151022]dataguard備庫與修改RMAN的配置
[20151022]為什麼dataguard的備庫上面無法修改RMAN的配置.txt
--昨天有人問這個問題,連結如下:
http://www.itpub.net/thread-1940567-1-1.html
--我自己也測試看看:
1.測試環境:
SCOTT@test> @ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.3.0 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
DGMGRL> show configuration verbose
Configuration - study
Protection Mode: MaxPerformance
Databases:
test - Primary database
testdg - Physical standby database
Properties:
FastStartFailoverThreshold = '30'
OperationTimeout = '30'
FastStartFailoverLagLimit = '30'
CommunicationTimeout = '180'
FastStartFailoverAutoReinstate = 'TRUE'
FastStartFailoverPmyShutdown = 'TRUE'
BystandersFollowRoleChange = 'ALL'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database testdg
Database - testdg
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s):
testdg
Database Status:
SUCCESS
--備庫應用日誌正常。
--備用機器:
RMAN> show RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> CONFIGURE RETENTION POLICY TO recovery window of 10 days ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 10/22/2015 09:30:45
RMAN-05021: this configuration cannot be changed for a BACKUP or STANDBY control file
--很明顯這個命令不能在dg的rman下執行。
2.不過zergduan指出直接在primary端修改就可以,會自動同步到standby端的.
--關於這點我感覺有點奇怪,這個修改的是控制檔案,理論講不會傳遞過來的,我在連結下也測試過,不再貼上來。
--但是zergduan的筆記指示是成功,唯一的不同他使用catalog資料庫。好奇我自己也建立了catalog資料庫測試看看。
--說明1點:我的catalog是建立在主庫上,這個不是很好,僅僅是測試(這樣資料庫壞了,catalog也無法訪問),正常應該選擇單獨的硬
--件。
--在主庫上執行:
$ rlwrap rman catalog=rman/rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:22:27 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
connected to recovery catalog database
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
--在備庫下執行:
$ rlwrap rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:36:29 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show RETENTION POLICY;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
--可以發現並沒有修改備庫的rman配置引數。
--如果改成加入catalog資料庫登入:
$ rlwrap rman target / catalog=rman/rman@test
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:40:15 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
connected to recovery catalog database
RMAN> show RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
--可以發現這個RETENTION POLICY TO REDUNDANCY 2;
$ rlwrap rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:41:41 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show RETENTION POLICY;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
--從這些可以看出實際上引數並沒有"傳遞"過來,而是使用catalog記錄的rman引數:
SCOTT@test> column VALUE format a30
SCOTT@test> column DB_UNIQUE_NAME format a30
SCOTT@test> select * from rman.CONF where name='RETENTION POLICY';
DB_KEY CONF# NAME VALUE DB_UNIQUE_NAME SITE_KEY CLE
---------- ---------- -------------------- ------------------------------ ------------------------------ ---------- ---
1 5 RETENTION POLICY TO REDUNDANCY 2 0 NO
3.繼續測試:
--在主庫下執行(連上catalog資料庫):
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3 for db_unique_name "TEST";
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 10/22/2015 09:55:40
RMAN-05036: FOR DB_UNIQUE_NAME option cannot be used for this configuration
--只能說明這個引數不支援FOR DB_UNIQUE_NAME選項。
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP Off for db_unique_name "TEST";
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
--說明1點:test對於rman是關鍵字,必須加"引號".
--在備庫下觀察(連上catalog資料庫):
RMAN> show CONTROLFILE AUTOBACKUP;
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
--可以發現這個引數並沒有修改。因為我在主庫上是針對"TEST"進行修改。
--在備庫下觀察(連上catalog資料庫):
RMAN> show CONTROLFILE AUTOBACKUP for db_unique_name "test";
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
SCOTT@test> colum name format a30
SCOTT@test> select * from rman.CONF where name='CONTROLFILE AUTOBACKUP';
DB_KEY CONF# NAME VALUE DB_UNIQUE_NAME SITE_KEY CLE
---------- ---------- ------------------------------ ------------------------------ ------------------------------ ---------- ---
1 5 CONTROLFILE AUTOBACKUP OFF TEST 3 NO
1 4 CONTROLFILE AUTOBACKUP ON TESTDG 832 NO
--可以發現在使用rman+catalog資料庫時引數是從catalog讀取的。
4.在主庫上執行(沒連上catalog資料庫)::
$ rlwrap rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 10:07:10 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show CONTROLFILE AUTOBACKUP;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP On;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
--現在主庫與catalog記錄的不一致:
--在主庫上執行(連上catalog資料庫)::
$ rlwrap rman catalog=rman/rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 10:48:43 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
connected to recovery catalog database
RMAN> show CONTROLFILE AUTOBACKUP;
starting full resync of recovery catalog
full resync complete
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
--注意看提示,會同步更新catalog資料庫中配置。
--可以發現在使用rman+catalog資料庫時引數不一致,會同步更新catalog資料庫中配置。
$ rlwrap rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 10:50:03 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show CONTROLFILE AUTOBACKUP;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
SCOTT@test> select * from rman.CONF where name='CONTROLFILE AUTOBACKUP';
DB_KEY CONF# NAME VALUE DB_UNIQUE_NAME SITE_KEY CLE
---------- ---------- ------------------------------ ------------------------------ ------------------------------ ---------- ---
1 5 CONTROLFILE AUTOBACKUP ON TEST 3 NO
1 4 CONTROLFILE AUTOBACKUP ON TESTDG 832 NO
--實際上在這種情況下 引數從catalog資料中來,如果不一致,catalog會同步資料庫的配置引數。
--昨天有人問這個問題,連結如下:
http://www.itpub.net/thread-1940567-1-1.html
--我自己也測試看看:
1.測試環境:
SCOTT@test> @ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.3.0 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
DGMGRL> show configuration verbose
Configuration - study
Protection Mode: MaxPerformance
Databases:
test - Primary database
testdg - Physical standby database
Properties:
FastStartFailoverThreshold = '30'
OperationTimeout = '30'
FastStartFailoverLagLimit = '30'
CommunicationTimeout = '180'
FastStartFailoverAutoReinstate = 'TRUE'
FastStartFailoverPmyShutdown = 'TRUE'
BystandersFollowRoleChange = 'ALL'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database testdg
Database - testdg
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s):
testdg
Database Status:
SUCCESS
--備庫應用日誌正常。
--備用機器:
RMAN> show RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> CONFIGURE RETENTION POLICY TO recovery window of 10 days ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 10/22/2015 09:30:45
RMAN-05021: this configuration cannot be changed for a BACKUP or STANDBY control file
--很明顯這個命令不能在dg的rman下執行。
2.不過zergduan指出直接在primary端修改就可以,會自動同步到standby端的.
--關於這點我感覺有點奇怪,這個修改的是控制檔案,理論講不會傳遞過來的,我在連結下也測試過,不再貼上來。
--但是zergduan的筆記指示是成功,唯一的不同他使用catalog資料庫。好奇我自己也建立了catalog資料庫測試看看。
--說明1點:我的catalog是建立在主庫上,這個不是很好,僅僅是測試(這樣資料庫壞了,catalog也無法訪問),正常應該選擇單獨的硬
--件。
--在主庫上執行:
$ rlwrap rman catalog=rman/rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:22:27 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
connected to recovery catalog database
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
--在備庫下執行:
$ rlwrap rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:36:29 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show RETENTION POLICY;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
--可以發現並沒有修改備庫的rman配置引數。
--如果改成加入catalog資料庫登入:
$ rlwrap rman target / catalog=rman/rman@test
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:40:15 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
connected to recovery catalog database
RMAN> show RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
--可以發現這個RETENTION POLICY TO REDUNDANCY 2;
$ rlwrap rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 09:41:41 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show RETENTION POLICY;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
--從這些可以看出實際上引數並沒有"傳遞"過來,而是使用catalog記錄的rman引數:
SCOTT@test> column VALUE format a30
SCOTT@test> column DB_UNIQUE_NAME format a30
SCOTT@test> select * from rman.CONF where name='RETENTION POLICY';
DB_KEY CONF# NAME VALUE DB_UNIQUE_NAME SITE_KEY CLE
---------- ---------- -------------------- ------------------------------ ------------------------------ ---------- ---
1 5 RETENTION POLICY TO REDUNDANCY 2 0 NO
3.繼續測試:
--在主庫下執行(連上catalog資料庫):
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3 for db_unique_name "TEST";
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 10/22/2015 09:55:40
RMAN-05036: FOR DB_UNIQUE_NAME option cannot be used for this configuration
--只能說明這個引數不支援FOR DB_UNIQUE_NAME選項。
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP Off for db_unique_name "TEST";
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
--說明1點:test對於rman是關鍵字,必須加"引號".
--在備庫下觀察(連上catalog資料庫):
RMAN> show CONTROLFILE AUTOBACKUP;
RMAN configuration parameters for database with db_unique_name TESTDG are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
--可以發現這個引數並沒有修改。因為我在主庫上是針對"TEST"進行修改。
--在備庫下觀察(連上catalog資料庫):
RMAN> show CONTROLFILE AUTOBACKUP for db_unique_name "test";
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
SCOTT@test> colum name format a30
SCOTT@test> select * from rman.CONF where name='CONTROLFILE AUTOBACKUP';
DB_KEY CONF# NAME VALUE DB_UNIQUE_NAME SITE_KEY CLE
---------- ---------- ------------------------------ ------------------------------ ------------------------------ ---------- ---
1 5 CONTROLFILE AUTOBACKUP OFF TEST 3 NO
1 4 CONTROLFILE AUTOBACKUP ON TESTDG 832 NO
--可以發現在使用rman+catalog資料庫時引數是從catalog讀取的。
4.在主庫上執行(沒連上catalog資料庫)::
$ rlwrap rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 10:07:10 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show CONTROLFILE AUTOBACKUP;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP On;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
--現在主庫與catalog記錄的不一致:
--在主庫上執行(連上catalog資料庫)::
$ rlwrap rman catalog=rman/rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 10:48:43 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
connected to recovery catalog database
RMAN> show CONTROLFILE AUTOBACKUP;
starting full resync of recovery catalog
full resync complete
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
--注意看提示,會同步更新catalog資料庫中配置。
--可以發現在使用rman+catalog資料庫時引數不一致,會同步更新catalog資料庫中配置。
$ rlwrap rman target=sys/btbtms
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 22 10:50:03 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2071943378)
RMAN> show CONTROLFILE AUTOBACKUP;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
SCOTT@test> select * from rman.CONF where name='CONTROLFILE AUTOBACKUP';
DB_KEY CONF# NAME VALUE DB_UNIQUE_NAME SITE_KEY CLE
---------- ---------- ------------------------------ ------------------------------ ------------------------------ ---------- ---
1 5 CONTROLFILE AUTOBACKUP ON TEST 3 NO
1 4 CONTROLFILE AUTOBACKUP ON TESTDG 832 NO
--實際上在這種情況下 引數從catalog資料中來,如果不一致,catalog會同步資料庫的配置引數。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1816213/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RMAN DUPLICATE建立DataGuard物理備庫
- DG_rman配置修改後不會同步到備庫
- dataguard回顧之安裝———使用rman建立物理備庫
- RMAN配置DATAGUARD完整案例(主庫基於ASM儲存)ASM
- ORACLE資料庫dataguard配置,rman移機,dx鎖處Oracle資料庫
- 配置DataGuard的準備知識
- 使用RMAN DUPLICATE...FROM ACTIVE DATABASE命令來建立DataGuard物理備庫Database
- RMAN備用資料庫(邏輯dataguard) --關於dorecover 的解釋 (2)資料庫
- 用rman建立dataguard備用資料庫繼續(無法找到備份檔案)資料庫
- [原創]RMAN備用資料庫(邏輯dataguard) --關於dorecover 的解釋資料庫
- 【DataGuard】手工冷備搭建 Oracle 11g DataGuard 物理備庫Oracle
- rman資料庫全庫備份與恢復資料庫
- 配置RMAN清除已應用到備庫的歸檔日誌
- 【DataGuard】使用GC建立的物理DataGuard主備庫pfile比較GC
- 使用RMAN備份集搭建Oracle Dataguard Step by Step(一)Oracle
- 使用RMAN備份集搭建Oracle Dataguard Step by Step(二)Oracle
- 使用RMAN線上建立DataGuard備用庫(資料檔案不同路徑結構)
- ORACLE RMAN備份的指令碼配置Oracle指令碼
- 配置Oracle11g的Dataguard測試,建立物理備庫(Physical Standby Database)OracleDatabase
- dataguard 主備庫出現gap
- rman 備份 全庫
- 一個備份集同時恢出dataguard的主庫&備庫
- 通過 rman duplicate 配置Oracle 11g Active DataguardOracle
- DataGuard環境下備庫RMAN-05021問題有效性解決方案
- 使用RMAN進行快速Dataguard資料庫建立資料庫
- Oracle資料庫備份與恢復之RMANOracle資料庫
- 主庫RAC,備庫單節點ASM的dataguard搭建ASM
- 【DATAGUARD 學習】管理影響備庫的主庫事件事件
- 【DATAGUARD】DG系列之RACtoONE物理備庫的搭建
- dataguard備庫出現GAP修復
- dataguard-建立物理備庫全程解析
- DataGuard主備庫切換步驟
- linux 配置nfs(rman 備份)LinuxNFS
- dataguard備庫的資料檔案的遷移
- Oracle10G Dataguard 多個備庫 - 主庫和物理備庫的切換Oracle
- rman全備資料庫資料庫
- 【RMAN】Oracle12c之後,rman備份Dataguard備端恢復可能出現邏輯錯誤Oracle
- [20211020]改變備庫的rman配置.txt