RMAN> startup ;
database is already started
database opened
RMAN> sql 'alter tablesapce users offline'; --- 模拟users表空间损坏
sql statement: alter tablesapce users offline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/06/2012 14:09:28
RMAN-11003: failure during parse/execution of SQL statement: alter tablesapce users offline
ORA-00940: invalid ALTER command
RMAN> sql 'alter tablespace users offline'; --- 模拟users表空间损坏
sql statement: alter tablespace users offline
RMAN> restore tablespace users; --- 利用已备好的备份进行恢复
Starting restore at 06-JAN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: reading from backup piece E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_01_05\O1_MF_NNNDF_TAG20120105T170442_7JBSXCKD_.BKP
channel ORA_DISK_1: restored backup piece 1
piece handle=E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_01_05\O1_MF_NNNDF_TAG20120105T170442_7JBSXCKD_.BKP tag=TAG20120105T170442
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 06-JAN-12
RMAN> sql 'alter tablespace users offline';
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 01/06/2012 14:12:14
ORA-01539: tablespace '' is not online
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users offline
ORA-01539: tablespace 'USERS' is not online
RMAN> sql 'alter tablespace users online';
sql statement: alter tablespace users online
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/06/2012 14:15:55
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users online
ORA-01113: file 4 needs media recovery --- 需要Media恢复
ORA-01110: data file 4: 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
RMAN> recover tablespace users; --- Media恢复
Starting recover at 06-JAN-12
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:04
Finished recover at 06-JAN-12
RMAN> sql 'alter tablespace users online'; --- 联机users表空间
sql statement: alter tablespace users online
RMAN>
database is already started
database opened
RMAN> sql 'alter tablesapce users offline'; --- 模拟users表空间损坏
sql statement: alter tablesapce users offline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/06/2012 14:09:28
RMAN-11003: failure during parse/execution of SQL statement: alter tablesapce users offline
ORA-00940: invalid ALTER command
RMAN> sql 'alter tablespace users offline'; --- 模拟users表空间损坏
sql statement: alter tablespace users offline
RMAN> restore tablespace users; --- 利用已备好的备份进行恢复
Starting restore at 06-JAN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: reading from backup piece E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_01_05\O1_MF_NNNDF_TAG20120105T170442_7JBSXCKD_.BKP
channel ORA_DISK_1: restored backup piece 1
piece handle=E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_01_05\O1_MF_NNNDF_TAG20120105T170442_7JBSXCKD_.BKP tag=TAG20120105T170442
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 06-JAN-12
RMAN> sql 'alter tablespace users offline';
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 01/06/2012 14:12:14
ORA-01539: tablespace '' is not online
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users offline
ORA-01539: tablespace 'USERS' is not online
RMAN> sql 'alter tablespace users online';
sql statement: alter tablespace users online
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/06/2012 14:15:55
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users online
ORA-01113: file 4 needs media recovery --- 需要Media恢复
ORA-01110: data file 4: 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
RMAN> recover tablespace users; --- Media恢复
Starting recover at 06-JAN-12
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:04
Finished recover at 06-JAN-12
RMAN> sql 'alter tablespace users online'; --- 联机users表空间
sql statement: alter tablespace users online
RMAN>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22606628/viewspace-714524/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22606628/viewspace-714524/