rman备份与恢复:用user_command方式基于时间的不完全恢复

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:787

备份与恢复:用user_command方式基于时间的不完全恢复

SQL> select * from test;
ID
----------
1
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
这时备份所有数据文件
SQL> startup
ORACLE instance started.
Total System Global Area 546382300 bytes
Fixed Size 455132 bytes
Variable Size 520093696 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select sysdate from dual;
SYSDATE
---------
09-APR-08
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi;ss';
Session altered.
SQL> select sysdate from dual;
SYSDATE
-------------------
2008-04-09 09:44;37 --基于这个时间点之前的
SQL> drop table test;
Table dropped.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
把备份的所有数据文件拷贝回来
SQL> startup mount;
ORACLE instance started.
Total System Global Area 546382300 bytes
Fixed Size 455132 bytes
Variable Size 520093696 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> recover database until time '2008-04-09 09:44:37'; 做基于时间的不完全恢复
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.
SQL> select * from test;
ID
----------
1
2
SQL>

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】