flashback的一些常见问题:
SQL> select timestamp_to_scn(sysdate) from dual;
TIMESTAMP_TO_SCN(SYSDATE)
-------------------------
7140853
SQL> alter table orders add (qty2 number);
Table altered.
SQL> select timestamp_to_scn(sysdate) from dual;
TIMESTAMP_TO_SCN(SYSDATE)
-------------------------
7140868
SQL> flashback table orders to scn 7140853;
flashback table orders to scn 7140853
*
ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled
SQL> alter table orders enable row movement;
Table altered.
SQL> flashback table orders to scn 7140853;
Flashback complete.
SQL> alter table orders drop column qty1;
Table altered.
SQL> flashback table orders to scn 7140853;
flashback table orders to scn 7140853
*
ERROR at line 1:
ORA-01466: unable to read data - table definition has changed
SQL>
尝试flash database:
SQL> flashback database to scn 7140853;
flashback database to scn 7140853
*
ERROR at line 1:
ORA-38726: Flashback database logging is not on.
SQL> alter database flashback on;
Database altered.
SQL> select DBMS_FLASHBACK.timestamp_to_scn(sysdate) from dual;
select DBMS_FLASHBACK.timestamp_to_scn(sysdate) from dual
*
ERROR at line 1:
ORA-00904: "DBMS_FLASHBACK"."TIMESTAMP_TO_SCN": invalid identifier
SQL> @ ?rdbms/admin/dbmstran.sql;
SP2-0310: unable to open file "/tpsys/oracle/product/10.2.0/db_1rdbms/admin/dbmstran.sql"
SQL> @ ?/rdbms/admin/dbmstran.sql;
Package created.
Synonym created.
Grant succeeded.
Library created.
create or replace function timestamp_to_scn(query_time IN TIMESTAMP)
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_OBJ2) violated
Function created.
create or replace public synonym timestamp_to_scn for sys.timestamp_to_scn
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_OBJ2) violated
Synonym created.
Grant succeeded.
Grant succeeded.
SQL> select timestamp_to_scn(sysdate) from dual;
TIMESTAMP_TO_SCN(SYSDATE)
-------------------------
7143924
SQL> flashback database to scn 7143924;
flashback database to scn 7143924
*
ERROR at line 1:
ORA-38757: Database must be mounted and not open to FLASHBACK.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1660944384 bytes
Fixed Size 1219736 bytes
Variable Size 436208488 bytes
Database Buffers 1207959552 bytes
Redo Buffers 15556608 bytes
Database mounted.
SQL> flashback database to scn 7143924;
Flashback complete.
SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16179598/viewspace-626753/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16179598/viewspace-626753/