首页 > 代码库 > 不完全恢复(基于时间)

不完全恢复(基于时间)

1.先做一次冷全备

 

3.SQL> insert into t1 values(1,‘cyf1‘);

1 row created.

SQL> commit ;

Commit complete.


3.SQL> select to_char(sysdate ,‘yyyy-mm-dd hh24:mi:ss‘) from dual;

TO_CHAR(SYSDATE,‘YY
-------------------
2015-01-04 23:40:33


4.SQL> insert into t1 values(2,‘cyf2‘);

1 row created.

SQL> commit;

Commit complete.


SQL> drop table t1;

Table dropped.


5. SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

6.删除所有的数据文件
oracle@evancao cold]$ rm -rf *.dbf


7.[oracle@evancao cold]$ cp /orcl_backup/backup20150105/*.dbf /orcl_backup/cold

8.SQL> startup mount;
ORACLE instance started.

Total System Global Area 1536602112 bytes
Fixed Size 2228624 bytes
Variable Size 889196144 bytes
Database Buffers 637534208 bytes
Redo Buffers 7643136 bytes
Database mounted.

 


9.SQL> recover database until time ‘2015-01-04 23:40:33‘;
Media recovery complete.


10.SQL> alter database open resetlogs;


查询:SQL> select * from t1;

ID NAME
---------- -----------------------------------
1 cyf1

不完全恢复(基于时间)