ITPub博客

首页 > 数据库 > Oracle > Oracle OCP 1Z0 053 Q564(Datafile Recovery with RMAN)

Oracle OCP 1Z0 053 Q564(Datafile Recovery with RMAN)

原创 Oracle 作者:abstractcyj 时间:2016-04-05 15:19:39 0 删除 编辑
564.Your database has experienced a loss of datafile users_01.dbf, which is associated with a ablespace
called USERS. The database is still running. Which answer properly describes the rder of the steps that
you would use to recover from this error?
1. Shut down the database.
2. Take the users_01.dbf datafile offline with the alter database command.
3. Restore the users_01.dbf datafile from backup media with the required archived redo logs.
4. Restore all users tablespace-related datafiles from backup media.
5. Issue the recover tablespace users command.
6. Issue the recover datafile users_01.dbf command.
7. Start up the database.
8. Bring the users_01.dbf datafile online with the alter database command.
A.1, 3, 6, 7
B.2, 3, 6, 8
C.1, 2,3,6,7
D.1, 2, 3, 6, 7, 8
E.2, 3,6,5,7
Answer: B


SQL> select file#, name from v$datafile;


     FILE#
----------
NAME
--------------------------------------------------------------------------------
         1
/u01/app/oracle/oradata/CATDB/datafile/o1_mf_system_cj6ddl2j_.dbf


         2
/u01/app/oracle/oradata/CATDB/datafile/o1_mf_sysaux_cj6df32d_.dbf


         3
/u01/app/oracle/oradata/CATDB/datafile/o1_mf_undotbs1_cj6dffdr_.dbf




     FILE#
----------
NAME
--------------------------------------------------------------------------------
         4
/u01/app/oracle/oradata/CATDB/datafile/o1_mf_users_cj6dfx7h_.dbf


         5
/u01/app/oracle/oradata/CATDB/datafile/users02.dbf




SQL> host rm /u01/app/oracle/oradata/CATDB/datafile/users02.dbf


SQL> alter tablespace users datafile 5 offline;
alter tablespace users datafile 5 offline
                                *
ERROR at line 1:
ORA-02142: missing or invalid ALTER TABLESPACE option




SQL> alter tablespace users datafile '/u01/app/oracle/oradata/CATDB/datafile/users02.dbf' offline;
alter tablespace users datafile '/u01/app/oracle/oradata/CATDB/datafile/users02.dbf' offline
                                *
ERROR at line 1:
ORA-02142: missing or invalid ALTER TABLESPACE option




SQL> alter tablespace users offline;
alter tablespace users offline
*
ERROR at line 1:
ORA-01116: error in opening database file 5
ORA-01110: data file 5: '/u01/app/oracle/oradata/CATDB/datafile/users02.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3




SQL> alter database datafile '/u01/app/oracle/oradata/CATDB/datafile/users02.dbf' offline;


Database altered.
----------------------------------

接下来进行恢复:

RMAN> restore datafile 5;


Starting restore at 05-APR-16
using channel ORA_DISK_1


channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/CATDB/datafile/users02.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/CATDB/backupset/2016_04_05/o1_mf_nnndf_TAG20160405T131914_cj6lpm64_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/CATDB/backupset/2016_04_05/o1_mf_nnndf_TAG20160405T131914_cj6lpm64_.bkp tag=TAG20160405T131914
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 05-APR-16


RMAN> recover datafile 5;


Starting recover at 05-APR-16
using channel ORA_DISK_1


starting media recovery
media recovery complete, elapsed time: 00:00:00


Finished recover at 05-APR-16


-------------------------------------
恢复完成将数据文件置为online

SQL> alter database datafile '/u01/app/oracle/oradata/CATDB/datafile/users02.dbf' online;


Database altered.


SQL> alter tablespace users offline;


Tablespace altered.


SQL> alter tablespace users online;


Tablespace altered.

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

请登录后发表评论 登录
全部评论
曾从事java方向开发多年。近年已经转入数据库方向。主要擅长SQL优化,Oracle数据库问题诊断,Oracle备份与恢复等。服务于医药物流,医院等行业

注册时间:2010-01-26

  • 博文量
    602
  • 访问量
    1091599