DATAGUARD手记(DUPLICATE)(四)-程序员宅基地

http://zhouwf0726.itpub.net/post/9689/395349
http://zhouwf0726.itpub.net/post/9689/395350
http://zhouwf0726.itpub.net/post/9689/395437
http://zhouwf0726.itpub.net/post/9689/401874
http://zhouwf0726.itpub.net/post/9689/403401

为了测试在含有DG和STREAM环境的ORACLE升级,搭建一个测试环境,首先搭建DG环境。


一、登录主机备份数据库

db-tfusn2cn-a-r1.amazon$ sudo -H -u oracle /opt/third-party/bin/logbash --login
amazon.com authorized use only. weifengz@db-tfusn2cn-a-r1 Password:
no VLM_WINDOW_SIZE entry for DEFAULT, using default (512MB)

LD_LIBRARY_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib:/opt/third-party/lib:/usr/lib
ORACLE_SID=DEFAULT
ORACLE_HOME=/opt/app/oracle/product/10.1.0.4/A04db
SHLIB_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib
TZ=UTC
VLM_WINDOW_SIZE=
DISABLE_MAP_LOCK - 1

logbash: /opt/app/oracle: is a directory
oracle:db-tfusn2cn-a-r1.amazon.com: /opt/app/oracle> oraenvamzn yudong
no VLM_WINDOW_SIZE entry for yudong, using default (512MB)

LD_LIBRARY_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib:/opt/third-party/lib:/usr/lib
ORACLE_SID=yudong
ORACLE_HOME=/opt/app/oracle/product/10.1.0.4/A04db
SHLIB_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib
TZ=UTC
VLM_WINDOW_SIZE=
DISABLE_MAP_LOCK - 1

oracle:db-tfusn2cn-a-r1.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> $ORACLE_HOME/bin/rman target /

Recovery Manager: Release 10.1.0.4.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

connected to target database: YUDONG (DBID=404134968)

RMAN> backup tag 'fullforstandby' database include current controlfile for standby plus archivelog;


Starting backup at 30-SEP-07
current log archived
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=106 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=700 recid=2612 stamp=634132672
input archive log thread=1 sequence=701 recid=2614 stamp=634132694

..................................................................
..................................................................

input archive log thread=1 sequence=758 recid=2771 stamp=634304182
input archive log thread=1 sequence=759 recid=2774 stamp=634307781
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7ait70oh_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=760 recid=2777 stamp=634311381
input archive log thread=1 sequence=761 recid=2780 stamp=634314983

..................................................................
..................................................................

input archive log thread=1 sequence=802 recid=2903 stamp=634458782
input archive log thread=1 sequence=803 recid=2906 stamp=634462384
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7bit70oq_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=804 recid=2909 stamp=634465983
input archive log thread=1 sequence=805 recid=2912 stamp=634469582

..................................................................
..................................................................

input archive log thread=1 sequence=850 recid=3043 stamp=634618289


input archive log thread=1 sequence=851 recid=3045

stamp=634618640
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7cit70p2_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 30-SEP-07

Starting backup at 30-SEP-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00017 name=/fs-a01-a/databases/yudong/large_idx-01.dbf
input datafile fno=00014 name=/fs-a01-a/databases/yudong/administrator-02.dbf
input datafile fno=00001 name=/fs-a01-b/databases/yudong/system-01.dbf
input datafile fno=00004 name=/fs-a01-a/databases/yudong/administrator-01.dbf
input datafile fno=00006 name=/fs-a01-b/databases/yudong/replication-01.dbf
input datafile fno=00008 name=/fs-a01-a/databases/yudong/precise_or_tab-01.dbf
input datafile fno=00002 name=/fs-a01-a/databases/yudong/undo_t1-01.dbf
input datafile fno=00003 name=/fs-a01-a/databases/yudong/sysaux-01.dbf
input datafile fno=00005 name=/fs-a01-b/databases/yudong/administrator_idx-01.dbf
input datafile fno=00009 name=/fs-a01-b/databases/yudong/system-02.dbf
input datafile fno=00010 name=/fs-a01-a/databases/yudong/large_idx-02.dbf
input datafile fno=00007 name=/fs-a01-a/databases/yudong/replication_idx-01.dbf
input datafile fno=00011 name=/fs-a01-b/databases/yudong/system-03.dbf
input datafile fno=00016 name=/fs-a01-a/databases/yudong/zwf_new.dbf
input datafile fno=00012 name=/fs-a01-a/databases/yudong/large_idx-03.dbf
input datafile fno=00013 name=/fs-a01-a/databases/yudong/sysaux-02.dbf
input datafile fno=00015 name=/fs-a01-a/databases/yudong/zwf.dbf
input datafile fno=00018 name=/fs-a01-a/databases/yudong/zwf_new_new.dbf
input datafile fno=00020 name=/fs-a01-a/databases/yudong/t_zwf.dbf
input datafile fno=00019 name=/fs-a01-a/databases/yudong/zwf_new_new_new.dbf
channel ORA_DISK_1: starting piece 1 at 30-SEP-07

channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7dit70pa_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:36

channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including standby controlfile in backupset
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7eit70u6_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 30-SEP-07

Starting backup at 30-SEP-07
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set


input archive log thread=1 sequence=852 recid=3047

stamp=634618825
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7fit70u9_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 30-SEP-07

Starting Control File Autobackup at 30-SEP-07
piece handle=/oracle-backup/db-backup/databases/yudong/c-404134968-20070930-03 comment=NONE
Finished Control File Autobackup at 30-SEP-07

二、登录从机创建STANDBY


weifengz.desktop% sudo -H -u oracle /opt/third-party/bin/logbash --login
amazon.com authorized use only. weifengz@weifengz Password:

No such sid "DEFAULT".
Using default values.
no VLM_WINDOW_SIZE entry for , using default (512MB)

LD_LIBRARY_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib:/opt/third-party/lib:/usr/lib
ORACLE_SID=
ORACLE_HOME=/opt/app/oracle/product/10.1.0.4/A04db
SHLIB_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib
TZ=UTC
VLM_WINDOW_SIZE=
DISABLE_MAP_LOCK - 1

logbash: /opt/app/oracle: is a directory
oracle:weifengz.desktop.amazon.com: /opt/app/oracle> oraenvamzn yudong
no VLM_WINDOW_SIZE entry for yudong, using default (512MB)

LD_LIBRARY_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib:/opt/third-party/lib:/usr/lib
ORACLE_SID=yudong
ORACLE_HOME=/opt/app/oracle/product/10.1.0.4/A04db
SHLIB_PATH=/opt/app/oracle/product/10.1.0.4/A04db/lib
TZ=UTC
VLM_WINDOW_SIZE=
DISABLE_MAP_LOCK - 1


oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> scp [email protected]:/opt/app/oracle/product/10.1.0.4/A04db/dbs/6oit6r09_1_1 .
Password:
Response:
6oit6r09_1_1 100% 176MB 10.1MB/s 00:16
oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> scp [email protected]:/opt/app/oracle/product/10.1.0.4/A04db/dbs/6pit6r0p_1_1 .
Password:
Response:
6pit6r0p_1_1 100% 175MB 10.0MB/s 00:16
oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> scp [email protected]:/opt/app/oracle/product/10.1.0.4/A04db/dbs/6qit6r12_1_1 .
Password:
Response:
6qit6r12_1_1 100% 175MB 10.1MB/s 00:15
oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> scp [email protected]:/opt/app/oracle/product/10.1.0.4/A04db/dbs/6rit6r1a_1_1 .
Password:
Response:
6rit6r1a_1_1 100% 1351MB 10.0MB/s 02:01
oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> scp [email protected]:/opt/app/oracle/product/10.1.0.4/A04db/dbs/6sit6r67_1_1 .
Password:
Response:
6sit6r67_1_1 100% 9248KB 9.0MB/s 00:01
oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> scp [email protected]:/opt/app/oracle/product/10.1.0.4/A04db/dbs/6tit6r69_1_1 .
Password:
Response:
6tit6r69_1_1 100% 188KB 0.0KB/s 00:00


oracle:weifengz.desktop.amazon.com: /opt/app/oracle/product/10.1.0.4/A04db/dbs> $ORACLE_HOME/bin/rman target sys/sys@yudong_a auxiliary sys/sys@yudong_b

Recovery Manager: Release 10.1.0.4.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

connected to target database: YUDONG (DBID=404134968)
connected to auxiliary database (not started)

RMAN> startup auxiliary nomount;

Oracle instance started

Total System Global Area 490733568 bytes

Fixed Size 779456 bytes
Variable Size 407771968 bytes
Database Buffers 81920000 bytes
Redo Buffers 262144 bytes

RMAN> run{
2> set until sequence=851 thread=1;
3> duplicate target database for standby dorecover nofilenamecheck;
4> }

executing command: SET until clause
using target database controlfile instead of recovery catalog

Starting Duplicate Db at 30-SEP-07
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=141 devtype=DISK

