restore dataguard while primary’s archivelog was deleted by accident without applied

來源:互聯網
上載者:User
 

on standby:
--find out the current scn for incremental backup
$ sqlplus "/ as sysdba"
SQL> startup mount
SQL> select sequence# from v$log where status='CURRENT';

no rows selected

 SQL> select name,open_mode,PROTECTION_MODE,DATABASE_ROLE from v$database;NAME      OPEN_MODE  PROTECTION_MODE      DATABASE_ROLE
--------- ---------- -------------------- ----------------
ORCL     MOUNTED    MAXIMUM PERFORMANCE  PHYSICAL STANDBY SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#; SEQUENCE# FIRST_TIME   NEXT_TIME
---------- ------------ ------------
     15347 13-FEB-10    13-FEB-10
     15348 13-FEB-10    13-FEB-10272 rows selected. SQL> select ARCHIVE_CHANGE# ,CURRENT_SCN from v$database;
8178572277879 on primary:
RMAN> backup device type disk incremental from scn 8178572277879 database format '/dbbackup/bkup_%U' tag 'standby';-- recreate the standby controlfile:
SQL> alter database create standby controlfile as '/dbbackup/ctl_bk1.ctl'; scp all backup file to standby server:
scp bkupdf1_8rl6le4c_1_1 oracle@192.168.1.101:/dbbackup/incrback on standby:
shutdown oracle --replace the old control file[oracle@whdbdg incrback]$ cp ctl_bk1.ctl /u01/oradata/ORCL/control01.ctl
[oracle@whdbdg incrback]$ cp ctl_bk1.ctl /u01/oradata/ORCL/control02.ctl
[oracle@whdbdg incrback]$ mv ctl_bk1.ctl /u01/oradata/ORCL/control03.ctl [oracle@whdbdg incrback]$ rman target /;
RMAN> startup mount;
RMAN> catalog start with '/dbbackup/incrback/';using target database control file instead of recovery catalog
searching for all files that match the pattern /dbbackup/incrback/List of Files Unknown to the Database
=====================================
File Name: /dbbackup/incrback/bkup_8nl6la3v_1_1Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging doneList of Cataloged Files
=======================
File Name: /dbbackup/incrback/bkup_8nl6la3v_1_1RMAN> recover database noredo;RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/22/2010 12:44:56
RMAN-06094: datafile 34 must be restoredon primary:
-- check the newly created datafile.
SQL>select FILE#,name from v$datafile where CREATION_CHANGE#>=28178572277879;-- or
SQL> set line 200
SQL> set pagesize 9999
SQL> col name format a60
SQL> select FILE#,STATUS,NAME from v$datafile order by 1;     FILE# STATUS  NAME
---------- ------- ------------------------------------------------------------
         1 SYSTEM  /u01/oradata/ORCL/system01.dbf
...
        33 ONLINE  /u01/oradata/ORCL/whdb_data20.dbf
        34 ONLINE  /u01/oradata/ORCL/whdb_index05.dbf
        35 ONLINE  /u01/oradata/ORCL/whdb_data21.dbf
        36 ONLINE  /u01/oradata/ORCL/whdb_data22.dbfRMAN> backup device type disk datafile 34,35,36 FORMAT '/dbbackup/bkupdf1_%U';
scp all backup file to standby server on standby:
RMAN> catalog start with '/dbbackup/incrback/';
RMAN> restore datafile 34,35,36;
RMAN> recover database noredo; -- startup dg to apply logSQL> alter database recover managed standby database disconnect from session; on primary:
SQL> alter system archive log current;on standby:check alertlog to identify whether the dg runs right:
Completed: alter database recover managed standby database disconnect from session
Mon Feb 22 13:05:25 2010
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 11763
RFS[2]: Identified database type as 'physical standby'
Primary database is in MAXIMUM PERFORMANCE mode
Primary database is in MAXIMUM PERFORMANCE mode
RFS[2]: Successfully opened standby log 7: '/u01/oradata/ORCL/redo07.log'
Mon Feb 22 13:06:07 2010
RFS[1]: Successfully opened standby log 8: '/u01/oradata/ORCL/redo08.log'
Mon Feb 22 13:06:08 2010
Media Recovery Log /u01/arch/arch_1_15363_643904690.arc
Media Recovery Waiting for thread 1 sequence 15364 (in transit)-- clear old log and backup
RMAN> delete noprompt archivelog until time 'sysdate-7';
find /u01/arch -type f -name "arch_1_1*.arc" -mtime +5 -exec rm {} /; on primary:--clear rman backup
RMAN> DELETE BACKUP TAG 'standby'; --check the last applied logSQL> select max(sequence#) from v$archived_log where applied='YES';MAX(SEQUENCE#)
--------------
         15363 refer:
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#BGBCEBJG
http://space.itpub.net/15415488/viewspace-615573
http://cs.felk.cvut.cz/10gr2/backup.102/b14191/rcmdupdb008.htm
http://hi.baidu.com/wa0362/blog/item/37e3fd22a00370af4723e82f.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.