ITPub博客

首页 > Linux操作系统 > Linux操作系统 > flashback

flashback

原创 Linux操作系统 作者:city_85 时间:2010-10-31 19:46:00 0 删除 编辑

SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.
SQL> select sysdate from dual;

SYSDATE
-------------------
2010-03-10 13:33:58
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  775946240 bytes
Fixed Size                  2023976 bytes
Variable Size             297799128 bytes
Database Buffers          473956352 bytes
Redo Buffers                2166784 bytes
Database mounted.
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.

SQL> flashback database to timestamp to_timestamp('2010-03-10 13:32:56','yyyy-mm-dd hh24:mi:ss');

Flashback complete.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  775946240 bytes
Fixed Size                  2023976 bytes
Variable Size             297799128 bytes
Database Buffers          473956352 bytes
Redo Buffers                2166784 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.


http://www.eygle.com/archives/2005/03/eoaoracle10g_fl.html

as of timestamp
查询前5分钟的数据:
select * from liang as of timestamp sysdate-5/1440;
恢复前5分钟的数据:
insert into liang select * from liang as of timestamp sysdate-5/1440 where id<10;
as of scn
select dbms_flashback.get_system_change_number from dual;
insert into liang select * from liang as of scn 969518 where id not in(select id from liang);

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

请登录后发表评论 登录
全部评论

注册时间:2010-08-19

  • 博文量
    14
  • 访问量
    21440