create table t as select * from dba_users;
variable scn number;
exec :scn := dbms_flashback.get_system_change_number;
delete from t;
SQL> delete from t;
43 rows deleted.
SQL> commit;
Commit complete.
SQL> select count(*) from t as of scn :scn;
COUNT(*)
----------
43
SQL> flashback table t to scn :scn
2 /
flashback table t to scn :scn
*
ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled
SQL> alter table t enable row movement;
Table altered.
SQL> flashback table t to scn :scn
2 /
Flashback complete.
SQL> select count(*) from t;
COUNT(*)
----------
43
Tuesday, May 1, 2007
flashback queries
Use the following example as a guide on using flashback query.
create table t as select * from dba_users;
variable scn number;
exec :scn := dbms_flashback.get_system_change_number;
delete from t;
SQL> delete from t;
43 rows deleted.
SQL> commit;
Commit complete.
SQL> select count(*) from t as of scn :scn;
COUNT(*)
----------
43
SQL> flashback table t to scn :scn
2 /
flashback table t to scn :scn
*
ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled
SQL> alter table t enable row movement;
Table altered.
SQL> flashback table t to scn :scn
2 /
Flashback complete.
SQL> select count(*) from t;
COUNT(*)
----------
43
create table t as select * from dba_users;
variable scn number;
exec :scn := dbms_flashback.get_system_change_number;
delete from t;
SQL> delete from t;
43 rows deleted.
SQL> commit;
Commit complete.
SQL> select count(*) from t as of scn :scn;
COUNT(*)
----------
43
SQL> flashback table t to scn :scn
2 /
flashback table t to scn :scn
*
ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled
SQL> alter table t enable row movement;
Table altered.
SQL> flashback table t to scn :scn
2 /
Flashback complete.
SQL> select count(*) from t;
COUNT(*)
----------
43
vi handy tips
:g/$/s//;/g Stick a ; on the end of every line
:g/^/s//;/g Stick a ; on the start of every line
:1,$s/a/b/g Replace a with b on every line
:g/^/s//;/g Stick a ; on the start of every line
:1,$s/a/b/g Replace a with b on every line
Subscribe to:
Posts (Atom)