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

abstractcyj發表於2016-04-05
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部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-2075554/,如需轉載,請註明出處,否則將追究法律責任。

相關文章