- 只有一个或几个表空间损坏。
- 把相应表空间或数据文件offline,然后alter database open,这样除了受影响表空间以外的数据库仍可用。
- 对相应表空间或数据文件进行恢复,然后online。
RMAN> startup
Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 04/09/2008 10:29:48
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: 'D:\OPT\ORACLE9I\PRODUCT\9.2.0\ORADATA\ORA92US\USERS01.DBF'
RMAN> sql 'alter tablespace users offline';
注意:在数据库mount状态下不能以tablespace为单位进行操作,因为alter tablespace ** offline 会触发checkpoint,对controlfile和datafile进行写操作,而这在mount状态下是不可能的。
using target database controlfile instead of recovery catalog
sql statement: alter tablespace users offline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 04/09/2008 10:30:02
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users offline
ORA-01109: database not open
RMAN> sql 'alter tablespace users offline immediate';
sql statement: alter tablespace users offline immediate
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 04/09/2008 10:30:47
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users offline immediate
ORA-01109: database not open
RMAN> sql 'alter database datafile 3 offline';
sql statement: alter database datafile 3 offline
RMAN> sql 'alter database open';
sql statement: alter database open
RMAN> restore datafile 3;
Starting restore at 2008-04-09 10:31:58
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to D:\OPT\ORACLE9I\PRODUCT\9.2.0\ORADATA\ORA92US\USERS01.DBF
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ORA_BAK\RMAN\ORA92US\DF_ORA92US_2_1.BAK tag=WHOLECOLD params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 2008-04-09 10:32:01
RMAN> recover datafile 3;
Starting recover at 2008-04-09 10:32:06
using channel ORA_DISK_1
starting media recovery
media recovery complete
Finished recover at 2008-04-09 10:32:07
RMAN> sql 'alter database datafile 3 online';
sql statement: alter database datafile 3 online
RMAN>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9765498/viewspace-232229/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9765498/viewspace-232229/