使用 RMAN No Catalog方式对 Oracle数据文件进..
时间:2010-10-16 来源:lihaojun2008
使用 RMAN No Catalog方式对 Oracle数据文件进行恢复
破坏现有的数据库
删除system数据文件后,数据库就无法启动了。
$ ls -l /oracle/oradata/tcqas/system01.dbf
-rw-r----- 1 oracle dba 419438592 Aug 02 13:48 /oracle/oradata/tcqas/system01.dbf
$ rm –f /oracle/oradata/tcqas/system01.dbf
$
恢复数据库
$ rman target / nocatalog
Recovery Manager: Release 10.2.0.4.0 - Production on Mon Aug 2 13:53:39 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 1308622848 bytes
Fixed Size 2083824 bytes
Variable Size 335545360 bytes
Database Buffers 956301312 bytes
Redo Buffers 14692352 bytes
RMAN> run {
2> allocate channel ch00 type sbt_tape;
3> restore database;
4> recover database;
5> }
allocated channel: ch00
channel ch00: sid=157 devtype=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.0 (2010010501)
Starting restore at 02-AUG-10
channel ch00: starting datafile backupset restore
channel ch00: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/oradata/tcqas/system01.dbf
restoring datafile 00002 to /oracle/oradata/tcqas/undotbs01.dbf
restoring datafile 00003 to /oracle/oradata/tcqas/sysaux01.dbf
restoring datafile 00004 to /oracle/oradata/tcqas/idata01.dbf
restoring datafile 00005 to /oracle/oradata/tcqas/ilog01.dbf
restoring datafile 00006 to /oracle/oradata/tcqas/indx01.dbf
channel ch00: reading from backup piece bk_45_1_725974600
channel ch00: restored backup piece 1
piece handle=bk_45_1_725974600 tag=HOT_DB_BK_LEVEL0
channel ch00: restore complete, elapsed time: 00:04:56
Finished restore at 02-AUG-10
Starting recover at 02-AUG-10
starting media recovery
media recovery complete, elapsed time: 00:00:02
Finished recover at 02-AUG-10
released channel: ch00
RMAN>
数据库恢复后,打开数据库成功,数据库恢复成功完成。
RMAN> alter database open;
database opened
RMAN>
RMAN>
RMAN> exit
Recovery Manager complete.
$