ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RMAN学习---Tablespace 恢复

RMAN学习---Tablespace 恢复

原创 Linux操作系统 作者:quanli0818 时间:2012-01-06 14:18:10 0 删除 编辑
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>

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

上一篇: Oracle 列操作
请登录后发表评论 登录
全部评论

注册时间:2010-01-25

  • 博文量
    26
  • 访问量
    124622