11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>11</strong>6 CHAPTER 3 ■ DATABASE ADMINISTRATIONThe two key parameters are quota, which determines the amount of space in a tablespacethat the flashback data archive can use, and retention, which determines how long the historicaldata is retained in the archive before the database automatically purges it (you can alsomanually purge the historical data). Here’s an example that shows how to create a flashbackdata archive in the tablespace flash_tbs1:SQL> create flashback data archive flash1tablespace flash_tbs1retention 4 year;Flashback Data Archive created.SQL>The retention 4 year clause means the flashback data archive flash1 will retain data upfor a period of four years. Note that there is no quota clause in the create flashback data archivestatement, meaning the archive can take up all the space available in the tablespace flash_tbs1.You can limit the amount of space the flashback data archive takes up in a tablespace byspecifying a value for the quota clause, as shown in the following example:SQL> create flashback data archive flash1tablespace flash_tbs1quota 2000mretention 4 year;Flashback Data Archive created.SQL>The amount of space you must allocate for a flashback data archive will depend on theamount of transactions in the tables you’re archiving and the duration of the archiving retentionperiod. Before the flashback data archive uses up its allotted quota or, in the absence of aquota clause, before the archive uses up the entire tablespace, <strong>Oracle</strong> issues an out-of-spacealert for the flashback data archive. This gives you time to purge older data in the archive orincrease the tablespace quota or add more datafiles to the tablespace housing the flashbackdata archive, depending on the case.■Note To enable flashback historical tracking for a table, the user must have the flashback archiveobject privilege on the flashback data archive that you want to use for that table.You can drop a flashback data archive by using the drop flashback archive command:SQL> drop flashback archive flash1;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!