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]calhost 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.

原文地址:https://www.cnblogs.com/chinesern/p/8687116.html

时间: 2024-11-10 06:02:10

Oracle11gr2_ADG管理之跳归档恢复dg实战的相关文章

Oracle数据库精讲课程之Rac管理(集群组件、性能监控及调整、节点管理、备份和恢复)

对这个课程有兴趣的朋友可以加我的QQ2059055336和我联系 本课程主要是介绍Oracle RAC体系结构与工作机制,了解并掌握RAC数据库下的相关技术,如:cache Fusion. Failover.load balance.FAN.OCR和Voting disk等,通过VMWARE虚拟环境,实践演练RAC数据库的安装部署.RAC数据库日常性能监控.备份和恢复.实例增加和删除以及补丁安装等操作,通过本课程的学习,学员在掌握RAC理论知识基础上,能够熟练掌握RAC数据库的日常管理操作. 课

Oracle用户管理模式的备份恢复_超越OCP精通Oracle视频教程培训16

oracle视频教程目标 Oracle视频教程,风哥本套oracle教程培训学习oracle数据库用户管理的备份与恢复,归档模式与非归档模式,闪回恢复区,冷备份,热备份,dbverify工具的详解,如何完全恢复丢失的所有数据文件,基于时间点/取消/SCN的不完全恢复案例,归档日志的损坏,联机日志文件的损坏,数据文件无备份的恢复等日常管理与维护. 适用人群 IT相关从业人员.Oracle数据库技术人员.想加工资的.想升职的都可以. 视频在线学习地址: http://edu.51cto.com/co

[转]Oracle DB 执行用户管理的备份和恢复

• 说明用户管理的备份和恢复与服务器管理的备份和恢复之间的差异 • 执行用户管理的数据库完全恢复 • 执行用户管理的数据库不完全恢复 备份和恢复的使用类型 数据库备份和恢复的类型包括: • 用户管理的:不使用RMAN – 使用OS 命令移动文件 – DBA 需要手动维护备份活动记录 • 服务器管理的:使用RMAN 有两种方法可用来恢复数据库.可以使用RMAN 并利用其自动恢复功能.它可以还原相应的文件,并使用非常少的命令使数据库恢复到当前状态.还可以手动进行恢复.这称为“用户管理的恢复”.用户管

Linux软件包管理04-压缩归档及源码编译安装

一.压缩.解压缩命令 1.压缩格式:gz, bz2, xz, zip, Z 2.压缩算法:算法不同,压缩比也会不同: 3.原始的压缩命令:compress: FILENAME.Z 解压缩:uncompress 4.压缩成.gz格式的文件(仅压缩文件) a)gzip /PATH/TO/SOMEFILE:压缩完成后会删除原文件,如:gzip /tmp/file* -d:解压缩,相当于gunzip命令: -#:指定压缩比,范围是1-9,默认是6: b)gunzip: 解压缩: gunzip /PATH

.cmd文件不小心管理记事本打开的恢复

例如不小心将.cmd文件关联成用记事本打开了,此时需要删除注册表: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\[.文件后缀] 但删除注册表后发现,cmd文件的图标仍然不正确:然后使用图标修复工具修复,例如使用360的工具: 然后可以选择第一项进行修复 之后图标就正常了 .cmd文件不小心管理记事本打开的恢复

Oracle11gR2_ADG管理之恢复主库的truncate表实战

备库开启flashback database #关闭备库的同步 SQL> alter database recover managed standby database cancel; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO SQL> alter database flashback on; Database altered. SQL>

BBED跳过归档恢复

实验: (1)备份5号文件SQL> select * from v$dbfile; FILE# NAME---------- ----------------------------------- 4 /orcl_backup/cold/users01.dbf 3 /orcl_backup/cold/undotbs01.dbf 2 /orcl_backup/cold/sysaux01.dbf 1 /orcl_backup/cold/system01.dbf 5 /orcl_backup/cold

Oracle11gr2_ADG管理之在备库上模拟failover的过程实战

技术建议和方案. 要求failover后不重建备库,并能够把failover的数据库重新切换回备库 主库为newtest,备库为snewtest 备库上已经开启了闪回 得到一个参考的SCN SQL> select current_scn from v$database; CURRENT_SCN ----------- 4491930 查看闪回数据库特性是打开的. SQL> select flashback_on from v$database; FLASHBACK_ON -----------

rman 增量恢复 dg gap后 主库添加新数据文件

1) On the standby database, 关闭 (MRP) SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; 2) On the STANDBY DATABASE, 获取备库最小scn值,用作主库增量备份点 : col MIN(CHECKPOINT_CHANGE#) for 999999999999999999 col CURRENT_SCN for 99999999999999999 SELECT CURRE