Databases Reference
In-Depth Information
Chapter 13
Performing Flashback Recovery
In Oracle Database 10g Release 1, Oracle introduced a new feature: flashback. Actually, the term is used in three
different contexts, making the usage somewhat confusing. There is also a similar-sounding feature—flashback
queries—starting with Oracle9i Database, and this doesn't help matters much.
The flashback concepts introduced in Oracle Database 10g are different from the ones introduced in Oracle9i
Database. The 10g version of the term—flashback—actually refers to an aid to recoverability. In this chapter, you will
learn about the various flavors of flashback and how to use each one. You will also learn how to recover a specific table
from the backups without having to recover an entire database.
Introducing Flashback
There are four flavors of flashback:
Flashing back a database
Undropping a table
Flashing back a table
Recovering a single table from backup
Flashing Back a Database
Many times you might need to roll back the database to a point in time in the past. In earlier releases, this functionality
was present but in a very different way. For instance, in Oracle9i Database and prior versions, you would reinstate
an older backup and then roll it forward to a point in time in the past. For instance, suppose today is January 21 and
the time is 10 a.m. The database backups are taken at 5 a.m. every day. If you wanted to roll the database back to
10 p.m. January 20, you would restore the backup taken at 5 a.m. January 20 and then apply all the archived redo logs
to restore it to 10 p.m. But what if you made a mistake in your calculation and the data you wanted to recover was
deleted at 9 p.m.? After you recovered the database up to 10 p.m., all your work was in vain. There is no going back to
9 p.m.; you would have to start the process again from the beginning—restore the backup of 5 a.m. and then roll
forward all the changes by applying logs up to 9 p.m.
Oracle Database 10g changed all that by introducing a feature called flashback database. You enable flashback
on the database. This causes additional logs to be created during the database operation. These logs, called flashback
logs, are generated along with the regular archived logs. The flashback logs record changes to the database blocks
exclusively for the purpose of rolling back the block changes, so they are different from archived logs. When you flash
the database back to a point in the past, these flashback logs are read and applied to the database blocks to undo the
changes. The entire database is transported to that point in time.
 
Search WWH ::




Custom Search