Databases Reference
In-Depth Information
Solution 1: Flashing Back to a Time
You have a specific time—such as August 3, 2012, at 10 p.m.—that you want to flash back to. This time must be in the
past. Here are the steps to follow:
1.
Perform the “common presteps” 1 through 3.
2.
Flash the database to your desired timestamp by issuing the following SQL statement:
SQL> flashback database to timestamp
2> to_date('08/03/2012 22:00:00','mm/dd/yyyy hh24:mi:ss');
Flashback complete.
The message “Flashback complete” confirms that the database has been flashed back.
3.
As described in the RMAN approach, you can open the database now for regular
operations by executing the “common poststep.”
4.
However, you may not be certain that you have flashed back to the exact point in time at
which you wanted to be. To determine whether you have, you can open the database in
read-only mode:
SQL> alter database open read only;
Database opened.
5.
Check the data in the tables so you can figure out whether you have flashed back enough
in the past or you need to go even further. For instance, the purpose of the flashback was
to undo the changes to the interest calculation table, so you can check the interest table to
see whether the values are 0.
6.
If you have not gone far back into the past, you can start the flashback process again to
flash back to a different timestamp. Start with step 2, and execute the “common presteps”
and flashback:
SQL> flashback database to timestamp
2> to_date('08/03/2012 21:00:00','mm/dd/yyyy hh24:mi:ss');
7.
Again, open the database in read-only mode, check the data to make sure you are at the
point at which you want to be. If you are not there, you can reexecute step 2 through step 6.
8.
Once you are satisfied that you have arrived at a point where you want to be, follow the
“common poststep” to open the database for regular operation.
The flashback to the timestamp is now complete.
 
Search WWH ::




Custom Search