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

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

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

SQL> select * from test;
ID
----------
1
2
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
备份cp 所有数据文件
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> select * from test;
ID
----------
1
2
SQL> insert into test values(3);
1 row created.
SQL> commit;
Commit complete.
SQL> select dbms_flashback.get_system_change_number from dual; --查出scn号
GET_SYSTEM_CHANGE_NUMBER
------------------------
1219138
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 change 1219138; --基于scn的不完全恢复
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.
SQL> select * from test;
ID
----------
1
2
3
SQL>

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