Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oracle Database 11g.pdf
Скачиваний:
78
Добавлен:
10.06.2015
Размер:
12.69 Mб
Скачать

390  Chapter 9  n  Understanding Flashback Technology

Monitoring the Flashback Data Archive

The Flashback Data Archiver process, FBDA, archives the historical rows of tables enabled for archiving to the Flashback Data Archive. FBDA writes a pre-image of a row and metadata on current rows into the flashback archive when a transaction that changes data commits. FBDA manages the Flashback Data Archive retention and space.

Several views are available for monitoring the Flashback Data Archive. See Table 9.5 for an description of the views.

Ta b l e 9 . 5   ​  Flashback​ Data Archive Views

View Name

Description

 

 

DBA_FLASHBACK_ARCHIVE

Information about Flashback Data Archive

DBA_FLASHBACK_ARCHIVE_TS

Tablespaces used for Flashback Data Archive

DBA_FLASHBACK_ARCHIVE_TABLES

Tables that are enabled for archive

 

 

Summary

In this chapter, you learned about Flashback technologies and their dependence on Oracle’s undo functionality. You learned about Automatic Undo Management (AUM) and how it aids the DBA in managing undo information.

We discussed the Recycle Bin in detail, and you learned how dropped objects are moved to the Recycle Bin. We showed you how to query the contents of the Recycle Bin and how to recover objects using the Flashback Drop feature.

Next, you learned about Flashback Query and its ability to show you data as it appeared at a specific time in the past.

The next section discussed the Flashback Versions Query, which retrieves all versions of the rows that existed between two specific points in time.

You then used the Flashback Transaction Query to view transactional changes in data. You saw examples of how you can use this tool to perform transactional analysis, including producing SQL statements that will undo the transaction.

You used Flashback Table to recover a table to a specific point in time without performing an incomplete recovery. You also learned how all dependent objects are recovered when using Flashback Table.

The Flashback Database is best used to recover from logical corruption and user error. This is an alternative to incomplete recovery or the Log Miner utility. The Flashback Database can be enabled and configured fairly easily. You must have the flash recovery area enabled to implement the Flashback Database.

Exam Essentials 

391

The last Flashback technology discussed in this chapter was the Flashback Data Archive, which Flashback Data Archive can be used to track all DML changes to a table and keep the changes for a specific retention period.

Exam Essentials

Know how to restore dropped tables from the Recycle Bin.  ​Make sure that you understand how the Recycle Bin handles dropped objects. You should be able to locate objects in the Recycle Bin. You should be able to perform a Flashback Drop recovery of a dropped object.

Know how to perform a Flashback query.  ​  ​You must understand how Flashback Query works. Know which options are available in the AS OF clause (timestamp and SCN). Be able to execute a Flashback query and understand what the results represent.

Know how to use Flashback Transaction Query.  ​  Know​ how to use Flashback Transaction Query to expose transactional information relating to changes in the database. Be sure that you are familiar with the contents of the FLASHBACK_TRANSACTION_QUERY view. Be able to access the undo SQL required to roll back a transaction.

Understand how to perform Flashback Table operations.  ​  ​Understand the basics of how Flashback Table works. Know how to perform a Flashback Table operation with a timestamp or an SCN. Be aware of how undo data is used in Flashback Table and how to protect this data.

Understand the Flashback Database architecture.  ​  Make​ sure you are aware of the components that make up the Flashback Database architecture. Understand the Flashback Database logs and RVWR background-process functionality.

Understand how to enable and disable the Flashback Database.  ​  ​Know how to configure the Flashback Database. Understand the flash recovery area and how it is configured.

Know how to monitor the Flashback Database.  ​  Know​ the dynamic views that monitor the Flashback Database. Understand what each view contains.

Know how to create and use a Flashback Data Archive.  ​  ​Know the syntax to create a Flashback Data Archive in a tablespace, alter the storage and retention parameters, purge and drop, archive a table, and query the results.

