Beruflich Dokumente
Kultur Dokumente
Performing Flashback
Objectives
After completing this lesson, you should be able to:
Describe Flashback Database
Restore the table content to a specific point in the
past with Flashback Table
Recover from a dropped table
View the contents of the database as of any single
point in time with Flashback Query
See versions of a row over time with Flashback
Versions Query
View transaction history or a row with Flashback
Transaction Query
17-2
> Overview
Database
Table
Drop
Query
Versions
Transaction
Flashback is fast.
Changes are indexed by row and by transaction.
Only the changed data is restored.
17-3
Uses
Affects
Data
Database
Truncate table;
Undesired multitable
changes made
Database
Flashback
logs
True
Table
Drop table
Drop
Recycle bin
True
Table
Undo data
True
Query
Undo data
False
Compare versions of a
row
Version
Undo data
False
Investigate several
historical states of data
Transaction
Undo data
False
Tx
17-4
Scenario Examples
Flashback
Technology
17-5
Overview
> Database
Table
Drop
Query
Versions
Transaction
Users
generate
errors.
17-6
The
database is
corrupted.
The
database is
rewound.
Flashback Database:
Reducing Restore Time
Incomplete Recovery
Restore files
Generate logs
User error
Backup
Flashback Database
Flashback logs
Backup
17-7
User
error
Apply logs
forward
Repaired
database
Apply Flashback
logs backward
Copyright 2005, Oracle. All rights reserved.
Repaired
database
17-8
Flashback
target time
17-9
Drop
tablespace.
Shrink data
file.
Re-create
control file.
Present
17-10
Erroneous
DMLs
17-11
User
Overview
Database
> Table
Drop
Query
Versions
Transaction
Flashed back
tables
Flashback Table
17-12
17-13
17-16
Recycle
Bin
17-17
FLASHBACK TABLE
employees
TO BEFORE DROP;
Overview
Database
Table
> Drop
Query
Versions
Transaction
17-18
17-19
Flashback Query
Overview
Database
Table
Drop
> Query
Versions
Transaction
Time
Tx3
Tx2
Tx1
17-20
Flashback
Employees
Unwanted
updates
Employees
t1
SELECT employee_id, salary FROM employees
AS OF TIMESTAMP t1
WHERE employee_id = 200
17-21
t2
Employees
Employees
Employees
salary = 4,400
salary = 4,840
salary = 4,400
11:00
11:10
17-22
Tx1
Employees
Tx2
Employees
Overview
Database
Table
Drop
Query
> Versions
Transaction
Employees
200
t1
t2
17-23
Tx1
Tx2
17-24
17-25
External tables
Temporary tables
Fixed tables
Views
DBA
Erroneous
DML
Undo
SQL
User
17-26
Overview
Database
Table
Drop
Query
Versions
> Transaction
17-27
17-28
Summary
In this lesson, you should have learned how to:
Describe Flashback Database
Restore the table content to a specific point in the
past with Flashback Table
Recover from a dropped table
View the contents of the database as of any single
point in time with Flashback Query
See versions of a row over time with Flashback
Versions Query
View transaction history or a row with Flashback
Transaction Query
17-29
Practice Overview:
Using Flashback
This practice covers the following topics:
Using Flashback to recover a dropped table
Performing Flashback Versions Query
17-30