684. Your database is running in ARCHIVELOG mode. You have been taking backups of all the data files and control files regularly.
You are informed that some important tables in the BILLING tablespace have been dropped on February 28,200 7 at 10.30 AM and must be recovered.
You decide to perform an incomplete recovery using the following command:
SQL> RECOVER DATABASE UNTIL TIME '2017-02-28: 10: 15: 00 ';
Identify the files that must be restored to recover the missing tables successfully.
A. Restore the backup of all the data files.
B. Restore the backup of all the data files and the control file.
C. Restore the backup of only the data files that contain the dropped tables.
D. Restore the backup of all the data files belonging to the tablespace containing the dropped tables.
Answer: D Answer: Your database runs in archive mode and regularly backs up all data files and control files. You are notified that some important tables in the BILLING tablespace are lost in ebruary 28,200 7 at 10.30 AM and require recovery. You decided to use the following command to execute the SQL statement not completely restored> RECOVER DATABASE UNTIL TIME '2017-02-28: 10: 15: 00 ';
As shown in the following experiment, if it is a recover database, you must first restore databse, which is the data file backed up by restore.
Select A for this question.
Step 1: create a test table and insert data 10:43:49 scott @ TESTDB> create table dept_new as select * from dept;
Table created.
At 10:44:05 scott @ TESTDB> select * from dept_new;
Deptno dname loc ---------- ------------ --------------- 10 accounting new york 20 research dallas 30 sales chicago 40 OPERATIONS BOSTON
At 10:44:15 scott @ TESTDB> insert into dept_new values (50, 'it', 'China ');
1 row created.
At 10:45:07 scott @ TESTDB> select * from dept_new;
Deptno dname loc ---------- ------------ --------------- 10 accounting new york 20 research dallas 30 sales chicago 40 operations boston 50 IT CHINA
Step 2: rman backup database [oracle @ rtest ~] $ Rman target/
Recovery Manager: Release 11.2.0.4.0-Production on Fri Dec 27 10:45:36 2013
Copyright (c) 1982,201 1, Oracle and/or its affiliates. All rights reserved.
Connected to target database: TESTDB (DBID = 2617656787)
RMAN> backup database;
Starting backup at 27-DEC-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID = 37 device type = DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile (s) in backup set input datafile file number = 00001 name =/u01/app/oracle/oradata/testdb/system01.dbf input datafile file number = 00002 name =/u01/app/oracle/oradata/ testdb/sysaux01.dbf input datafile file number = 00005 name =/u01/app/oracle/oradata/testdb/example01.dbf input datafile file number = 00003 name =/u01/app/oracle/oradata/ testdb/undotbs01.dbf input datafile file number = 00004 name =/u01/app/oracle/oradata/testdb/users01.dbf channel ORA_DISK_1: starting piece 1 at 27-DEC-13 channel ORA_DISK_1: finished piece 1 at 27-DEC-13 piece handle =/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_12_27/o1_mf_nnndf_TAG20131227T104552_9csth1ns _. bkp tag = TAG20131227T104552 comment = NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:02:05 Finished backup at 27-DEC-13
Starting Control File and SPFILE Autobackup at 27-DEC-13 piece handle =/u01/app/oracle/fast_recovery_area/TESTDB/autobackup/2013_12_27/o1_mf_s_835267679_9c%02l _. bkp comment = NONE Finished Control File and SPFILE Autobackup at 27-DEC-13
Step 3: drop table 10:49:05 scott @ TESTDB> select * from dept_new;
Deptno dname loc ---------- ------------ --------------- 10 accounting new york 20 research dallas 30 sales chicago 40 operations boston 50 IT CHINA
At 10:49:13 scott @ TESTDB> commit;
Commit complete.
10:49:30 scott @ TESTDB> insert into dept_new values (60, 'cler', 'beijing ');
1 row created.
At 10:50:34 scott @ TESTDB> commit;
Commit complete.
10:50:55 scott @ TESTDB> alter session set nls_date_format = 'yyyy-mm-dd hh24: mi: ss ';
Session altered.
At 10:51:26 scott @ TESTDB> select sysdate from dual;
SYSDATE -------------------
10:51:34
At 10:51:34 scott @ TESTDB> drop table dept_new purge;
Table dropped.
Step 4: restore to the mount state and not completely restore sys @ TESTDB> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. sys @ TESTDB> startup mount; ORACLE instance started.
Total System Global Area 309673984 bytes Fixed Size 1364312 bytes Variable Size 268439208 bytes Database Buffers 33554432 bytes Redo Buffers 6316032 bytes Database mounted.
Restore database in rman [oracle @ rtest ~] $ Rman target/
Recovery Manager: Release 11.2.0.4.0-Production on Fri Dec 27 10:54:59 2013
Copyright (c) 1982,201 1, Oracle and/or its affiliates. All rights reserved.
Connected to target database: TESTDB (DBID = 2617656787, not open)
RMAN> restore database;
Starting restore at 27-DEC-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID = 20 device type = DISK
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 00001 to/u01/app/oracle/oradata/testdb/system01.dbf channel ORA_DISK_1: restoring datafile 00002 to/u01/app/oracle/oradata/testdb/sysaux01.dbf channel ORA_DISK_1: restoring datafile 00003 to/u01/app/oracle/oradata/testdb/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00004 to/u01/app/oracle/oradata/testdb/users01.dbf channel ORA_DISK_1: restoring datafile 00005 to/u01/app/oracle/oradata/testdb/example01.dbf channel ORA_DISK_1: reading from backup piece/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_12_27/o1_mf_nnndf_TAG20131227T104552_9csth1ns _. bkp channel ORA_DISK_1: piece handle =/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_12_27/o1_mf_nnndf_TAG20131227T104552_9csth1ns _. bkp tag = TAG20131227T104552 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:01:56 Finished restore at 27-DEC-13
RMAN>
Recover database until time sys @ TESTDB> alter session set nls_date_format = 'yyyy-mm-dd hh24: mi: ss' in sqlplus ';
Session altered.
Sys @ TESTDB> select sysdate from dual;
SYSDATE ------------------- 10:58:12
Sys @ TESTDB>
Recover database until time '2017-12-27: 10: 51: 34 ';Media recovery complete. sys @ TESTDB> alter database open resetlogs;
Database altered.
Sys @ TESTDB> select * from scott. dept_new;
Deptno dname loc ---------- ------------ ------------- 10 accounting new york 20 research dallas 30 sales chicago 40 operations boston 50 it china 60 CLERK BEIJING
6 rows selected.