392  Chapter 9  n  Understanding Flashback Technology

Review Questions

1.Which of the following Oracle features utilize the undo tablespace? (Choose all that apply)

A.Flashback Query

B.Flashback Drop

C.Flashback Table

D.Flashback Database

E.Transaction Processing

F.Recycle Bin

2.Which of the following statements are true regarding the Recycle Bin? (Choose all that apply.)

A.The Recycle Bin is a physical storage area for dropped objects.

B.The Recycle Bin is a logical container for dropped objects.

C.The Recycle Bin stores the results of a Flashback Drop operation.

D.The objects in the Recycle Bin are stored in the tablespace in which they were created.

3.Over the course of a day, a department performed multiple DML statements (inserts, updates, deletes) on multiple rows of data in multiple tables. The manager would like a report showing the time, table name, and DML type for all changes that were made. Which Flashback technology would be the best choice to produce the list?

A.Flashback Drop

B.Flashback Query

C.Flashback Transaction Query

D.Flashback Versions Query

E.Flashback Table

4.A user named Arren is executing this query:

select table_name, operation, undo_sql from

flashback_transaction_query t, (select versions_xid as xid

from employees versions between scn minvalue and maxvalue

where employee_id = 123) e where t.xid = e.xid;

When the query runs, he receives an ORA-01031: insufficient privileges error. Since the user owns the employees table, you know that it is not the problem. Which of the following SQL statements will correct this problem?

Review Questions 

393

A.GRANT SELECT ANY TRANSACTION TO ARREN;

B.GRANT SELECT ON FLASHBACK_TRANSACTION_QUERY TO ARREN;

C.GRANT SELECT_ANY_TRANSACTION TO ARREN;

D.GRANT FLASHBACK TO ARREN;

E.GRANT SELECT ANY VIEW TO ARREN;

5.AUM has been retaining about 15 minutes’ worth of undo. You want to double the retention period, but not at the expense of new transactions failing. You decide to alter the system to set the parameter UNDO_RETENTION=18000. However, AUM still retains only about 15 minutes’ worth of undo. What is the problem? (Choose the best answer.)

A.You need to alter the undo tablespace to add the RETENTION GUARANTEE setting.

B.You need to increase the size of the undo tablespace.

C.The undo tablespace is not set to auto-extend.

D.You need to alter the Recycle Bin to add the RETENTION GUARANTEE setting.

6.In order to perform Flashback Transaction Query operations, which of these steps are required? (Choose all that apply.)

A.Ensure that database is running with version 10.1 compatibility.

B.Enable Flashback Logging.

C.Enable Supplemental Logging.

D.Ensure that the database is running with version 10.0 compatibility.

E.Ensure that the database is in ARCHIVELOG mode

7.Users notify you that their application is failing every time they try to add new records. Because of poor application design, the actual ORA error message is unavailable. What might be the problem? (Choose the best answers.)

A.The application user has exceeded their undo quota.

B.The FLASHBACK GUARANTEE option is set on the undo tablespace.

C.The table is currently being queried by a Flashback Transaction Query operation.

D.The table is currently being queried by a Flashback Versions Query operation.

E.The RETENTION GUARANTEE option is set on the undo tablespace.

8.Which of the following statements best describes Flashback Versions Query?

A.Flashback Versions Query is used to make changes to multiple versions of data that existed between two points in time.

B.Flashback Versions Query is used to view all version changes on rows that existed between the time the query was executed and a point in time in the past.

C.Flashback Versions Query is used to view version changes and the SQL to undo those changes on rows that existed between two points in time.

D.Flashback Versions Query is used to view all version changes on rows that existed between two points in time.

394  Chapter 9  n  Understanding Flashback Technology

9.Which pseudocolumn could you use to identify a unique row in a Flashback Versions Query?

A.XID

B.VERSIONS_PK

C.VERSIONS_XID

D.VERSIONS_UNIQUE

10.Which of the following can be used in conjunction with a Flashback Versions Query to filter the results? (Choose all that apply.)

