沒有連線target database的情況下執行RMAN duplicate可能引發的問題
前不久對某個資料庫執行backup-based rman duplicate,duplicate過程中沒有任何報錯,但是duplicate完成後得到的副本資料庫並沒有包含我們所需要的資料。
下面是場景的重現:
假設T0時刻資料庫A處於noarchivelog模式,生成了一個全備份;T0.5時刻開啟資料庫建立了t0720_1表,隨即在T1時刻將資料庫置為archivelog模式,之後生成了若干歸檔日誌來到了T2時刻,我們要做的是在T3時刻透過rman duplicate生成一個資料庫A在T0.5時刻的副本。T3>T2>T1>T0.5>T0
經過測試此種場景下獲得的資料庫A的副本是否是T0.5時刻的,取決於執行duplicate時是否連線target database,這裡target database指的就是資料庫A
環境版本:11.2.0.3.3
///////////
// 首先構造測試資料
///////////
###資料庫A:從archivelog模式改成noarchivelog模式,生成consistent backup
shutdown immediate
startup mount
alter database noarchivelog;
SYS@tstdb1-SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 76
Current log sequence 78
rman target / catalog rman/773946@tstdb2
backup database include current controlfile format '/oradata06/dupuse/0720/whole_db_%u';
alter database open;
create table t1(id number) tablespace xdbts;
insert into t1 values(1);
commit;
SQL> select count(*) from t1;
COUNT(*)
----------
1
select sysdate from dual;
SYSDATE
-----------------
20150720 15:06:37 <---T0.5時刻是我們duplicate的目標時間,這個時間點上資料庫是處於noarchivelog模式的,且t1表存在
---T0.5時刻:20150720 15:06:37所對應的修改日誌都記錄在log sequence# 78這個log裡
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 76
Current log sequence 78
###從noarchivelog修改成archivelog模式
shutdown immediate
startup mount
alter database archivelog;
alter database open;
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 76
Next log sequence to archive 78
Current log sequence 78
###切換一個logfile後當前log sequence#=79,也就是我們之後的dml操作都會記錄在sequence#=79這個logfile裡
alter system switch logfile;
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 77
Next log sequence to archive 79
Current log sequence 79
###建立測試表
create table t2(id number) tablespace XDBTS;
insert into t2 values(2);
commit;
SQL> select count(*) from t2;
COUNT(*)
----------
1
select sysdate from dual;
SYSDATE
-----------------
20150720 15:10:33
---切換一輪logfile
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 80
Next log sequence to archive 82
Current log sequence 82
---備份log sequence# 78~81
backup archivelog sequence between 78 and 81 format '/oradata06/dupuse/0720/arch_%u';
---log sequence 78~81的起始和結束時間,之後我們所指定的恢復時間20150720 15:06:37就包含在log sequence# 78裡
RMAN> list backup of archivelog sequence between 78 and 81;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -----------------
111667 2.31M DISK 00:00:00 20150720 15:11:56
BP Key: 111670 Status: AVAILABLE Compressed: NO Tag: TAG20150720T151155
Piece Name: /oradata06/dupuse/0720/arch_07qchcps
List of Archived Logs in backup set 111667
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ----------------- ---------- ---------
1 78 12723364657858 20150720 14:35:41 12723364660676 20150720 15:08:51
1 79 12723364660676 20150720 15:08:51 12723364660826 20150720 15:10:47
1 80 12723364660826 20150720 15:10:47 12723364660831 20150720 15:10:54
1 81 12723364660831 20150720 15:10:54 12723364660837 20150720 15:11:00
###複製backuppiece到duplicate命令的主機
scp /oradata06/dupuse/0720/* oracle@10.10.149.110:/oradata06/dupuse/0720/
###duplicate instance所使用的初始化引數檔案內容如下:
DB_NAME=dupdb3
sga_target=500M
db_block_size=8192
db_file_name_convert='/oradata06/testaaaaa','/oradata06/testccccc','/oradata06/omf/TSTDB1/datafile/o1_mf_omftbs1_1kkDQZdsn_.dbf','/oradata06/omf/9.dbf'
log_file_name_convert='/oradata06/testaaaaa','/oradata06/testccccc1'
###啟動dupdb3到nomount
export ORACLE_SID=dupdb3
sqlplus '/as sysdba'
startup nomount
///////////
// 測試各種duplicate場景
///////////
###<場景1>:只連線target database,執行duplicate database tstdb1 to dupdb3 until time '20150720 15:06:37';
rman target sys/773946@tstdb1 auxiliary sys/asdf3_14@dupdb3
RMAN>duplicate database tstdb1 to dupdb3 until time '20150720 15:06:37'; <---20150720 15:06:37這個時間包含在log sequence# 78裡,從duplicate的輸出能看出apply log sequence# 78的過程,限於篇幅僅列出了部分輸出
。。。
Starting restore at 20150720 15:16:43
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata06/testccccc/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oradata06/testccccc/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata06/testccccc/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata06/testccccc/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /oradata06/testccccc/xdbts1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /oradata06/omf/9.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /oradata06/testccccc/undotbs3.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oradata06/dupuse/0720/whole_db_05qchccl
channel ORA_AUX_DISK_1: piece handle=/oradata06/dupuse/0720/whole_db_05qchccl tag=TAG20150720T150451
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:37
Finished restore at 20150720 15:17:21
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=885568988 file name=/oradata06/testccccc/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=885568988 file name=/oradata06/testccccc/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=885568988 file name=/oradata06/testccccc/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=885568988 file name=/oradata06/testccccc/users01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=885568988 file name=/oradata06/testccccc/xdbts1.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=14 STAMP=885568988 file name=/oradata06/omf/9.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=15 STAMP=885568988 file name=/oradata06/testccccc/undotbs3.dbf
contents of Memory Script:
{
set until time "to_date('JUL 20 2015 15:06:37', 'MON DD YYYY HH24:MI:SS')";
recover
clone database
skip forever tablespace "TS0422_1" delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 20150720 15:17:22
using channel ORA_AUX_DISK_1
Executing: alter database datafile 5 offline drop
starting media recovery
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=78
channel ORA_AUX_DISK_1: reading from backup piece /oradata06/dupuse/0720/arch_07qchcps
channel ORA_AUX_DISK_1: piece handle=/oradata06/dupuse/0720/arch_07qchcps tag=TAG20150720T151155
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_78_884446916.dbf thread=1 sequence=78 <---- apply log sequence# 78
channel clone_default: deleting archived log(s)
archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_78_884446916.dbf RECID=16 STAMP=885568991
media recovery complete, elapsed time: 00:00:01
Oracle instance started
。。。
Finished Duplicate Db at 20150720 15:17:56
---duplicate結束後連線到dupdb3、檢視dupdb3庫處於archivelog模式,但是資料庫A在20150720 15:06:37 時刻尚處於noarchivelog模式,這一點稍有差異
export ORACLE_SID=dupdb3
sqlplus '/as sysdba'
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
---dupdb3庫裡的表物件檢查,在20150720 15:06:37時刻表t1存在、表t2不存在,實際結果與此相符
SQL> select count(*) from t1;
COUNT(*)
----------
1
SQL> select count(*) from t0720_2;
select count(*) from t0720_2
*
ERROR at line 1:
ORA-00942: table or view does not exist
階段結論:在僅連線target database的情況下,duplicate的過程中能夠apply archivelog,能準確生成資料庫A在T0.5時刻的副本dupdb3;唯一有出入的是dupdb3變成了archivelog模式,而資料庫A在T0.5時刻是noarchivelog模式的。猜測原因可能是因為沒有連線catalog的情況下,controlfile作為repository無法記錄修改歷史,所以無法判斷T0.5時刻資料庫處於archivelog還是noarchivelog模式,統一以target database當前所處的狀態為基準。
###<場景2.>duplicate僅連線catalog,執行duplicate database tstdb1 to dupdb3 until time '20150720 15:06:37';
rman catalog rman/773946@tstdb2 auxiliary sys/asdf3_14@dupdb3
RMAN> duplicate database tstdb1 dbid 2051793563 to dupdb3 until time '20150720 15:06:37'; <---為限制篇幅省略了部分輸出
。。。
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata06/testccccc/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oradata06/testccccc/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata06/testccccc/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata06/testccccc/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /oradata06/testccccc/xdbts1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /oradata06/omf/9.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /oradata06/testccccc/undotbs3.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oradata06/dupuse/0720/whole_db_05qchccl
channel ORA_AUX_DISK_1: piece handle=/oradata06/dupuse/0720/whole_db_05qchccl tag=TAG20150720T150451
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 20150720 15:24:24
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=885569410 file name=/oradata06/testccccc/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=885569410 file name=/oradata06/testccccc/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=885569410 file name=/oradata06/testccccc/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=885569410 file name=/oradata06/testccccc/users01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=885569410 file name=/oradata06/testccccc/xdbts1.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=14 STAMP=885569410 file name=/oradata06/omf/9.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=15 STAMP=885569410 file name=/oradata06/testccccc/undotbs3.dbf
contents of Memory Script:
{
set until time "to_date('JUL 20 2015 15:06:37', 'MON DD YYYY HH24:MI:SS')";
recover
clone database
skip forever tablespace "TS0422_1" noredo
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 20150720 15:24:24
using channel ORA_AUX_DISK_1
Executing: alter database datafile 5 offline drop
Finished recover at 20150720 15:24:25
Oracle instance started
。。。
Finished Duplicate Db at 20150720 15:25:08
---duplicate結束以後檢視dupdb3仍處於noarchivelog模式
export ORACLE_SID=dupdb3
sqlplus '/as sysdba'
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence 1
Current log sequence 1
---驗證資料表t1、t2,結果t1、t2均不存在
SQL> select count(*) from t1;
select count(*) from t1
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select count(*) from t2;
select count(*) from t2
*
ERROR at line 1:
ORA-00942: table or view does not exist
階段結論: 僅連線catalog的情況下,觀察到整個過程中沒有apply archivelog的步驟,最後得到的dupdb仍處於noarchivelog模式;duplicate只能生成資料庫A在T0時刻的副本dupdb3,不會apply任何含有大於等於T0時刻修改日誌的archivelog,也就無法與恢復到我們所期望的T0.5時刻,duplicate得到的dupdb3處於noarchivelog模式。因為catalog能夠準確記錄每一次資料庫狀態的變更,當然也會記錄noarchivelog->archivelog的狀態變更,當我們指定duplicate database ... until time T0.5的時候RMAN判斷此刻資料庫A處於noarchivelog模式,也就不會去應用任何的archivelog。
###<場景3.>duplicate使用backup location,不連線target和catalog,執行duplicate database tstdb1 to dupdb3 until time '20150720 15:06:37' backup location '/oradata06/dupuse/0720/';
rman auxiliary sys/asdf3_14@dupdb3
RMAN> duplicate database tstdb1 to dupdb3 until time '20150720 15:06:37' backup location '/oradata06/dupuse/0720/';
。。。
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata06/testccccc/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oradata06/testccccc/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata06/testccccc/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata06/testccccc/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /oradata06/testccccc/xdbts1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /oradata06/omf/9.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /oradata06/testccccc/undotbs3.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oradata06/dupuse/0720/whole_db_05qchccl
channel ORA_AUX_DISK_1: piece handle=/oradata06/dupuse/0720/whole_db_05qchccl tag=TAG20150720T150451
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 20150720 15:35:43
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=885570090 file name=/oradata06/testccccc/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=885570090 file name=/oradata06/testccccc/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=885570090 file name=/oradata06/testccccc/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=885570090 file name=/oradata06/testccccc/users01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=12 STAMP=885570090 file name=/oradata06/testccccc/xdbts1.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=13 STAMP=885570090 file name=/oradata06/omf/9.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=14 STAMP=885570090 file name=/oradata06/testccccc/undotbs3.dbf
contents of Memory Script:
{
set until time "to_date('JUL 20 2015 15:06:37', 'MON DD YYYY HH24:MI:SS')";
recover
clone database
skip forever tablespace "TS0422_1" noredo
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 20150720 15:35:44
using channel ORA_AUX_DISK_1
Executing: alter database datafile 5 offline drop
Finished recover at 20150720 15:35:44
Oracle instance started
。。。
Finished Duplicate Db at 20150720 15:36:13
---duplicate結束以後檢視dupdb3仍處於noarchivelog模式
export ORACLE_SID=dupdb3
sqlplus '/as sysdba'
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence 1
Current log sequence 1
---驗證資料表t1、t2,結果t1、t2均不存在
SQL> select count(*) from t1;
select count(*) from t1
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select count(*) from t2;
select count(*) from t2
*
ERROR at line 1:
ORA-00942: table or view does not exist
階段結論:在使用backup location的情況下,觀察到整個過程中沒有apply archivelog的步驟;duplicate只能生成資料庫A在T0時刻的副本dupdb3,不會apply任何含有大於等於T0時刻修改記錄的archivelog,也就無法與恢復到我們所期望的T0.5時刻,duplicate得到的dupdb3處於noarchivelog模式。因為catalog能夠準確記錄每一次資料庫狀態的變更,這也包括了會記錄noarchivelog->archivelog的狀態變更,當我們指定duplicate database ... until time T0.5的時候RMAN判斷此刻資料庫A處於noarchivelog模式,也就不會去應用任何的archivelog。
###<場景4.>duplicate同時連線target和catalog,執行duplicate database tstdb1 dbid 2051793563 to dupdb3 until time '20150720 15:06:37';
rman target sys/773946@tstdb1 catalog rman/773946@tstdb2 auxiliary sys/asdf3_14@dupdb3
RMAN> duplicate database tstdb1 dbid 2051793563 to dupdb3 until time '20150720 15:06:37';
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata06/testccccc/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oradata06/testccccc/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata06/testccccc/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata06/testccccc/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /oradata06/testccccc/xdbts1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /oradata06/omf/9.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /oradata06/testccccc/undotbs3.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oradata06/dupuse/0720/whole_db_05qchccl
channel ORA_AUX_DISK_1: piece handle=/oradata06/dupuse/0720/whole_db_05qchccl tag=TAG20150720T150451
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 20150720 15:41:45
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=885570452 file name=/oradata06/testccccc/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=885570452 file name=/oradata06/testccccc/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=885570452 file name=/oradata06/testccccc/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=885570452 file name=/oradata06/testccccc/users01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=885570452 file name=/oradata06/testccccc/xdbts1.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=14 STAMP=885570452 file name=/oradata06/omf/9.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=15 STAMP=885570452 file name=/oradata06/testccccc/undotbs3.dbf
contents of Memory Script:
{
set until time "to_date('JUL 20 2015 15:06:37', 'MON DD YYYY HH24:MI:SS')";
recover
clone database
skip forever tablespace "TS0422_1" delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 20150720 15:41:46
using channel ORA_AUX_DISK_1
Executing: alter database datafile 5 offline drop
starting media recovery
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=78
channel ORA_AUX_DISK_1: reading from backup piece /oradata06/dupuse/0720/arch_07qchcps
channel ORA_AUX_DISK_1: piece handle=/oradata06/dupuse/0720/arch_07qchcps tag=TAG20150720T151155
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_78_884446916.dbf thread=1 sequence=78 <--- apply log sequence# 78
channel clone_default: deleting archived log(s)
archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_78_884446916.dbf RECID=16 STAMP=885570454
media recovery complete, elapsed time: 00:00:01
Finished recover at 20150720 15:41:49
Oracle instance started
。。。
Finished Duplicate Db at 20150720 15:42:34
---duplicate結束以後檢視dupdb3變為了archivelog模式
export ORACLE_SID=dupdb3
sqlplus '/as sysdba'
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
---驗證資料表t1、t2,結果t1、t2均不存在
SQL> select count(*) from t1;
COUNT(*)
----------
1
SQL> select count(*) from t2;
select count(*) from t2
*
ERROR at line 1:
ORA-00942: table or view does not exist
階段結論: 同時連線target和catalog執行duplicate的情況下,duplicate能透過apply archivelog如期生成資料庫A在T0.5時刻的副本dupdb3,唯一有出入的是dupdb3變成了archivelog模式,而資料庫A在T0.5時刻是noarchivelog模式的。猜測原因可能是因為沒有連線catalog的情況下,controlfile作為repository無法記錄修改歷史,所以無法判斷T0.5時刻資料庫處於archivelog還是noarchivelog模式,統一以target database當前所處的狀態為基準。該測試結果同僅連線target的場景一致
總結:對一個archivelog模式的target資料庫執行backup-based RMAN duplicate的時候,如果RMAN使用的是target資料庫在noarchivelog模式下生成的一致性備份進行restore,那麼會出現如下兩種結果:
(1) 執行duplicate時如果連線了target,無論是否連線catalog,都能準確恢復到我們所指定的時間,但此時要注意複製出來的db是archivelog模式的,如果有必要需要人工將其改成noarchivelog模式
(2) 執行duplicate時如果沒有連線target,只能恢復到一致性備份的時間點,這個時間點並不一定是我們所指定的時間,因此複製出來的db裡不一定包含我們想要的資料。
不能確認是否為oracle的bug,建議大家儘可能在連線target database的情況下執行RMAN duplicate
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/53956/viewspace-1742178/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 不應該在沒有 sudo 的情況下執行 Docker 的原因Docker
- gorm使用事務併發情況下切有最大mysql連線數限制的情況下的BUG,踩坑了GoORMMySql
- 有return的情況下try catch finally的執行順序
- (轉)有return的情況下try catch finally的執行順
- 華納雲:連線Ubuntu伺服器有問題是什麼情況?Ubuntu伺服器
- Druid連線池引數maxWait配置錯誤引發的問題UIAI
- 開始使用 Org 模式吧,在沒有 Emacs 的情況下模式Mac
- JPA EntityManager 在沒有實體類的情況下返回Map
- Hue的Impala模組沒有釋放連線的問題解決
- 關於在執行java連線MongoDB時遇到的連線超時問題JavaMongoDB
- JS中缺少分號可能引發的問題JS
- 執行緒中斷以及執行緒中斷引發的那些問題執行緒
- Nature回應:為什麼在沒有程式碼的情況下發布AlphaFold3?
- air在go的其他版本上執行可能遇到的問題AIGo
- 如何這沒有顯示器的情況下獲取樹莓派IP?樹莓派
- 沒有介面文件的情況下如何開展介面自動化測試?
- WPF 的 await Application.Current.Dispatcher.InvokeAsync,Func 如果是Task , 等待賦值可能存在沒有等待執行完成的問題AIAPP賦值
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同UXDatabaseOracle
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid相同UXDatabaseOracle
- RabbitMQ如何解決各種情況下丟資料的問題MQ
- 在沒有curl和wget情況下傳送HTTP請求wgetHTTP
- 資料庫事務併發問題----各種事務隔離下的情況資料庫
- Lcust 分散式執行時的引數化問題分散式
- 單例模式中可能存在的一些問題(執行緒安全問題)單例模式執行緒
- 解決CentOS /etc/sysconfig/下沒有iptables的問題CentOS
- 求助:沒有產品說明文件和需求文件的情況下能夠進行黑盒測試嗎?
- RMAN Duplicate RAC to Single Instance
- Win10系統怎麼連線iscsi target_Win10連線iscsi target的方法Win10
- ORACLE expdp在表空間較多的情況下執行非常緩慢Oracle
- Java併發(11)- 有關執行緒池的10個問題Java執行緒
- PostgreSQL 14中連線引數target_session_attrs增強SQLSession
- Github ssh的連線問題Github
- rman duplicate操作手冊
- 一般情況下,監督學習最小化問題的通式
- 嘗試載入 Oracle 客戶端庫時引發 BadImageFormatException。如果在安裝 32 位 Oracle 客戶端元件的情況下以 64 位模式執行,將出現此問題。...Oracle客戶端ORMException元件模式
- 框架下載後解壓失敗,有沒有遇到同樣情況的?框架
- [20190116]rman的老問題.txt
- 併發、多執行緒、HTTP連線數有何關係?執行緒HTTP
- JVM調優筆記(一)--Nacos GC引發的服務批次下線問題JVM筆記GC