RMAN备份方案(二)

2014-11-24 15:53:22 · 作者: · 浏览: 1
ed.   ORACLE instance shut down   C:\>del D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF   C:\>del D:\ORACLE\ORADATA\TEST\INDX01.DBF   C:\>del D:\ORACLE\ORADATA\TEST\TOOLS01.DBF   C:\>del D:\ORACLE\ORADATA\TEST\RBS01.DBF

  5、启动数据库,检查错误
  
SQL> STARTUP

  ORACLE instance started.

  Total System Global Area 102020364 bytes

  Fixed Size 70924 bytes

  Variable Size 85487616 bytes

  Database Buffers 16384000 bytes

  Redo Buffers 77824 bytes

  Database mounted.

  ORA-01157: cannot identify/lock data file 1 - see DBWR trace file

  ORA-01110: data file 1: 'D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF'

  查询v$recover_file

  SQL> select * from v$recover_file;

  FILE# ONLINE ERROR CHANGE# TIME

  ---------- ------- ------------------ ---------- -----------

  1 ONLINE FILE NOT FOUND 0

  2 ONLINE FILE NOT FOUND 0

  5 ONLINE FILE NOT FOUND 0

  6 ONLINE FILE NOT FOUND 0

  可以知道有四个数据文件需要恢复
  6、利用RMAN进行恢复
  C:\>rman

  Recovery Manager: Release 8.1.6.0.0 - Production

  RMAN> connect rcvcat rman/rman@back

  RMAN-06008: connected to recovery catalog database

  RMAN> connect target internal/virpure

  RMAN-06005: connected to target database: TEST (DBID=1788174720)

  RMAN> run{

  2> allocate channel c1 type disk;

  3> restore database;

  4> recover database;

  5> sql 'alter database open';

  6> release channel c1;

  7> }

  RMAN-03022: compiling command: allocate

  RMAN-03023:
executing command: allocate   RMAN-08030: allocated channel: c1   RMAN-08500: channel c1: sid=17 devtype=DISK   RMAN-03022: compiling command: restore   RMAN-03025: performing implicit partial resync of recovery catalog   RMAN-03023: executing command: partial resync   RMAN-08003: starting partial resync of recovery catalog   RMAN-08005: partial resync complete   RMAN-03022: compiling command: IRESTORE   RMAN-03023: executing command: IRESTORE   RMAN-08016: channel c1: starting datafile backupset restore   RMAN-08502: set_count=4 set_stamp=494074368 creation_time=15-MAY-03   RMAN-08089: channel c1: specifying datafile(s) to restore from backup set   RMAN-08523: restoring datafile 00001 to D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF   RMAN-08523: restoring datafile 00002 to D:\ORACLE\ORADATA\TEST\RBS01.DBF   RMAN-08523: restoring datafile 00003 to D:\ORACLE\ORADATA\TEST\USER01.DBF   RMAN-08523: restoring datafile 00004 to D:\ORACLE\ORADATA\TEST\TEMP01.DBF   RMAN-08523: restoring datafile 00005 to D:\ORACLE\ORADATA\TEST\TOOLS01.DBF   RMAN-08523: restoring datafile 00006 to D:\ORACLE\ORADATA\TEST\INDX01.DBF   RMAN-08023: channel c1: restored backup piece 1   RMAN-08511: piece handle=D:\BACKUP\FULL04EN5UG0_4_1 tag=DBFULL params=NULL   RMAN-08024: channel c1: restore complete   RMAN-03023: executing command: partial resync   RMAN-08003: starting partial resync of recovery catalog   RMAN-08005: partial resync complete   RMAN-03022: compiling command: recover   RMAN-03022: compiling command: recover(1)   RMAN-03022: compiling command: recover(2)   RMAN-03022: compiling command: recover(3)   RMAN-03023: executing command: recover(3)   RMAN-08054: starting media recovery   RMAN-03022: compiling command: recover(4)   RMAN-06050: archivelog thread 1 sequence 327 is already on disk as file D:\ORACLE\ORADATA\