A.A range of SCN values

B.A list of SCN values

C.A starting and ending timestamp

D.Minimum and maximum sequence values

E.A list of sequence values

11.At the request of a user, you issue the following command to restore a dropped table:

flashback table “BIN$F2JFfMq8Q5unbC0ceE9eJg==$0” to

before drop; Later, the user notifies you that the data in the table seems to be very old and out of date. What might be the problem?

A.Because a proper range of SCNs was not specified, the wrong data was restored.

B.A proper range of timestamps was not specified, so the wrong data was restored.

C.A previous Flashback Drop operation had been performed, resulting in multiple versions of the table being stored in the Recycle Bin.

D.Either option A or B could be correct. Not enough information was provided to determine which.

E.None of the above.

12.Which of the following statements is true regarding the VERSIONS BETWEEN clause?

A.The VERSIONS BETWEEN clause may be used in DML statements.

B.The VERSIONS BETWEEN clause may be used in DDL statements.

C.The VERSIONS BETWEEN clause may not be used to query past DDL changes to tables.

D.The VERSIONS BETWEEN clause may not be used to query past DML statements to tables.

13.Which of the following statements is true regarding implementing a Flashback Table recovery?

A.An SCN is never used to perform a Flashback Table recovery.

B.If a significant number of changes have been made to the table, row movement must be enabled.

C.The tablespace must be offline before performing a Flashback Table recovery.

D.Flashback Table recovery is completely dependent on the availability of undo data in the undo tablespace.

Review Questions 

395

14.You have just performed a FLASHBACK TABLE operation using the following command:

flashback table employees to scn 123456;

The employees table has triggers associated with it. Which of the following statements is true regarding the state of the triggers during the Flashback Table operation?

A.All the triggers are disabled.

B.All the triggers are enabled by default.

C.Enabled triggers remain enabled and disabled triggers remain disabled.

D.Triggers are deleted when a Flashback Table operation is performed.

15.Which method could be utilized to identify both DML operations and the SQL statements needed to undo those operations for a specific schema owner? (Choose all that apply.)

A.Query DBA_TRANSACTION_QUERY for TABLE_NAME, OPERATION, and UNDO_SQL. Limit rows by START_SCN and TABLE_OWNER.

B.Query FLASHBACK_TRANSACTION_QUERY for TABLE_NAME, OPERATION, and UNDO_SQL. Limit rows by START_SCN and TABLE_OWNER.

C.Query FLASHBACK_TRANSACTION_QUERY for TABLE_NAME, OPERATION, and UNDO_SQL. Limit rows by START_TIMESTAMP and TABLE_OWNER.

D.Query DBA_TRANSACTION_QUERY for TABLE_NAME, OPERATION, and UNDO_SQL. Limit rows by START_SCN and TABLE_OWNER.

16.Flashback Database relies on which technologies to recover to a point in time?

A.Flashback Data Archive

B.Flashback logs in the flash recovery area

C.Undo tablespace

D.RMAN command line

E.None of the above

17.The _______ writes the Flashback Database logs in the flash recovery area.

A.FLSH

B.FLDB

C.RVWR

D.RVRW

E.FBDA

396  Chapter 9  n  Understanding Flashback Technology

18.Which of these are valid Flashback Database recovery point parameters? (Choose all that apply.)

A.SCN

B.Timestamp

C.Named recovery point

D.Transaction ID

E.Session ID

19.When setting up the Flashback Data Archive, which of these key parameters are required? (Choose all that apply.)

A.Tablespace name

B.Storage quota

C.Retention

D.Table name

E.Create a default archive

20.To clean up old records that are in a Flashback Data Archive and are past the retention period, what must the DBA do?

A.TRUNCATE the archive table.

B.DROP the Flashback Data Archive.

C.Nothing; expired rows are automatically removed.

D.Nothing; expired rows are moved to an archive table.

E.Delete entries from the archive where the metadata date retained is greater than the retention period.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]