Oracleflashback -- returns oracle data and restores data to the specified timestamp
Microsoft Windows [version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C: \ Users \ ckz> sqlplus zzjd/zzjd@10.22.1.143/orcl as sysdba; SQL * Plus: Release 11.2.0.1.0 Production on Wednesday May 13 17:00:46 2015 Copyright (c) 1982,201 0, Oracle. all rights reserved. connect to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> shutdown immediate; the Database has been closed. The database has been detached. The ORACLE routine has been disabled. SQL> startup MOUNT; the ORACLE routine has been started. Total System Global Area 1071333376 bytesFixed Size 1375792 bytesVariable Size 713032144 bytesDatabase Buffers 352321536 bytesRedo Buffers 4603904 bytes database loaded. SQL> flashback database to scn 119272598; flash back complete. SQL> alter database open; alter database open * 1st Line Error: ORA-01589: to open the database, you must use RESETLOGS or NORESETLOGS option SQL> alter database open noresetlogs; alter database open noresetlogs * 1st row error: ORA-01610: recovery using the backup controlfile option must be completed SQL> alter database open resetlogs; database changed. SQL>
View the recoverable timestamp or SCN point and execute the following SQL statement:
select scn,to_char(time_dp,'yyyy-mm-dd hh24:mi:ss')from sys.smon_scn_time order by to_char(time_dp,'yyyy-mm-dd hh24:mi:ss') desc;
We do not recommend that you use this method to restore data.
Method 2:
Before restoring a data table, clear the data table to be restored to avoid data conflict during recovery.
delete t_viradsl2
insert into t_viradsl2 select * from t_viradsl2 as of timestamp to_Date('2011-01-19 15:28:00', 'yyyy-mm-dd hh24:mi:ss')