contents of Memory Script:
{
set until scn 260704166;
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script

executing command: SET until clause

Starting restore at 30-SEP-07
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring controlfile
ORA-19624: operation failed, retry possible
ORA-19505: failed to identify file "/opt/app/oracle/product/10.1.0.4/A04db/dbs/73it70b7_1_1"
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory

Additional information: 3
failover to previous backup

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring controlfile
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/6sit6r67_1_1 tag=TAG20070930T011938
channel ORA_AUX_DISK_1: restore complete
output filename=/ctl-01/databases/yudong/control.ctl
output filename=/ctl-02/databases/yudong/control.ctl
Finished restore at 30-SEP-07

sql statement: alter database mount standby database

contents of Memory Script:
{
set until scn 260704166;
set newname for datafile 1 to
"/fs-a01-b/databases/yudong/system-01.dbf";
set newname for datafile 2 to
"/fs-a01-a/databases/yudong/undo_t1-01.dbf";
set newname for datafile 3 to
"/fs-a01-a/databases/yudong/sysaux-01.dbf";
set newname for datafile 4 to
"/fs-a01-a/databases/yudong/administrator-01.dbf";
set newname for datafile 5 to
"/fs-a01-b/databases/yudong/administrator_idx-01.dbf";
set newname for datafile 6 to
"/fs-a01-b/databases/yudong/replication-01.dbf";
set newname for datafile 7 to
"/fs-a01-a/databases/yudong/replication_idx-01.dbf";
set newname for datafile 8 to
"/fs-a01-a/databases/yudong/precise_or_tab-01.dbf";
set newname for datafile 9 to
"/fs-a01-b/databases/yudong/system-02.dbf";
set newname for datafile 10 to
"/fs-a01-a/databases/yudong/large_idx-02.dbf";
set newname for datafile 11 to
"/fs-a01-b/databases/yudong/system-03.dbf";
set newname for datafile 12 to
"/fs-a01-a/databases/yudong/large_idx-03.dbf";
set newname for datafile 13 to
"/fs-a01-a/databases/yudong/sysaux-02.dbf";
set newname for datafile 14 to
"/fs-a01-a/databases/yudong/administrator-02.dbf";
set newname for datafile 15 to
"/fs-a01-a/databases/yudong/zwf.dbf";
set newname for datafile 16 to
"/fs-a01-a/databases/yudong/zwf_new.dbf";
set newname for datafile 17 to
"/fs-a01-a/databases/yudong/large_idx-01.dbf";
set newname for datafile 18 to
"/fs-a01-a/databases/yudong/zwf_new_new.dbf";
set newname for datafile 19 to
"/fs-a01-a/databases/yudong/zwf_new_new_new.dbf";
set newname for datafile 20 to
"/fs-a01-a/databases/yudong/t_zwf.dbf";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 30-SEP-07
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /fs-a01-b/databases/yudong/system-01.dbf
restoring datafile 00002 to /fs-a01-a/databases/yudong/undo_t1-01.dbf
restoring datafile 00003 to /fs-a01-a/databases/yudong/sysaux-01.dbf
restoring datafile 00004 to /fs-a01-a/databases/yudong/administrator-01.dbf
restoring datafile 00005 to /fs-a01-b/databases/yudong/administrator_idx-01.dbf
restoring datafile 00006 to /fs-a01-b/databases/yudong/replication-01.dbf
restoring datafile 00007 to /fs-a01-a/databases/yudong/replication_idx-01.dbf
restoring datafile 00008 to /fs-a01-a/databases/yudong/precise_or_tab-01.dbf
restoring datafile 00009 to /fs-a01-b/databases/yudong/system-02.dbf
restoring datafile 00010 to /fs-a01-a/databases/yudong/large_idx-02.dbf
restoring datafile 00011 to /fs-a01-b/databases/yudong/system-03.dbf
restoring datafile 00012 to /fs-a01-a/databases/yudong/large_idx-03.dbf
restoring datafile 00013 to /fs-a01-a/databases/yudong/sysaux-02.dbf
restoring datafile 00014 to /fs-a01-a/databases/yudong/administrator-02.dbf
restoring datafile 00015 to /fs-a01-a/databases/yudong/zwf.dbf
restoring datafile 00016 to /fs-a01-a/databases/yudong/zwf_new.dbf
restoring datafile 00017 to /fs-a01-a/databases/yudong/large_idx-01.dbf
restoring datafile 00018 to /fs-a01-a/databases/yudong/zwf_new_new.dbf
restoring datafile 00019 to /fs-a01-a/databases/yudong/zwf_new_new_new.dbf
restoring datafile 00020 to /fs-a01-a/databases/yudong/t_zwf.dbf
ORA-19624: operation failed, retry possible
ORA-19505: failed to identify file "/opt/app/oracle/product/10.1.0.4/A04db/dbs/72it706b_1_1"
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
failover to previous backup

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /fs-a01-b/databases/yudong/system-01.dbf
restoring datafile 00002 to /fs-a01-a/databases/yudong/undo_t1-01.dbf
restoring datafile 00003 to /fs-a01-a/databases/yudong/sysaux-01.dbf
restoring datafile 00004 to /fs-a01-a/databases/yudong/administrator-01.dbf
restoring datafile 00005 to /fs-a01-b/databases/yudong/administrator_idx-01.dbf
restoring datafile 00006 to /fs-a01-b/databases/yudong/replication-01.dbf
restoring datafile 00007 to /fs-a01-a/databases/yudong/replication_idx-01.dbf
restoring datafile 00008 to /fs-a01-a/databases/yudong/precise_or_tab-01.dbf
restoring datafile 00009 to /fs-a01-b/databases/yudong/system-02.dbf
restoring datafile 00010 to /fs-a01-a/databases/yudong/large_idx-02.dbf
restoring datafile 00011 to /fs-a01-b/databases/yudong/system-03.dbf
restoring datafile 00012 to /fs-a01-a/databases/yudong/large_idx-03.dbf
restoring datafile 00013 to /fs-a01-a/databases/yudong/sysaux-02.dbf
restoring datafile 00014 to /fs-a01-a/databases/yudong/administrator-02.dbf
restoring datafile 00015 to /fs-a01-a/databases/yudong/zwf.dbf
restoring datafile 00016 to /fs-a01-a/databases/yudong/zwf_new.dbf
restoring datafile 00017 to /fs-a01-a/databases/yudong/large_idx-01.dbf
restoring datafile 00018 to /fs-a01-a/databases/yudong/zwf_new_new.dbf
restoring datafile 00019 to /fs-a01-a/databases/yudong/zwf_new_new_new.dbf
restoring datafile 00020 to /fs-a01-a/databases/yudong/t_zwf.dbf

channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/6rit6r1a_1_1 tag=TAG20070930T011938
channel ORA_AUX_DISK_1: restore complete
Finished restore at 30-SEP-07

contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafilecopy recid=37 stamp=634621649 filename=/fs-a01-b/databases/yudong/system-01.dbf
datafile 2 switched to datafile copy
input datafilecopy recid=38 stamp=634621649 filename=/fs-a01-a/databases/yudong/undo_t1-01.dbf
datafile 3 switched to datafile copy
input datafilecopy recid=39 stamp=634621649 filename=/fs-a01-a/databases/yudong/sysaux-01.dbf
datafile 4 switched to datafile copy
input datafilecopy recid=40 stamp=634621649 filename=/fs-a01-a/databases/yudong/administrator-01.dbf
datafile 5 switched to datafile copy
input datafilecopy recid=41 stamp=634621649 filename=/fs-a01-b/databases/yudong/administrator_idx-01.dbf
datafile 6 switched to datafile copy
input datafilecopy recid=42 stamp=634621649 filename=/fs-a01-b/databases/yudong/replication-01.dbf
datafile 7 switched to datafile copy
input datafilecopy recid=43 stamp=634621649 filename=/fs-a01-a/databases/yudong/replication_idx-01.dbf
datafile 8 switched to datafile copy
input datafilecopy recid=44 stamp=634621649 filename=/fs-a01-a/databases/yudong/precise_or_tab-01.dbf
datafile 9 switched to datafile copy
input datafilecopy recid=45 stamp=634621650 filename=/fs-a01-b/databases/yudong/system-02.dbf
datafile 10 switched to datafile copy
input datafilecopy recid=46 stamp=634621650 filename=/fs-a01-a/databases/yudong/large_idx-02.dbf
datafile 11 switched to datafile copy
input datafilecopy recid=47 stamp=634621650 filename=/fs-a01-b/databases/yudong/system-03.dbf
datafile 12 switched to datafile copy
input datafilecopy recid=48 stamp=634621650 filename=/fs-a01-a/databases/yudong/large_idx-03.dbf
datafile 13 switched to datafile copy
input datafilecopy recid=49 stamp=634621650 filename=/fs-a01-a/databases/yudong/sysaux-02.dbf
datafile 14 switched to datafile copy
input datafilecopy recid=50 stamp=634621650 filename=/fs-a01-a/databases/yudong/administrator-02.dbf
datafile 15 switched to datafile copy
input datafilecopy recid=51 stamp=634621650 filename=/fs-a01-a/databases/yudong/zwf.dbf
datafile 16 switched to datafile copy
input datafilecopy recid=52 stamp=634621650 filename=/fs-a01-a/databases/yudong/zwf_new.dbf
datafile 17 switched to datafile copy
input datafilecopy recid=53 stamp=634621650 filename=/fs-a01-a/databases/yudong/large_idx-01.dbf
datafile 18 switched to datafile copy
input datafilecopy recid=54 stamp=634621650 filename=/fs-a01-a/databases/yudong/zwf_new_new.dbf
datafile 19 switched to datafile copy
input datafilecopy recid=55 stamp=634621650 filename=/fs-a01-a/databases/yudong/zwf_new_new_new.dbf
datafile 20 switched to datafile copy
input datafilecopy recid=56 stamp=634621650 filename=/fs-a01-a/databases/yudong/t_zwf.dbf

contents of Memory Script:
{
set until scn 260704166;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 30-SEP-07
using channel ORA_AUX_DISK_1

starting media recovery

archive log thread 1 sequence 846 is already on disk as file /arch-01/databases/yudong/redolog/-846-1-632058350.arc
archive log filename=/arch-01/databases/yudong/redolog/-846-1-632058350.arc thread=1 sequence=846
channel ORA_AUX_DISK_1: starting archive log restore to default destination
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=847
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=848
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=849
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=850
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7cit70p2_1_1 tag=FULLFORSTANDBY
channel ORA_AUX_DISK_1: restore complete
archive log filename=/arch-01/databases/yudong/redolog/-847-1-632058350.arc thread=1 sequence=847
channel clone_default: deleting archive log(s)
archive log filename=/arch-01/databases/yudong/redolog/-847-1-632058350.arc recid=1 stamp=634621653
archive log filename=/arch-01/databases/yudong/redolog/-848-1-632058350.arc thread=1 sequence=848
channel clone_default: deleting archive log(s)
archive log filename=/arch-01/databases/yudong/redolog/-848-1-632058350.arc recid=3 stamp=634621655
archive log filename=/arch-01/databases/yudong/redolog/-849-1-632058350.arc thread=1 sequence=849
channel clone_default: deleting archive log(s)
archive log filename=/arch-01/databases/yudong/redolog/-849-1-632058350.arc recid=2 stamp=634621655
archive log filename=/arch-01/databases/yudong/redolog/-850-1-632058350.arc thread=1 sequence=850
channel clone_default: deleting archive log(s)
archive log filename=/arch-01/databases/yudong/redolog/-850-1-632058350.arc recid=4 stamp=634621655
media recovery complete
Finished recover at 30-SEP-07
Finished Duplicate Db at 30-SEP-07


RMAN> exit


Recovery Manager complete.
oracle:weifengz.desktop.amazon.com: /redo-04-a/databases/yudong> sqlplus "/as sysdba"

SQL*Plus: Release 10.1.0.4.0 - Production on Sun Sep 30 03:55:03 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select database_role,switchover_status,protection_mode,protection_level from v$database;

DATABASE_ROLE SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
---------------- -------------------- -------------------- --------------------
PHYSICAL STANDBY NOT ALLOWED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE

SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS

SQL> select sequence#,applied from v$archived_log;

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 NO
851 NO
852 NO
853 NO

7 rows selected.


三、登录到主机

SYS.YUDONG>select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
853

1 row selected.

SYS.YUDONG>alter system switch logfile;

System altered.

SYS.YUDONG>select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
854

1 row selected.

四、登录到从机

SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS
RFS
RFS

SQL> select sequence#,applied from v$archived_log;

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 NO
851 NO
852 NO
853 NO
854 NO

8 rows selected.


SQL> recover managed standby database disconnect from session;
Media recovery complete.
SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS
RFS
RFS
MRP0

6 rows selected.

注意这里增加了MRP0进程。

SQL> select sequence#,applied from v$archived_log;

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 NO
851 NO
852 NO
853 NO
854 NO

8 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 YES
851 NO
852 NO
853 NO
854 NO

8 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 YES
851 YES
852 NO
853 NO
854 NO

8 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 YES
851 YES
852 NO
853 NO
854 NO

8 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 YES
851 YES
852 NO
853 NO
854 NO

8 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 YES
851 YES
852 YES
853 NO
854 NO

8 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
847 YES
849 YES
848 YES
850 YES
851 YES
852 YES
853 YES
854 YES

8 rows selected.

/***************************************一个需要注意的问题***********************************/

大家注意到上边duplicate过程中的一个错误:

ORA-19624: operation failed, retry possible
ORA-19505: failed to identify file "/opt/app/oracle/product/10.1.0.4/A04db/dbs/73it70b7_1_1"
ORA-27037: unable to obtain file status

这个错误产生原因是我们指定了:

set until sequence=851 thread=1;

来进行不完全恢复,我们指定的sequence比备份的控制文件要早,所以在恢复的过程报错,不过本次案例幸好存在一个比较早的备份文件可用,所以RMAN自动使用了上一次的备份来进进行DUPLICATE。如果我们是在一套新的环境执行,一定要记住行不完全恢复的时候,一定要指定until sequence大于等于备份集中的max(seq)+1,

按照上边的备份max(sequence)为852(input archive log thread=1 sequence=852 recid=3047 stamp=634618825),所以我们就该指定set until sequence=853 thread=1;

否则,如果不是我们的系统中存在一个旧版本的可用备份而是在新环境执行不完全恢复,我们会收到以下错误:


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/30/2007 06:29:51
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06024: no backup or copy of the controlfile found to restore


或者我们也可以直接按照下边的例子做就可以了(不指定until)。


DUPLICATE过程:

RMAN> duplicate target database for standby dorecover nofilenamecheck;

Starting Duplicate Db at 30-SEP-07
using channel ORA_AUX_DISK_1

contents of Memory Script:
{
set until scn 260772926;
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script

executing command: SET until clause

Starting restore at 30-SEP-07
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring controlfile
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7lit7eh5_1_1 tag=FULLFORSTANDBY
channel ORA_AUX_DISK_1: restore complete
output filename=/ctl-01/databases/yudong/control.ctl
output filename=/ctl-02/databases/yudong/control.ctl
Finished restore at 30-SEP-07

sql statement: alter database mount standby database

contents of Memory Script:
{
set until scn 260772926;
set newname for datafile 1 to
"/fs-a01-b/databases/yudong/system-01.dbf";
set newname for datafile 2 to
"/fs-a01-a/databases/yudong/undo_t1-01.dbf";
set newname for datafile 3 to
"/fs-a01-a/databases/yudong/sysaux-01.dbf";
set newname for datafile 4 to
"/fs-a01-a/databases/yudong/administrator-01.dbf";
set newname for datafile 5 to
"/fs-a01-b/databases/yudong/administrator_idx-01.dbf";
set newname for datafile 6 to
"/fs-a01-b/databases/yudong/replication-01.dbf";
set newname for datafile 7 to
"/fs-a01-a/databases/yudong/replication_idx-01.dbf";
set newname for datafile 8 to
"/fs-a01-a/databases/yudong/precise_or_tab-01.dbf";
set newname for datafile 9 to
"/fs-a01-b/databases/yudong/system-02.dbf";
set newname for datafile 10 to
"/fs-a01-a/databases/yudong/large_idx-02.dbf";
set newname for datafile 11 to
"/fs-a01-b/databases/yudong/system-03.dbf";
set newname for datafile 12 to
"/fs-a01-a/databases/yudong/large_idx-03.dbf";
set newname for datafile 13 to
"/fs-a01-a/databases/yudong/sysaux-02.dbf";
set newname for datafile 14 to
"/fs-a01-a/databases/yudong/administrator-02.dbf";
set newname for datafile 15 to
"/fs-a01-a/databases/yudong/zwf.dbf";
set newname for datafile 16 to
"/fs-a01-a/databases/yudong/zwf_new.dbf";
set newname for datafile 17 to
"/fs-a01-a/databases/yudong/large_idx-01.dbf";
set newname for datafile 18 to
"/fs-a01-a/databases/yudong/zwf_new_new.dbf";
set newname for datafile 19 to
"/fs-a01-a/databases/yudong/zwf_new_new_new.dbf";
set newname for datafile 20 to
"/fs-a01-a/databases/yudong/t_zwf.dbf";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 30-SEP-07
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /fs-a01-b/databases/yudong/system-01.dbf
restoring datafile 00002 to /fs-a01-a/databases/yudong/undo_t1-01.dbf
restoring datafile 00003 to /fs-a01-a/databases/yudong/sysaux-01.dbf
restoring datafile 00004 to /fs-a01-a/databases/yudong/administrator-01.dbf
restoring datafile 00005 to /fs-a01-b/databases/yudong/administrator_idx-01.dbf
restoring datafile 00006 to /fs-a01-b/databases/yudong/replication-01.dbf
restoring datafile 00007 to /fs-a01-a/databases/yudong/replication_idx-01.dbf
restoring datafile 00008 to /fs-a01-a/databases/yudong/precise_or_tab-01.dbf
restoring datafile 00009 to /fs-a01-b/databases/yudong/system-02.dbf
restoring datafile 00010 to /fs-a01-a/databases/yudong/large_idx-02.dbf
restoring datafile 00011 to /fs-a01-b/databases/yudong/system-03.dbf
restoring datafile 00012 to /fs-a01-a/databases/yudong/large_idx-03.dbf
restoring datafile 00013 to /fs-a01-a/databases/yudong/sysaux-02.dbf
restoring datafile 00014 to /fs-a01-a/databases/yudong/administrator-02.dbf
restoring datafile 00015 to /fs-a01-a/databases/yudong/zwf.dbf
restoring datafile 00016 to /fs-a01-a/databases/yudong/zwf_new.dbf
restoring datafile 00017 to /fs-a01-a/databases/yudong/large_idx-01.dbf
restoring datafile 00018 to /fs-a01-a/databases/yudong/zwf_new_new.dbf
restoring datafile 00019 to /fs-a01-a/databases/yudong/zwf_new_new_new.dbf
restoring datafile 00020 to /fs-a01-a/databases/yudong/t_zwf.dbf


channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7kit7ec9_1_1 tag=FULLFORSTANDBY
channel ORA_AUX_DISK_1: restore complete
Finished restore at 30-SEP-07

contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafilecopy recid=37 stamp=634672246 filename=/fs-a01-b/databases/yudong/system-01.dbf
datafile 2 switched to datafile copy
input datafilecopy recid=38 stamp=634672246 filename=/fs-a01-a/databases/yudong/undo_t1-01.dbf
datafile 3 switched to datafile copy
input datafilecopy recid=39 stamp=634672246 filename=/fs-a01-a/databases/yudong/sysaux-01.dbf
datafile 4 switched to datafile copy
input datafilecopy recid=40 stamp=634672246 filename=/fs-a01-a/databases/yudong/administrator-01.dbf
datafile 5 switched to datafile copy
input datafilecopy recid=41 stamp=634672246 filename=/fs-a01-b/databases/yudong/administrator_idx-01.dbf
datafile 6 switched to datafile copy
input datafilecopy recid=42 stamp=634672246 filename=/fs-a01-b/databases/yudong/replication-01.dbf
datafile 7 switched to datafile copy
input datafilecopy recid=43 stamp=634672246 filename=/fs-a01-a/databases/yudong/replication_idx-01.dbf
datafile 8 switched to datafile copy
input datafilecopy recid=44 stamp=634672246 filename=/fs-a01-a/databases/yudong/precise_or_tab-01.dbf
datafile 9 switched to datafile copy
input datafilecopy recid=45 stamp=634672246 filename=/fs-a01-b/databases/yudong/system-02.dbf
datafile 10 switched to datafile copy
input datafilecopy recid=46 stamp=634672246 filename=/fs-a01-a/databases/yudong/large_idx-02.dbf
datafile 11 switched to datafile copy
input datafilecopy recid=47 stamp=634672246 filename=/fs-a01-b/databases/yudong/system-03.dbf
datafile 12 switched to datafile copy
input datafilecopy recid=48 stamp=634672246 filename=/fs-a01-a/databases/yudong/large_idx-03.dbf
datafile 13 switched to datafile copy
input datafilecopy recid=49 stamp=634672246 filename=/fs-a01-a/databases/yudong/sysaux-02.dbf
datafile 14 switched to datafile copy
input datafilecopy recid=50 stamp=634672246 filename=/fs-a01-a/databases/yudong/administrator-02.dbf
datafile 15 switched to datafile copy
input datafilecopy recid=51 stamp=634672246 filename=/fs-a01-a/databases/yudong/zwf.dbf
datafile 16 switched to datafile copy
input datafilecopy recid=52 stamp=634672246 filename=/fs-a01-a/databases/yudong/zwf_new.dbf
datafile 17 switched to datafile copy
input datafilecopy recid=53 stamp=634672246 filename=/fs-a01-a/databases/yudong/large_idx-01.dbf
datafile 18 switched to datafile copy
input datafilecopy recid=54 stamp=634672246 filename=/fs-a01-a/databases/yudong/zwf_new_new.dbf
datafile 19 switched to datafile copy
input datafilecopy recid=55 stamp=634672246 filename=/fs-a01-a/databases/yudong/zwf_new_new_new.dbf
datafile 20 switched to datafile copy
input datafilecopy recid=56 stamp=634672246 filename=/fs-a01-a/databases/yudong/t_zwf.dbf

contents of Memory Script:
{
set until scn 260772926;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 30-SEP-07
using channel ORA_AUX_DISK_1

starting media recovery

Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/fs-a01-b/databases/yudong/system-01.dbf'

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/30/2007 17:50:48
RMAN-03015: error occurred in stored script Memory Script
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 868 lowscn 260768306 found to restore
RMAN-06025: no backup of log thread 1 seq 867 lowscn 260763636 found to restore
RMAN-06025: no backup of log thread 1 seq 866 lowscn 260758927 found to restore
RMAN-06025: no backup of log thread 1 seq 865 lowscn 260750826 found to restore
RMAN-06025: no backup of log thread 1 seq 864 lowscn 260746255 found to restore
RMAN-06025: no backup of log thread 1 seq 863 lowscn 260741667 found to restore
RMAN-06025: no backup of log thread 1 seq 862 lowscn 260737009 found to restore
RMAN-06025: no backup of log thread 1 seq 861 lowscn 260732431 found to restore
RMAN-06025: no backup of log thread 1 seq 860 lowscn 260727834 found to restore
RMAN-06025: no backup of log thread 1 seq 859 lowscn 260723155 found to restore

RMAN> exit


Recovery Manager complete.
oracle:weifengz.desktop.amazon.com: /arch-01/databases/yudong/redolog> sqlplus "/as sysdba"

SQL*Plus: Release 10.1.0.4.0 - Production on Sun Sep 30 17:52:14 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select open_mode from v$database;

OPEN_MODE
----------
MOUNTED

SQL> select sequence#,applied from v$archived_log;

no rows selected

SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS
RFS

SQL> recover managed standby database disconnect;
Media recovery complete.
SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS
RFS
RFS
MRP0

6 rows selected.

SQL> select sequence#,applied from v$archived_log;

SEQUENCE# APP
---------- ---
869 NO

SQL> /

SEQUENCE# APP
---------- ---
869 NO
859 NO
860 NO
861 NO
862 NO
864 NO

6 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
869 NO
859 NO
860 NO
861 NO
862 NO
864 NO
865 NO
866 NO
867 NO

9 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
869 NO
859 NO
860 NO
861 NO
862 NO
864 NO
865 NO
866 NO
867 NO
868 NO

10 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
869 NO
859 YES
860 YES
861 YES
862 YES
864 NO
865 NO
866 NO
867 NO
868 NO
858 YES

SEQUENCE# APP
---------- ---
863 NO

12 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
869 YES
859 YES
860 YES
861 YES
862 YES
864 YES
865 YES
866 YES
867 YES
868 YES
858 YES

SEQUENCE# APP
---------- ---
863 YES

12 rows selected.


该过程我们会看到如下警告提示,这个不会影响我们的创建过程:


ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/fs-a01-b/databases/yudong/system-01.dbf'

如果想回避这个警告,我们可以执行不完全恢复,但是一定要记得set until sequence = max(备份集sequence) + 1

过程示例如下:

备份过程:

RMAN> backup tag 'fullforstandby' database include current controlfile for standby plus archivelog;


Starting backup at 30-SEP-07
current log archived
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=127 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=700 recid=2612 stamp=634132672
input archive log thread=1 sequence=701 recid=2614 stamp=634132694

..................................................................
..................................................................

input archive log thread=1 sequence=759 recid=2774 stamp=634307781
input archive log thread=1 sequence=760 recid=2777 stamp=634311381
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7hit7eb7_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:17
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=761 recid=2780 stamp=634314983
input archive log thread=1 sequence=762 recid=2783 stamp=634318581

..................................................................
..................................................................

input archive log thread=1 sequence=808 recid=2921 stamp=634480383
input archive log thread=1 sequence=809 recid=2924 stamp=634483985
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7iit7ebo_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=810 recid=2927 stamp=634487584
input archive log thread=1 sequence=811 recid=2930 stamp=634491183

..................................................................
..................................................................

input archive log thread=1 sequence=856 recid=3063 stamp=634629391


input archive log thread=1 sequence=857 recid=3065

stamp=634632550
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7jit7ec0_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 30-SEP-07

Starting backup at 30-SEP-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00017 name=/fs-a01-a/databases/yudong/large_idx-01.dbf
input datafile fno=00014 name=/fs-a01-a/databases/yudong/administrator-02.dbf
input datafile fno=00001 name=/fs-a01-b/databases/yudong/system-01.dbf
input datafile fno=00004 name=/fs-a01-a/databases/yudong/administrator-01.dbf
input datafile fno=00006 name=/fs-a01-b/databases/yudong/replication-01.dbf
input datafile fno=00008 name=/fs-a01-a/databases/yudong/precise_or_tab-01.dbf
input datafile fno=00002 name=/fs-a01-a/databases/yudong/undo_t1-01.dbf
input datafile fno=00003 name=/fs-a01-a/databases/yudong/sysaux-01.dbf
input datafile fno=00005 name=/fs-a01-b/databases/yudong/administrator_idx-01.dbf
input datafile fno=00009 name=/fs-a01-b/databases/yudong/system-02.dbf
input datafile fno=00010 name=/fs-a01-a/databases/yudong/large_idx-02.dbf
input datafile fno=00007 name=/fs-a01-a/databases/yudong/replication_idx-01.dbf
input datafile fno=00011 name=/fs-a01-b/databases/yudong/system-03.dbf
input datafile fno=00016 name=/fs-a01-a/databases/yudong/zwf_new.dbf
input datafile fno=00012 name=/fs-a01-a/databases/yudong/large_idx-03.dbf
input datafile fno=00013 name=/fs-a01-a/databases/yudong/sysaux-02.dbf
input datafile fno=00015 name=/fs-a01-a/databases/yudong/zwf.dbf
input datafile fno=00018 name=/fs-a01-a/databases/yudong/zwf_new_new.dbf
input datafile fno=00020 name=/fs-a01-a/databases/yudong/t_zwf.dbf
input datafile fno=00019 name=/fs-a01-a/databases/yudong/zwf_new_new_new.dbf
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7kit7ec9_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including standby controlfile in backupset
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7lit7eh5_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 30-SEP-07

Starting backup at 30-SEP-07
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set


input archive log thread=1 sequence=858 recid=3067

stamp=634632748
channel ORA_DISK_1: starting piece 1 at 30-SEP-07
channel ORA_DISK_1: finished piece 1 at 30-SEP-07
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7mit7ehc_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 30-SEP-07

Starting Control File Autobackup at 30-SEP-07
piece handle=/oracle-backup/db-backup/databases/yudong/c-404134968-20070930-04 comment=NONE
Finished Control File Autobackup at 30-SEP-07

DUPLICATE过程:

RMAN> run{
2> set until sequence=859 thread=1;3> duplicate target database for standby dorecover nofilenamecheck;
4> }

executing command: SET until clause

Starting Duplicate Db at 01-OCT-07
using channel ORA_AUX_DISK_1

contents of Memory Script:
{
set until scn 260723155;
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script

executing command: SET until clause

Starting restore at 01-OCT-07
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring controlfile
channel ORA_AUX_DISK_1: restored backup piece 1


piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7lit7eh5_1_1 tag=FULLFORSTANDBY


channel ORA_AUX_DISK_1: restore complete
output filename=/ctl-01/databases/yudong/control.ctl
output filename=/ctl-02/databases/yudong/control.ctl
Finished restore at 01-OCT-07

sql statement: alter database mount standby database

contents of Memory Script:
{
set until scn 260723155;
set newname for datafile 1 to
"/fs-a01-b/databases/yudong/system-01.dbf";
set newname for datafile 2 to
"/fs-a01-a/databases/yudong/undo_t1-01.dbf";
set newname for datafile 3 to
"/fs-a01-a/databases/yudong/sysaux-01.dbf";
set newname for datafile 4 to
"/fs-a01-a/databases/yudong/administrator-01.dbf";
set newname for datafile 5 to
"/fs-a01-b/databases/yudong/administrator_idx-01.dbf";
set newname for datafile 6 to
"/fs-a01-b/databases/yudong/replication-01.dbf";
set newname for datafile 7 to
"/fs-a01-a/databases/yudong/replication_idx-01.dbf";
set newname for datafile 8 to
"/fs-a01-a/databases/yudong/precise_or_tab-01.dbf";
set newname for datafile 9 to
"/fs-a01-b/databases/yudong/system-02.dbf";
set newname for datafile 10 to
"/fs-a01-a/databases/yudong/large_idx-02.dbf";
set newname for datafile 11 to
"/fs-a01-b/databases/yudong/system-03.dbf";
set newname for datafile 12 to
"/fs-a01-a/databases/yudong/large_idx-03.dbf";
set newname for datafile 13 to
"/fs-a01-a/databases/yudong/sysaux-02.dbf";
set newname for datafile 14 to
"/fs-a01-a/databases/yudong/administrator-02.dbf";
set newname for datafile 15 to
"/fs-a01-a/databases/yudong/zwf.dbf";
set newname for datafile 16 to
"/fs-a01-a/databases/yudong/zwf_new.dbf";
set newname for datafile 17 to
"/fs-a01-a/databases/yudong/large_idx-01.dbf";
set newname for datafile 18 to
"/fs-a01-a/databases/yudong/zwf_new_new.dbf";
set newname for datafile 19 to
"/fs-a01-a/databases/yudong/zwf_new_new_new.dbf";
set newname for datafile 20 to
"/fs-a01-a/databases/yudong/t_zwf.dbf";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-OCT-07
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /fs-a01-b/databases/yudong/system-01.dbf
restoring datafile 00002 to /fs-a01-a/databases/yudong/undo_t1-01.dbf
restoring datafile 00003 to /fs-a01-a/databases/yudong/sysaux-01.dbf
restoring datafile 00004 to /fs-a01-a/databases/yudong/administrator-01.dbf
restoring datafile 00005 to /fs-a01-b/databases/yudong/administrator_idx-01.dbf
restoring datafile 00006 to /fs-a01-b/databases/yudong/replication-01.dbf
restoring datafile 00007 to /fs-a01-a/databases/yudong/replication_idx-01.dbf
restoring datafile 00008 to /fs-a01-a/databases/yudong/precise_or_tab-01.dbf
restoring datafile 00009 to /fs-a01-b/databases/yudong/system-02.dbf
restoring datafile 00010 to /fs-a01-a/databases/yudong/large_idx-02.dbf
restoring datafile 00011 to /fs-a01-b/databases/yudong/system-03.dbf
restoring datafile 00012 to /fs-a01-a/databases/yudong/large_idx-03.dbf
restoring datafile 00013 to /fs-a01-a/databases/yudong/sysaux-02.dbf
restoring datafile 00014 to /fs-a01-a/databases/yudong/administrator-02.dbf
restoring datafile 00015 to /fs-a01-a/databases/yudong/zwf.dbf
restoring datafile 00016 to /fs-a01-a/databases/yudong/zwf_new.dbf
restoring datafile 00017 to /fs-a01-a/databases/yudong/large_idx-01.dbf
restoring datafile 00018 to /fs-a01-a/databases/yudong/zwf_new_new.dbf
restoring datafile 00019 to /fs-a01-a/databases/yudong/zwf_new_new_new.dbf
restoring datafile 00020 to /fs-a01-a/databases/yudong/t_zwf.dbf


channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7kit7ec9_1_1 tag=FULLFORSTANDBY
channel ORA_AUX_DISK_1: restore complete
Finished restore at 01-OCT-07

contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafilecopy recid=37 stamp=634789706 filename=/fs-a01-b/databases/yudong/system-01.dbf
datafile 2 switched to datafile copy
input datafilecopy recid=38 stamp=634789706 filename=/fs-a01-a/databases/yudong/undo_t1-01.dbf
datafile 3 switched to datafile copy
input datafilecopy recid=39 stamp=634789706 filename=/fs-a01-a/databases/yudong/sysaux-01.dbf
datafile 4 switched to datafile copy
input datafilecopy recid=40 stamp=634789706 filename=/fs-a01-a/databases/yudong/administrator-01.dbf
datafile 5 switched to datafile copy
input datafilecopy recid=41 stamp=634789706 filename=/fs-a01-b/databases/yudong/administrator_idx-01.dbf
datafile 6 switched to datafile copy
input datafilecopy recid=42 stamp=634789706 filename=/fs-a01-b/databases/yudong/replication-01.dbf
datafile 7 switched to datafile copy
input datafilecopy recid=43 stamp=634789706 filename=/fs-a01-a/databases/yudong/replication_idx-01.dbf
datafile 8 switched to datafile copy
input datafilecopy recid=44 stamp=634789706 filename=/fs-a01-a/databases/yudong/precise_or_tab-01.dbf
datafile 9 switched to datafile copy
input datafilecopy recid=45 stamp=634789706 filename=/fs-a01-b/databases/yudong/system-02.dbf
datafile 10 switched to datafile copy
input datafilecopy recid=46 stamp=634789706 filename=/fs-a01-a/databases/yudong/large_idx-02.dbf
datafile 11 switched to datafile copy
input datafilecopy recid=47 stamp=634789706 filename=/fs-a01-b/databases/yudong/system-03.dbf
datafile 12 switched to datafile copy
input datafilecopy recid=48 stamp=634789707 filename=/fs-a01-a/databases/yudong/large_idx-03.dbf
datafile 13 switched to datafile copy
input datafilecopy recid=49 stamp=634789707 filename=/fs-a01-a/databases/yudong/sysaux-02.dbf
datafile 14 switched to datafile copy
input datafilecopy recid=50 stamp=634789707 filename=/fs-a01-a/databases/yudong/administrator-02.dbf
datafile 15 switched to datafile copy
input datafilecopy recid=51 stamp=634789707 filename=/fs-a01-a/databases/yudong/zwf.dbf
datafile 16 switched to datafile copy
input datafilecopy recid=52 stamp=634789707 filename=/fs-a01-a/databases/yudong/zwf_new.dbf
datafile 17 switched to datafile copy
input datafilecopy recid=53 stamp=634789707 filename=/fs-a01-a/databases/yudong/large_idx-01.dbf
datafile 18 switched to datafile copy
input datafilecopy recid=54 stamp=634789707 filename=/fs-a01-a/databases/yudong/zwf_new_new.dbf
datafile 19 switched to datafile copy
input datafilecopy recid=55 stamp=634789707 filename=/fs-a01-a/databases/yudong/zwf_new_new_new.dbf
datafile 20 switched to datafile copy
input datafilecopy recid=56 stamp=634789707 filename=/fs-a01-a/databases/yudong/t_zwf.dbf

contents of Memory Script:
{
set until scn 260723155;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 01-OCT-07
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archive log restore to default destination
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=858
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/opt/app/oracle/product/10.1.0.4/A04db/dbs/7mit7ehc_1_1 tag=FULLFORSTANDBY
channel ORA_AUX_DISK_1: restore complete
archive log filename=/arch-01/databases/yudong/redolog/-858-1-632058350.arc thread=1 sequence=858
channel clone_default: deleting archive log(s)
archive log filename=/arch-01/databases/yudong/redolog/-858-1-632058350.arc recid=1 stamp=634789708
media recovery complete
Finished recover at 01-OCT-07
Finished Duplicate Db at 01-OCT-07


oracle:weifengz.desktop.amazon.com: /opt/app/oracle> sqlplus "/as sysdba"

SQL*Plus: Release 10.1.0.4.0 - Production on Mon Oct 1 02:31:14 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS

SQL> select sequence#,applied from v$archived_log;

SEQUENCE# APP
---------- ---
858 NO
859 NO
860 NO
861 NO
862 NO
863 NO
864 NO
865 NO
866 NO
867 NO
868 NO

SEQUENCE# APP
---------- ---
869 NO
870 NO
871 NO
872 NO
873 NO
874 NO
875 NO
876 NO
877 NO

20 rows selected.

SQL> recover managed standby database disconnect;
Media recovery complete.
SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
RFS
MRP0

SQL> select sequence#,applied from v$archived_log;

SEQUENCE# APP
---------- ---
858 YES
859 YES
860 YES
861 YES
862 YES
863 YES
864 YES
865 NO
866 NO
867 NO
868 NO

SEQUENCE# APP
---------- ---
869 NO
870 NO
871 NO
872 NO
873 NO
874 NO
875 NO
876 NO
877 NO

20 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
858 YES
859 YES
860 YES
861 YES
862 YES
863 YES
864 YES
865 YES
866 YES
867 YES
868 YES

SEQUENCE# APP
---------- ---
869 YES
870 YES
871 YES
872 YES
873 YES
874 YES
875 NO
876 NO
877 NO

20 rows selected.

SQL> /

SEQUENCE# APP
---------- ---
858 YES
859 YES
860 YES
861 YES
862 YES
863 YES
864 YES
865 YES
866 YES
867 YES
868 YES

SEQUENCE# APP
---------- ---
869 YES
870 YES
871 YES
872 YES
873 YES
874 YES
875 YES
876 YES
877 YES

20 rows selected.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/756652/viewspace-242469/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/756652/viewspace-242469/

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/congnen9588/article/details/100366795

智能推荐

linux tail 查找字符串,Linux grep、tail命令的混合使用-程序员宅基地

文章浏览阅读3.3k次。grepLinux grep命令用于查找文件里符合条件的字符串。grep指令用于查找内容包含指定的范本样式的文件,如果发现某文件的内容符合所指定的范本样式,预设grep指令会把含有范本样式的那一列显示出来。若不指定任何文件名称,或是所给予的文件名为"-",则grep指令会从标准输入设备读取数据。语法grep [-abcEFGhHilLnqrsvVwxy][-A][-B][-C][-d][-e][-..._tail 查找字符串

matlab隐含层个数设置,BP神经网络隐藏层节点数如何确定-程序员宅基地

文章浏览阅读3k次。新人求教:本人的输入矩阵为p,每一列为一个特征向量,每一行为一个样本,现在我想按列归一化,我自己写的用for循环逐列归一化,但是发现输出反归一化还原时不好处理,求老师们教教有没有一些函数的使用技巧能按列归一化后而且能使得能方便地反归一化得到输出。网络输入p、输出t见下:p =[ 695.50 1.60 2.06 38.00 31...._matlab中设置bp隐含层数量的代码

递归_计算 f(n)=f(n-1)+f(n-2)-程序员宅基地

文章浏览阅读3k次。题目:1 、1、2、3、5、8....计算103的值规律:f(n)=f(n-1)+f(n-2)算法shi_f(n)=f(n-1)+f(n-2)

java -cp JAVA_OPTS环境变量不起作用的处理方法_java_opts classpath-程序员宅基地

文章浏览阅读1.8k次。原因:JAVA_OPTS只对tomcat/weblogic等Web服务器中间件有效,以“java -cp [*.jar] test.Main”方式运行的不会去读取JAVA_OPTS,所以通过java -cp执行相关文件会报错。JAVA_OPTS在 tomcat/bin/catalina.sh或tomcat/bin/catalina.bat文件配置,这可配置java进程虚拟机的启动参数 。解决方案:1、如果在运行java类,需要设置Heap Size的话,需要如下方式:java -Xmx2048m_java_opts classpath

flex中文(zh_CN)本地化应用编译不通过的解决方法_flex怎么输出为zh-程序员宅基地

文章浏览阅读5.1k次。flex项目编译时报错:Description Resource Path Location Typeunable to open 'C:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.2.0/frameworks/locale/zh_CN' STaB Unknown Flex ProblemFlash builder 4 无法为区域设置“zh_CN”解析资源束“data"解决方法,先把web-info/flex/locale/en_US下的fds_r_flex怎么输出为zh

CSS深入理解之z-index_"style=\"position:absolute;z-index:2"-程序员宅基地

文章浏览阅读513次,点赞2次,收藏4次。慕课学习-->前端开发-->HTML/CSS-->CSS深入理解之z-indexZ-index一、Z-index基础1、z-index属性指定了元素及其子元素的z顺序 ,而z顺序 可以决定当元素发生覆盖的时候,哪个元素在上面。通常一个较大z-index值的元素会覆盖较小z-index值的元素。2、属性值:(1)z-index:auto; 默认值(2)z-in_"style=\"position:absolute;z-index:2"

随便推点

模糊综合评价模型原理及matlab实现_模糊综合评判--空气质量评估例题matlab-程序员宅基地

文章浏览阅读4w次,点赞149次,收藏886次。资料来源:微信公众号《数学建模学习交流》目录1. 概述2. 经典集合和模糊集合的基本概念2.1 经典集合和特征函数2.2 模糊集合和隶属函数3. 隶属函数的三种确定方法3.1 模糊统计法3.2 借助已有的客观尺度4. 应用:模糊综合评价(评判)4.1 评价问题概述4.2 一级模糊综合评价模型4.2.1 一级模糊综合评判模型在人事考核中的应用..._模糊综合评判--空气质量评估例题matlab

vue-router的push和replace的区别_vue饿router的push和replace-程序员宅基地

文章浏览阅读5.3w次,点赞15次,收藏58次。1.this.$router.push()描述:跳转到不同的url,但这个方法会向history栈添加一个记录,点击后退会返回到上一个页面。2.this.$router.replace()描述:同样是跳转到指定的url,但是这个方法不会向history里面添加新的记录,点击返回,会跳转到上上一个页面。上一个记录是不存在的。3.this.$router.go(n)相对于当前页面向..._vue饿router的push和replace

荣耀会不会没有鸿蒙系统,华为没有放弃荣耀手机老用户,都有机会鸿蒙系统,这下放心了吧...-程序员宅基地

文章浏览阅读140次。荣耀9X手机年内升级鸿蒙操作系统,为华为这个做法点赞自从新荣耀成立之后,鸿蒙操作系统的更新以及4月陆续从旗舰机开始开放,这个时候很多荣耀的老用户都慌了,那么我们怎么办可以不可以用,曾经荣耀CEO赵明说会遵循行业之间的相关规定,所以这也让荣耀手机是否可以用鸿蒙系统变得扑朔迷离,最近终于被实锤了,既然荣耀9X都可以升级,那么估计荣耀30系列、荣耀20系列应该都有机会的!IT之家3月12日消息 根据微博..._荣耀放弃鸿蒙系统

利用jxl实现excel导出_jxl导出xls前端进度条-程序员宅基地

文章浏览阅读2.1k次。【说明】1.点击导出,取前台现有的数据通过ajax传到后台,2.通过jxl生成服务器上的xls文件3.ajax成功之后转到download,也就是打开保存界面:【配置】1.使用了struts2的注解配置【代码】jsp: //导出 $('#exportBtn').click(function(){ var str = '';_jxl导出xls前端进度条

【计算机网络 (谢希仁) 习题题解】第5章 运输层 (3)——滑动窗口;流量控制_计算机网络滑动窗口例题-程序员宅基地

文章浏览阅读8k次,点赞8次,收藏55次。计算机网络 (谢希仁) 第7版 习题题解 第5章 运输层滑动窗口;流量控制_计算机网络滑动窗口例题

面试必问 Spring的事物传播机制&隔离级别_面试事物的传播机制与传播类型是一个吗-程序员宅基地

文章浏览阅读799次。文章目录Spring的事务抽象接口Spring的事物传播机制Spring的事物隔离级别Spring的事务抽象接口Spring的事物传播机制根据Sring的源码org.springframework.transaction.TransactionDefinition类中定义了传播机制Spring的事务传播机制 :两个Service业务, 其中ServiceA要调用ServiceB的某一个方法, 这个Service的方法都是在事务中执行的, 此时就涉及到事务的传播了.PROPAGATION_R_面试事物的传播机制与传播类型是一个吗

推荐文章

热门文章

相关标签