篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle11gr2_ADG管理之跳归档恢复dg实战相关的知识,希望对你有一定的参考价值。
模拟故障 关闭备库
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
模拟插入数据,归档,并且删除归档
SQL> insert into test values(23);
1 row created.
SQL> alter system switch logfile;
System altered.
SQL> insert into test values(24);
1 row created.
SQL> alter system switch logfile;
System altered.
SQL> show parameter recover
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /home/oracle/app/fast_recovery
_area
db_recovery_file_dest_size big integer 8196M
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] backup_stage]$ cd /home/oracle/app/fast_recovery_area
[[email protected] fast_recovery_area]$ cd NEWTEST/a
archivelog/ autobackup/
[[email protected] fast_recovery_area]$ cd NEWTEST/a
archivelog/ autobackup/
[[email protected] fast_recovery_area]$ cd NEWTEST/archivelog/2018_03_27
[[email protected] 2018_03_27]$ ls -lrt
total 146248
-rw-r-----. 1 oracle dba 44910592 Mar 27 08:13 o1_mf_1_101_fcm35o3w_.arc
-rw-r-----. 1 oracle dba 42871808 Mar 27 13:11 o1_mf_1_102_fcmnm6bn_.arc
-rw-r-----. 1 oracle dba 25376768 Mar 27 20:57 o1_mf_1_103_fcnhyc2c_.arc
-rw-r-----. 1 oracle dba 1024 Mar 27 20:57 o1_mf_1_1_fcnhycyt_.arc
-rw-r-----. 1 oracle dba 472576 Mar 27 20:57 o1_mf_1_2_fcnhyd03_.arc
-rw-r-----. 1 oracle dba 118272 Mar 27 20:57 o1_mf_1_3_fcnhyd4l_.arc
-rw-r-----. 1 oracle dba 116736 Mar 27 20:57 o1_mf_1_4_fcnhyd9o_.arc
-rw-r-----. 1 oracle dba 6144 Mar 27 20:57 o1_mf_1_5_fcnhypd2_.arc
-rw-r-----. 1 oracle dba 1798656 Mar 27 21:10 o1_mf_1_6_fcnjog83_.arc
-rw-r-----. 1 oracle dba 1024 Mar 27 21:10 o1_mf_1_7_fcnjoo5q_.arc
-rw-r-----. 1 oracle dba 54784 Mar 27 21:10 o1_mf_1_8_fcnjoqqs_.arc
-rw-r-----. 1 oracle dba 1536 Mar 27 21:10 o1_mf_1_9_fcnjorkv_.arc
-rw-r-----. 1 oracle dba 105984 Mar 27 21:12 o1_mf_1_10_fcnjsznt_.arc
-rw-r-----. 1 oracle dba 9216 Mar 27 21:12 o1_mf_1_11_fcnjthwc_.arc
-rw-r-----. 1 oracle dba 133120 Mar 27 21:38 o1_mf_1_14_fcnlbhd5_.arc
-rw-r-----. 1 oracle dba 78336 Mar 27 21:40 o1_mf_1_15_fcnlgnvp_.arc
-rw-r-----. 1 oracle dba 531968 Mar 27 21:55 o1_mf_1_16_fcnmbz4p_.arc
-rw-r-----. 1 oracle dba 27835392 Mar 27 22:02 o1_mf_1_17_fcnmrc6y_.arc
-rw-r-----. 1 oracle dba 112640 Mar 27 22:06 o1_mf_1_18_fcnmz623_.arc
-rw-r-----. 1 oracle dba 757248 Mar 27 22:20 o1_mf_1_19_fcnns2vs_.arc
-rw-r-----. 1 oracle dba 329728 Mar 27 22:30 o1_mf_1_20_fcnodzdb_.arc
-rw-r-----. 1 oracle dba 360960 Mar 27 22:40 o1_mf_1_21_fcnoywpj_.arc
-rw-r-----. 1 oracle dba 5632 Mar 27 22:40 o1_mf_1_22_fcnoz5x5_.arc
-rw-r-----. 1 oracle dba 102400 Mar 27 22:44 o1_mf_1_23_fcnp5mtb_.arc
-rw-r-----. 1 oracle dba 71680 Mar 27 22:46 o1_mf_1_24_fcnpb13v_.arc
-rw-r-----. 1 oracle dba 90112 Mar 27 22:47 o1_mf_1_25_fcnpd7jw_.arc
-rw-r-----. 1 oracle dba 93184 Mar 27 22:54 o1_mf_1_28_fcnpsn9b_.arc
-rw-r-----. 1 oracle dba 1633280 Mar 27 23:01 o1_mf_1_29_fcnq70m6_.arc
-rw-r-----. 1 oracle dba 633344 Mar 27 23:09 o1_mf_1_30_fcnqoxpg_.arc
-rw-r-----. 1 oracle dba 452608 Mar 27 23:23 o1_mf_1_31_fcnrh8c9_.arc
-rw-r-----. 1 oracle dba 364032 Mar 27 23:33 o1_mf_1_32_fcns23nn_.arc
-rw-r-----. 1 oracle dba 3584 Mar 27 23:33 o1_mf_1_33_fcns29qs_.arc
-rw-r-----. 1 oracle dba 107520 Mar 27 23:37 o1_mf_1_34_fcns93o6_.arc
-rw-r-----. 1 oracle dba 38400 Mar 27 23:38 o1_mf_1_35_fcnschxk_.arc
-rw-r-----. 1 oracle dba 5120 Mar 27 23:38 o1_mf_1_36_fcnscp74_.arc
-rw-r-----. 1 oracle dba 90624 Mar 27 23:41 o1_mf_1_37_fcnsk7ms_.arc
-rw-r-----. 1 oracle dba 5120 Mar 27 23:41 o1_mf_1_38_fcnskjb3_.arc
[[email protected] 2018_03_27]$ mv o1_mf_1_37_fcnsk7ms_.arc o1_mf_1_37_fcnsk7ms_.arc.bak
[[email protected] 2018_03_27]$ mv o1_mf_1_38_fcnskjb3_.arc o1_mf_1_38_fcnskjb3_.arc.bak
启动备库
SQL> startup mount
#dgmgrl发现归档日志有断档
[[email protected] 2018_03_27]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> SHOW CONFIGURATION;
Configuration - dg_newtest
Protection Mode: MaxPerformance
Databases:
newtest - Primary database
Error: ORA-16724: cannot resolve gap for one or more standby databases
snewtest - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
跳断档恢复备机 备库SCN号
SQL> col CURRENT_SCN format 9999999999999999
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------------
4273430
主库SCN号
SQL> col CURRENT_SCN format 9999999999999999
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------
4273865
主库指定备库的SCN做增量备份并传输到备库
RMAN> BACKUP INCREMENTAL FROM SCN 4273430 DATABASE FORMAT '/home/oracle/backup_stage/snewtest_%U' tag 'FOR_STANDBY';
[[email protected] ~]$ scp sdataguru_* 192.168.16.130:/home/oracle/sdataguru
#主库备份控制文件并传输到备库
SQL> alter database create standby controlfile as '/home/oracle/backup_stage/std_con.ctl';
[[email protected] backup_stage]$ scp -o GSSAPIAuthentication=no * 10.10.0.24:/home/oracle/backup_stage/
[email protected]'s password:
snewtest_1gsusdtf_1_1 100% 496KB 496.0KB/s 00:00
snewtest_1hsuse04_1_1 100% 10MB 9.8MB/s 00:00
std_con.ctl
关闭备库,进行恢复
SQL> shutdown immediate
备库恢复控制文件
RMAN> startup nomount;
Oracle instance started
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 478154296 bytes
Database Buffers 301989888 bytes
Redo Buffers 2596864 bytes
RMAN> restore standby controlfile from '/home/oracle/backup_stage/std_con.ctl';
Starting restore at 28-MAR-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=/home/oracle/app/oradata/newtest/control01.ctl
output file name=/home/oracle/app/fast_recovery_area/newtest/control02.ctl
Finished restore at 28-MAR-18
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> catalog start with '/home/oracle/backup_stage';
Starting implicit crosscheck backup at 28-MAR-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 28-MAR-18
Starting implicit crosscheck copy at 28-MAR-18
using channel ORA_DISK_1
Crosschecked 6 objects
Finished implicit crosscheck copy at 28-MAR-18
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_27/o1_mf_s_971902650_fcnhxtmr_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_27/o1_mf_s_971903551_fcnkh8v3_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_21/o1_mf_s_971393885_fc5009bc_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_26/o1_mf_s_971821139_fcl0yj4q_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_26/o1_mf_s_971825430_fcl55p0w_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_26/o1_mf_s_971822377_fcl1k9x7_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_26/o1_mf_s_971820494_fckzph51_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/autobackup/2018_03_26/o1_mf_s_971823735_fcl2vr5m_.bkp
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_24/o1_mf_1_35_fcc5krsp_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_24/o1_mf_1_36_fccdmzb4_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_24/o1_mf_1_37_fcdlmkrv_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_8_fcnjwmw4_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_19_fcnoj5xm_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_102_fcmnos0y_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_7_fcnjwmwv_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_4_fcnj120w_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_15_fcnlkcdd_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_3_fcnht3tp_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_18_fcnn1wsg_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_15_fcnmvlr2_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_14_fcnlf60p_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_28_fcnrl4rk_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_18_fcnoj5wf_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_6_fcnjr490_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_36_fcnsgfnh_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_29_fcnrkzt0_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_25_fcnpgysj_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_15_fcnoj56w_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_30_fcnrkzrk_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_33_fcnsg65w_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_23_fcnpdqr8_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_10_fcnjwoy4_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_28_fcnpwcwd_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_28_fcnqb63q_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_32_fcnsg61y_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_2_fcnhm9vp_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_39_fcnss6wt_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_14_fcnmvlq0_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_1_fcnhm4kc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_20_fcnohpm2_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_29_fcnq9r66_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_5_fcnj1d8y_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_24_fcnpdr76_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_16_fcnoj57l_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_9_fcnjwmxf_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_11_fcnjx70r_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_30_fcnqrny5_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_14_fcnoj563_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_35_fcnsg7h6_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_19_fcnnvt72_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_31_fcnrkzlw_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_17_fcnmv2qw_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_22_fcnpdqv5_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_34_fcnsg669_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_17_fcnoj5f7_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_11_fcnmvlqk_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_21_fcnpdqvj_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_101_fcm387cc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_103_fcnhm9wo_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_27/o1_mf_1_16_fcnmvltj_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_21/o1_mf_1_25_fc5049cp_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_21/o1_mf_1_28_fc50bcnc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_21/o1_mf_1_26_fc504c4n_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_21/o1_mf_1_27_fc509ryf_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_21/o1_mf_1_24_fc5046ps_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_87_fcl39mvt_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_85_fcl2o80h_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_75_fcl1znj6_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_53_fcl02kxc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_90_fcl3ggcq_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_69_fcl1j76c_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_56_fcl0cvg0_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_91_fcl3gjmx_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_92_fcl3lztc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_46_fckz6nb6_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_97_fcl4m19w_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_55_fcl0cvt2_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_66_fcl18ykz_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_43_fckhnqmx_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_65_fcl18g5j_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_44_fckz6751_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_88_fcl39nvo_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_59_fcl0dfp4_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_57_fcl0cw6l_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_52_fcl01590_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_74_fcl1znmr_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_78_fcl20q15_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_47_fckz6trg_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_82_fcl2jgl6_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_72_fcl1s610_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_60_fcl0gr2y_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_84_fcl2n93y_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_80_fcl2j93g_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_83_fcl2mpl2_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_94_fcl45p2y_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_89_fcl3gdz2_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_62_fcl14glr_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_71_fcl1s584_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_54_fcl0827q_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_76_fcl1znnf_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_64_fcl14ml6_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_67_fcl1goon_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_86_fcl39ld1_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_68_fcl1j35s_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_51_fckzqtb1_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_48_fckzdl53_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_42_fcjggj1m_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_81_fcl2jc39_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_50_fckzhkc4_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_45_fckz6hyr_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_63_fcl14mdc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_96_fcl4m17m_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_61_fcl146xk_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_58_fcl0cw9h_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_95_fcl4g7vv_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_49_fckzdn7w_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_100_fcl4mo23_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_99_fcl4m2ry_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_70_fcl1s3sd_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_77_fcl1zsl7_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_93_fcl45nvo_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_79_fcl2j268_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_98_fcl4m1bo_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_26/o1_mf_1_73_fcl1vofd_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_23/o1_mf_1_33_fc9scbc4_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_23/o1_mf_1_31_fc82vmgr_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_23/o1_mf_1_34_fcb5nycb_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_23/o1_mf_1_32_fc8k3qby_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_25/o1_mf_1_40_fcglbs9g_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_25/o1_mf_1_38_fcfcrznd_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_25/o1_mf_1_41_fchf57tf_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_25/o1_mf_1_39_fcft05jc_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_22/o1_mf_1_29_fc6c0myp_.arc
File Name: /home/oracle/app/fast_recovery_area/SNEWTEST/archivelog/2018_03_22/o1_mf_1_30_fc7fs62y_.arc
searching for all files that match the pattern /home/oracle/backup_stage
List of Files Unknown to the Database
=====================================
File Name: /home/oracle/backup_stage/snewtest_1hsuse04_1_1
File Name: /home/oracle/backup_stage/std_con.ctl
File Name: /home/oracle/backup_stage/snewtest_1gsusdtf_1_1
DG broker会自动启动备机的日志同步,此时需要关闭日志同步
#备库上
SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;
Media recovery complete.
继续恢复备库
#recover 数据库
[[email protected] backup_stage]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Wed Mar 28 00:03:15 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: NEWTEST (DBID=1783795369, not open)
RMAN> recover database noredo;
Starting recover at 28-MAR-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=30 device type=DISK
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /home/oracle/app/oradata/newtest/system01.dbf
destination for restore of datafile 00002: /home/oracle/app/oradata/newtest/sysaux01.dbf
destination for restore of datafile 00003: /home/oracle/app/oradata/newtest/undotbs01.dbf
destination for restore of datafile 00004: /home/oracle/app/oradata/newtest/users01.dbf
destination for restore of datafile 00005: /home/oracle/app/oradata/newtest/users02.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup_stage/snewtest_1gsusdtf_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup_stage/snewtest_1gsusdtf_1_1 tag=FOR_STANDBY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished recover at 28-MAR-18
主库上DG broker enable备库
DGMGRL> enable database snewtest;
Enabled.
DGMGRL> show configuration;
Configuration - dg_newtest
Protection Mode: MaxPerformance
Databases:
newtest - Primary database
snewtest - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
打开备库,验证数据
SQL> alter database open;
Database altered.
SQL> select * from test;
ID
----------
1
2
3
4
5
6
7
8
9
10
11
ID
----------
12
13
14
15
16
16
18
20
21
22
23
ID
----------
24
23 rows selected.