Overview of Oracle Flashback Query II (367)

tsinglee發表於2007-12-14

You set the date and time you want to view. Then, any SQL query you run operates on
data as it existed at that time. If you are an authorized user, then you can correct
errors and back out the restored data without needing the intervention of an
administrator.

With the AS OF SQL clause, you can choose different snapshots for each table in the
query. Associating a snapshot with a table is known as table decoration. If you do not
decorate a table with a snapshot, then a default snapshot is used for it. All tables
without a specified snapshot get the same default snapshot.

For example, suppose you want to write a query to find all the new customer accounts
created in the past hour. You could do set operations on two instances of the same
table decorated with different AS OF clauses.

DML and DDL operations can use table decoration to choose snapshots within
subqueries. Operations such as INSERT TABLE AS SELECT and CREATE TABLE AS
SELECT can be used with table decoration in the subqueries to repair tables from
which rows have been mistakenly deleted. Table decoration can be any arbitrary
expression: a bind variable, a constant, a string, date operations, and so on. You can
open a cursor and dynamically bind a snapshot value (a timestamp or an SCN) to
decorate a table with.

Oracle閃回查詢II
1. 可以使用as of子句為每張表選擇不同的快照 , 可被認為是表裝飾
2. DML 及 DDL 操作可以在其子查詢中使用表修飾來選擇快照.
INSERT TABLE AS SELECT 及 CREATE TABLE AS SELECT 操作可以用於恢復誤刪除的資料

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-993546/,如需轉載,請註明出處,否則將追究法律責任。

相關文章