incremental from scn for gap standby 實驗

guocun09發表於2012-05-13

環境:Red Hat Enterprise Linux AS release 4 (Nahant)
      Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod


備庫中:
SELECT current_scn+1 FROM V$DATAFILE

主庫中:
[oracle@smt u01]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on 琍戳き 5る 11 02:45:01 2012

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

connected to target database: GUOCUNDB (DBID=2081850222)

RMAN> backup incremental from scn 827591 database format  '/u01/bkup_%U';

Starting backup at 11-5る -12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00007 name=/u01/oracle/SFISM4_DATA_01.dbf
input datafile fno=00001 name=/opt/oracle/oradata/guocundb/system01.dbf
input datafile fno=00003 name=/opt/oracle/oradata/guocundb/sysaux01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/guocundb/undotbs01.dbf
input datafile fno=00004 name=/opt/oracle/oradata/guocundb/users01.dbf
input datafile fno=00008 name=/opt/oracle/oradata/guocundb/users02.dbf
input datafile fno=00005 name=/u01/oracle/SWDL_DATA_01.dbf
input datafile fno=00006 name=/u01/oracle/SFIS1_DATA_01.dbf
channel ORA_DISK_1: starting piece 1 at 11-5る -12
channel ORA_DISK_1: finished piece 1 at 11-5る -12
piece handle=/u01/bkup_0lm6tt8q_1_1 tag=TAG20120511T024649 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:05
Finished backup at 11-5る -12


SQL> alter database create standby controlfile as '/u01/sty.ctl';

Database altered.


備庫:
建立新加datafile
SQL>  alter system set standby_file_management=manual;

System altered.

SQL> ALTER DATABASE CREATE DATAFILE 8 AS  '/opt/oracle/oradata/guocundb/users02.dbf';

Database altered.

RMAN> CATALOG START WITH '/u01/bkup_0lm6tt8q_1_1';

Starting implicit crosscheck backup at 09-5る -12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=152 devtype=DISK
Crosschecked 7 objects
Finished implicit crosscheck backup at 09-5る -12

Starting implicit crosscheck copy at 09-5る -12
using channel ORA_DISK_1
Crosschecked 3 objects
Finished implicit crosscheck copy at 09-5る -12

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /u01/bkup_0lm6tt8q_1_1

List of Files Unknown to the Database
=====================================
File Name: /u01/bkup_0lm6tt8q_1_1

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/bkup_0lm6tt8q_1_1


RMAN> list backup;

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21      Incr    832.00K    DISK        00:00:00     11-5る -12    
        BP Key: 21   Status: AVAILABLE  Compressed: NO  Tag: TAG20120511T024649
        Piece Name: /u01/bkup_0lm6tt8q_1_1
  List of Datafiles in backup set 21
  File LV Type Ckp SCN    Ckp Time   Name
  ---- -- ---- ---------- ---------- ----
  1       Incr 829091     11-5る -12 /opt/oracle/oradata/guocundb/system01.dbf
  2       Incr 829091     11-5る -12 /opt/oracle/oradata/guocundb/undotbs01.dbf
  3       Incr 829091     11-5る -12 /u01/oracle/sysaux01.dbf
  4       Incr 829091     11-5る -12 /u01/oracle/users01.dbf
  5       Incr 829091     11-5る -12 /u01/oracle/SWDL_DATA_01.dbf
  6       Incr 829091     11-5る -12 /u01/oracle/SFIS1_DATA_01.dbf
  7       Incr 829091     11-5る -12 /u01/oracle/SFISM4_DATA_01.dbf
  8       Incr 829091     11-5る -12 /opt/oracle/oradata/guocundb/users02.dbf

RMAN> recover database noredo;

Starting recover at 09-5る -12
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /opt/oracle/oradata/guocundb/system01.dbf
destination for restore of datafile 00002: /opt/oracle/oradata/guocundb/undotbs01.dbf
destination for restore of datafile 00003: /u01/oracle/sysaux01.dbf
destination for restore of datafile 00004: /u01/oracle/users01.dbf
destination for restore of datafile 00005: /u01/oracle/SWDL_DATA_01.dbf
destination for restore of datafile 00006: /u01/oracle/SFIS1_DATA_01.dbf
destination for restore of datafile 00007: /u01/oracle/SFISM4_DATA_01.dbf
destination for restore of datafile 00008: /opt/oracle/oradata/guocundb/users02.dbf
channel ORA_DISK_1: reading from backup piece /u01/bkup_0lm6tt8q_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/bkup_0lm6tt8q_1_1 tag=TAG20120511T024649
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished recover at 09-5る -12


 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25583515/viewspace-723444/,如需轉載,請註明出處,否則將追究法律責任。

相關文章