Move your mouse over this icon to show all screenshots.
You can also move your mouse over each individual icon to see only the screenshot
associated with it.
In Oracle Database 10g, flashback functionality has
been extended. It is now possible to flash back an entire table and quickly
recover a table that has been inadvertently dropped.
What is the Recycle Bin?
In previous releases of the Oracle server, the DROP
command permanently removed objects from the database. Now when you drop a table
and its dependent objects it is placed in the recycle bin. It is not removed
from the database until you empty the recycle bin. The extents allocated to
the segment are not deallocated until you purge the object. You can restore
these dropped objects from the recycle bin at any time.
You can still query tables after you have dropped them. You
can issue a SELECT statement
against the objects in the recycle bin using the name of the object in the recycle
bin. You can also issue a Flashback Query against objects in the recycle bin
to query past data, as long as the undo information required to satisfy the
query is available. You can only issue these queries if you are the original
owner of the object. Perform the following
1.
At this point, you can query the recycle bin for the
table you just dropped. Open another browser window and enter the following
URL:
http://<hostname>:5500/em
Enter sys/<password> as SYSDBA and
click Login.
2.
Click the Administration tab.
3.
Click Tables.
4.
Enter HR for the Schema and click GO.
5.
Click the Recycle Bin link.
6.
Enter the HR schema and click GO.
7.
You notice that the table you dropped is listed. Click
View Content.
8.
You see the contents of the table you dropped. Click
OK.
At some point, you may want to permanently remove the object
from the database and release the space allocated to it after you have dropped
the object. To remove an object from the recycle bin, perform the following:
1.
Select the radio button in front of the JOBS_HIST
table and click Delete.
2.
Click Yes to confirm deletion.
3.
Click the Recycle Bin link.
4.
Enter the HR schema and click GO.
5.
In the recycle bin, select the checkbox next to the
JOBS_HIST object and click Purge.
6.
Click Yes to confirm deletion.
7.
The table has been purged from the recycle bin. Click
your Tables breadcrumb. .
Using Flashback Versions Query to Recover
a Table to a Point in Time
In Oracle9i,
Flashback Query was introduced. This feature provides a way for you to view
and repair historical data. You can perform queries on the database as of a
certain wall clock time or user-specified system change number (SCN).
In Oracle Database
10G, Flashback functionality has been expanded. You can use the VERSIONS
BETWEEN clause to retrieve all of the versions of the rows that exist
or ever existed between the time the query was issued and a point back in time.
This type of query is referred to as a Flashback Versions Query.
The rows returned by the Flashback Versions Query are a history
of changes of the rows across transactions.
The Flashback Versions Query retrieves all committed occurrences
of the rows. Changes made by the current active transaction are not returned.
In other words, uncommitted row versions within a transaction will not be shown.
You can use Flashback Versions Query to retrieve row history.
It provides you with a way to audit the rows of a table and retrieve information
about the transactions that changed the rows. You can use the transaction ID
obtained from Flashback Versions Query to perform transaction mining using LogMiner
or Flashback Transaction Query to obtain additional information about the transaction.
You must first enable row movement on the table you want to
perform flashback table on.Enabling row movement lets you specify whether Oracle
can move a table row. It is possible for a row to move, for example, during
table compression or an update operation on partitioned data. Perform the following:
1.
Switch to your Enterprise Manager browser session, click
on the JOBS table.
2.
Select the Options tab.
3.
Select Yes for Enable Row Movement and click
Apply.
4.
Now you can perform a flashback table. Click the Tables
breadcrumb.
Recover the JOBS Table to a Particular
Point in Time