ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 备份与恢复:用user_command方式基于scn的不完全恢复

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

原创 Linux操作系统 作者:paulyibinyi 时间:2008-04-09 10:12:30 0 删除 编辑

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>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7199859/viewspace-231292/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
oracle 10g ocm oracle 10g/11g/12c ocp aix 6.1 administrator,ogg expert,ITSS 技术交流群 201703254 微信公众号 paulyibin 探讨技术,开心工作 电话 13719354869 ,深入研究数据库和开始研究big data

注册时间:2007-12-11

  • 博文量
    902
  • 访问量
    6512091