OCP-1Z0-053-V13.02-684题(二)

2014-11-24 16:45:35 · 作者: · 浏览: 1
3 scott@TESTDB>commit;
Commit complete.
10:49:30 scott@TESTDB>insert into dept_new values(60,'CLERK','BEIJING');
1 row created.
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.
10:51:26 scott@TESTDB>select sysdate from dual;
SYSDATE ------------------- 2013-12-27 10:51:34
10:51:34 scott@TESTDB>drop table dept_new purge;
Table dropped.
第四步:恢复在mount状态下不完全恢复 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.

在rman里做restore database [oracle@rtest ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 27 10:54:59 2013
Copyright (c) 1982, 2011, 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>

在sqlplus里面做recover database until time sys@TESTDB>alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
Session altered.
sys@TESTDB>select sysdate from dual;
SYSDATE ------------------- 2013-12-27 10:58:12
sys@TESTDB> recover database until time '2013-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.