You can use Oracle Database 10g’s Flashback Database features from three different tools: SQL*Plus, RMAN, and OEM. Let’s look at some basic requirements for using Oracle Flashback Database. Basic Flashback Database Use Requirements - To use Flashback Database, the database must first be in archivelog mode. Also, you must have any Real Application Clusters databases mounted in exclusive mode. You must also have a flashback recovery area configured, as described earlier in this chapter (done by setting the db_recovery_file_dest and db_recovery_file_dest_size database parameters). The compatible parameter should be set to 10.0 or higher.
NOTE -- It’s always a good idea to record the SCN of the database before you perform a flashback operation. That way you can recover to that SCN if need be. You can disable database flashback through the use of the alter database flashback off command (the database must be mounted and in exclusive mode). If you wish to disable flashback logging for a specific tablespace, use the alter tablespace flashback off command; you can re-enable flashback logging with the alter tablespace flashback on command. If you disable flashback for a specific tablespace, you must also take its associated datafiles offline. Flashback Database from RMAN - In Oracle Database 10g RMAN supports the use of Flashback Database to restore the database back to a specific point in time, using the database SCN or log sequence number. Using the RMAN Flashback Database command allows you to restore the database as it looked at a specific point in time, as long as the undo is available to flash back to that point in time. This makes for much quicker restores. Here is an example of using RMAN to restore the database using Flashback Database (note that the database must be mounted, and not open, to execute these RMAN operations) -- Flashback to a specific date and time RMAN> Flashback Database to_time = to_date('2003-12-01 01:05:00','YYYY-MM-DD HH24:MI:SS'); -- Flashback up to but not including a specific SCN RMAN> Flashback Database to scn = 302223; -- flashback up to but not including a specific sequence -- number. RMAN> Flashback database until sequence=1022 thread=1; Once RMAN has completed its Flashback Database operation, you can open the database in read-only mode and make sure it’s recovered to the point you want it recovered to. If it is, simply open the database using the alter database open resetlogs command to open the database for write operations.
blog comments powered by Disqus |