Databases Reference
In-Depth Information
Solution 2: Flashing Back to a Specific SCN
You have a specific SCN to flash back to. This SCN must be less than the current SCN. The steps are the same as for the
first solution, except for step 6, in which you substitute the SCN with the timestamp:
1.
Find out the current SCN by issuing this query:
sql> select current_scn from v$database;
CURRENT_SCN
-----------
1044916
From the output, you know that the current SCN is 1,044,916. You can flash back only to
a SCN less than this number. These are the steps to flash back to the SCN 1,000,000.
2.
Follow the “common presteps” 1 through 3.
3.
Issue the following SQL statement to flash back to SCN 1,000,000:
SQL> flashback database to scn 1000000;
Flashback complete.
4.
After the flashback is complete, you can open the database in read-only mode to check
the contents.
SQL> alter database open read only;
Database altered.
5.
After the database is opened, you can check the data and determine whether the flashback
was done to a time far back enough. If not, you can flash it back once more by repeating
the steps: shut down, start up, flash back, and open as read-only.
6.
When you want the database to be at a certain point in time, follow the “common
poststep” to open the database for normal use.
The database is now flashed back and ready for use.
Solution 3: Restoring to a Restore Point
You can also use the flashback feature to roll a database back to a named restore point. See Recipe 13-9 to learn how to
create a restore point. Then use the following steps to revert to such a restore point:
1.
Follow the “common presteps.”
2.
Issue the following SQL statement to flash the database back to, in this example,
restore point rp1:
SQL> flashback database to restore point rp1;
Flashback complete.
 
Search WWH ::




Custom Search