ITPub博客

首页 > Linux操作系统 > Linux操作系统 > incremental from scn for gap standby 实验

incremental from scn for gap standby 实验

原创 Linux操作系统 作者:guocun09 时间:2012-05-13 11:56:50 0 删除 编辑

环境: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/,如需转载,请注明出处,否则将追究法律责任。

下一篇: Systemstate Dump
请登录后发表评论 登录
全部评论
DBA,掌握Oracle,SQLServer,MySQL,hadoop,casscandra等数据库。喜爱深入研究数据库技术原理,擅长管理和优化工作。

注册时间:2011-10-02

  • 博文量
    142
  • 访问量
    521366