Sie sind auf Seite 1von 8

FLASHBACK TABLE

Purpose: Use the FLASHBACK TABLE statement to restore an earlier state of a table in the event of human or application error. The time in the past to which the table can be flashe bac! is epen ent on the amount of un o ata in the s"stem. Also# $racle %atabase cannot restore a table to an earlier state across an" %%L operations that chan&e the structure of the table. Prerequisites: To perform flashbac! table# User nee to share the timestamp an con itions etails. To flash bac! a table to an earlier timestamp# "ou must have either the FLASHBACK ob'ect privile&e on the table or the FLASHBACK A() TABLE s"stem privile&e. *n a ition# "ou must have the SELECT# *(SE+T# %ELETE# an ALTE+ ob'ect privile&es on the table. +ow movement must be enable for all tables in the Flashbac! list unless "ou

are flashin& bac! the table T$ BEF$+E %+$,. That operation is calle a flashbac! rop operation# an it uses roppe ata in the rec"clebin rather than un o ata. +efer to row-movement-clause for information on enablin& row movement. Restrictions on Flashing Back Tables: Flashbac! Table operations are not vali for the followin& t"pe ob'ects. tables that are part of a cluster# materiali/e views# A vance 0ueuin& 1A02 tables# static ata ictionar" tables# s"stem tables# remote tables# ob'ect tables# neste tables# or in ivi ual table partitions or subpartitions. The followin& %%L operations chan&e the structure of a table# so that "ou cannot subse3uentl" use the T$ SC( or T$ T*4ESTA4, clause to flash the table bac! to a time prece in& the operation. up&ra in&# movin&# or truncatin& a table5 a in& a constraint to a table# a in& a table to a cluster5 mo if"in& or roppin& a column5 chan&in& a column encr"ption !e"5 a in&# roppin&# mer&in&# splittin&# coalescin&# or truncatin& a partition or subpartition 1with the e6ception of a in& a ran&e partition2.

Step !: Chec! the atabase in flashbac! enable.

Step ": Create a table FLASH un er pushpara'v user# *nsert 7 recor s. An Chec! the time stamp etails. S3l8 alter session set nls- ate-format 9 :mm; ;"""" hh<=.mi.ss:5

Step #: %elete some ata an commit the flash table.

Step $: A itionl" we have inserte the recor # Currentl" we have > recor s in FLASH table.

Step %: * entif"in& transactions etails for FLASH table with timestamp. set linesize 512 col versions_starttime for a25 col versions_endtime for a25 col versions_xid for a45 select versions_starttime, versions_endtime, versions_xid,versions_operation, PINCODE from flas versions !et"een timestamp minval#e and maxval#e

order !$ %E&'ION'_'()&((I*E+ ? column-name etails. % @ %elete statement. * @ *nsert statement.

Step &: Before &oin& to start the flashbac! recover" nee the timestamp etail to &et the timestamp etail use the below 3uer". AB. FLASH table creation with 7 recor etails with timstamp. SELECT C F+$4 FLASH AS $F T*4ESTA4, T$-T*4ESTA4,1:BD@EF@<EB= BB.G<.B<:#:%%@44@)))) HH<=.4*.SS:25

A<. FLASH table elete with = recor s. SELECT C F+$4 FLASH AS $F T*4ESTA4, T$-T*4ESTA4,1:BD@EF@<EB= BB.GF.=H:#:%%@44@)))) HH<=.4*.SS:25

AF. Timestamp with > recor s etails.

SELECT C F+$4 FLASH AS $F T*4ESTA4, T$-T*4ESTA4,1:BD@EF@<EB= BB.GG.=7:#:%%@44@)))) HH<=.4*.SS:25

Step & Usin& S)S use chec! the FLASH table row movement enable for pushpara'v user.

Step ': Irant flashbac! privile &e for ,ushpara'v user.

Step (: Table enable row movement e6ecute shoul particular user.

Step ): Acuall table recor .

Step !*: Usin& S)S USE+ flash the bac! to JBD@EF@<EB= BB.GF.=HK timestamp.

+n,o a -R.P TABLE .peration using FLASH BACK


Step !: Create a table FLASH-%+$, from FLASH.

Step ": %rop the table flash- rop.

Step #: %rop table information in rec"cle bin.

Step $: Flash the flash- rop table from rec"vle bin.

(ote . *f "ou use the pur&e comman in the 3uer" the the flashbac! etail not available in the rec"clebin table. *n this case we canLt o the flashbac! for the table.

Das könnte Ihnen auch gefallen