ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 不完全恢复测试纪录

不完全恢复测试纪录

原创 Linux操作系统 作者:tan9030 时间:2009-03-11 10:13:14 0 删除 编辑

1.Executed full back database and arch
  TAG20090211T091422 data
  TAG20090211T091523 crtl
  TAG20090211T091526 arch
  TAG20090211T091703 crtl

2. Create one test table ajang_test:
   create table ajang_test as select * from dba_objects;
   alter system switch logfile:
   alter system switch logfile
   alter system switch logfile

   Time='09:23:07 EAT 2009'

3. Executed full back database and arch

   TAG20090211T092932 data
   TAG20090211T093035 crtl
   TAG20090211T093038 arch
   TAG20090211T093051 crtl

    Time='09:31:07 EAT 2009'

4. drop table  ajang_test;
   alter system switch logfile:
   alter system switch logfile
   alter system switch logfile

5. Execute a full backup again (database and arch)

#################################################################################################

 Now, I would like to use the backup which is done at step 3 to resotre full database
      and recover the database to '09:31:07 EAT 2009'.
#################################################################################################

  szx032:oracle> rman target / nocatalog
                 rman> shutdown immeidate;
                 rman> startup mount;
                 rman> restore database from tag='TAG20090211T092932';
                 rman> sql 'alter session set NLS_LANGUAGE=AMERICAN';
                 rman> sql 'alter session set nls_date_format="YYYY-MM-DD:HH24:MI:SS"';
                 rman> recover database until time '2009-02-11 09:31:30';
                       #### Recover will read the arch file info from arch back file" ####

Starting recover at 2009-02-11 10:26:43
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=28
channel ORA_DISK_1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_7
4:678533443:1.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_74:678533443:1.dbf tag=TAG20090211
T093038
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_28_1_675453958.arc thread
=1 sequence=28
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=29
channel ORA_DISK_1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_7
7:678533449:1.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_77:678533449:1.dbf tag=TAG20090211
T093038
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_29_1_675453958.arc thread
=1 sequence=29
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=30
channel ORA_DISK_1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_9
6:678533794:1.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_96:678533794:1.dbf tag=TAG20090211
T093634
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_30_1_675453958.arc thread
=1 sequence=30
media recovery complete, elapsed time: 00:0
0:01
Finished recover at 2009-02-11 10:26:52


[szx032]oracle:> sqlplus /nolog
SQL> connect /as sysdba
Connected.
SQL> alter database open resetlogs;
SQL> desc fwstm2.ajang_test;

  The table ajang_test was recovered back from rman backup.

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69934/viewspace-566744/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-10-15

  • 博文量
    3
  • 访问量
    5469