FLASH BACK
- overview of different flashback technologies
- flashback query(including flashback query, flashback version query , flashback transaction, flashback table)
- flashback drop
- flashback database
- flashback data archive
overview of different flashback technologies
Firstly this chapter is writen based on oracle 11g 11.0.2.3. Ok. Flashback technology in oracle 11g including four different kinds of technologies. They are falshback database,falshback drop, falshback query(which including four variations ——flashback query,flashback version query,flashback transaction, flashback table) and flashback data archive. Flashback data archive is a new feature in 11g.
Firstly we see the flashback query. Flashback query is based on the undo segments. With flashback query we can query the database as if it was at some time in the past. We can select all versions of a row over a period of time, to show a history of what has happened to the row, when it happened, who did it, and the identifiers of the transactions that made each change. All these informations comes from the undo. Once you use the flashback query identifiy which transaction made those changes, you can use the flashback transaction feature to construct another transaction to reverse those changes. We can say the flashback transaction is a variation of flashback query. The other variation of flashback query is flashback table. With flashback table feature, you can specify some table to make them recover to a certain point of time.
Now we know if we did some logical error like wrongly delete,update or insert some values and commited. We can use the flashback query (and it`s different variations) to easily recover. As long as the undo is exist. But what if we accidently drop the table? DDL is no a transaction. It won`t have before image in the undo segment. So you can not use flashback to recover a drop table statement. Here we need the flashback drop feature. flashback drop can revert the drop table statement. the corresponding index, permissions are also restored.
The wrong dml we can use flashback query to restore. The wrongly drop table can be restored by flashback drop. What if we wrongly drop a schema? We can use flashback database. Flashback database is a faster version of incomplete recovery. So whenever you want use incomplete recover, you can use flashback recovery.
Flashback data archive is a new feature in 11g. The flashback query is based on undo, flashback drop is possible only if the tablespace disk space is not reused, flashback database is based on flasback log. But with proper configuration, flashback data archive can restore data years ago.
flashback query
Flashback query has 4 variations.
- Basic flashback query
- flashback version query
- flashback transaction
- flashback table.
Basic flashback query do not need any configuration. here is an example for basic flashback query.
SQL> select to_char(sysdate,'dd-mm-yy hh24:mi:ss') as time from dual; TIME
-----------------
04-09-13 13:28:13 SQL> select * from test where empno=7844; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 SQL> update test set sal=10000 where empno=7844; 1 row updated. SQL> commit; Commit complete. SQL> select * from test where empno=7844; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7844 TURNER SALESMAN 7698 08-SEP-81 10000 0 30
Here we can see the salary for empno=7844 is 1500 at 13:28:13. Then we did an update make the sal=10000 and commit. Now we are going to use basic flashback to check what is the row looks like in the past time which is 13:28:13.
SQL> select * from test as of timestamp to_timestamp('04-09-13 13:28:13','dd-mm-yy hh24:mi:ss') where empno=7844 ; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
We can see the sal is 1500. So we managed to find what the value looks like in the past time.
We can even set the whole session back in to some point of time. Here is another example:
SQL> exec dbms_flashback.enable_at_time(to_timestamp('04-09-13 13:28:13','dd-mm-yy hh24:mi:ss')); PL/SQL procedure successfully completed. SQL> select * from test where empno=7844; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
Flashback query can not work in sys schema, also you can not do any dml if you use the dbms_flashback to set the session is some old point of time. If you use scn the point to which the flashback goes is precise, if you use a time, then it will be mapped to a scn with 3 seconds precision.
Flashback version query is an enhanced feature. A row may be updated many times,Flashback Versions Query lets you see all the committed versions of a row (but not any uncommitted versions), including the timestamps for when each version was created and when it ended.You can also see the transaction identifier of the transaction that created any given version of a row, which can then be used with Flashback Transaction Query. This information is exposed by a number of pseudocolumns that are available with every table. The pseudocolumns relevant to flashback are
• VERSIONS_STARTSCN The SCN at which this version of the row was created, either by INSERT or by UPDATE
• VERSIONS_STARTTIME The timestamp at which this version of the row was created
• VERSIONS_ENDSCN The SCN at which this version of the row expired, because of either DELETE or UPDATE
• VERSIONS_ENDTIME The timestamp at which this version of the row expired
• VERSIONS_XID The unique identifier for the transaction that created this version of the row
• VERSIONS_OPERATIONS The operation done by the transaction to create this version of the row, either INSERT or UPDATE or DELETE
To see these pseudocolumns, you must include the VERSIONS BETWEEN keywords in your query. For example:
We did a few more dml on the table test where empno=7844
SQL> update test set sal=2000 where empno=7844; 1 row updated. SQL> commit; Commit complete. SQL> delete from test where empno=7844; 1 row deleted. SQL> commit; Commit complete.
These operation will be traced with the flashback version query.
SQL> select empno,sal,versions_xid,versions_starttime,versions_endtime,versions_operation from test versions between scn minvalue and maxvalue
2 where empno=7844; EMPNO SAL VERSIONS_XID VERSIONS_STARTTIME VERSIONS_ENDTIME V
---------- ---------- ---------------- ------------------------------------------------ ------------------------------------------------ -
7844 2000 04001F001C1C0000 04-SEP-13 02.27.21 PM D
7844 2000 07000200E91C0000 04-SEP-13 02.26.39 PM 04-SEP-13 02.27.21 PM U
7844 10000 04-SEP-13 02.26.39 PM
Here we use two constants for the SCN. MINVALUE instructs Oracle to retrieve the earliest information in the undo segments; MAXVALUE will be the current SCN. We can also use timestamp as below.
SQL> create table test as select * from emp; Table created. SQL> select * from test where empno=7844; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as time from dual; TIME
-------------------
2013-09-04 14:53:34 SQL> update test set sal=10000 where empno=7844; 1 row updated. SQL> commit; Commit complete. SQL> update test set sal=20000 where empno=7844; 1 row updated. SQL> commit; Commit complete. SQL> delete from test where empno=7844; 1 row deleted. SQL> commit; Commit complete. SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as time from dual; TIME
-------------------
2013-09-04 14:54:34 SQL> select empno,sal,versions_xid,versions_starttime,versions_endtime,versions_operation
2 from test versions between scn minvalue and maxvalue
3 where empno=7844; EMPNO SAL VERSIONS_XID VERSIONS_STARTTIME VERSIONS_ENDTIME V
---------- ---------- ---------------- ------------------------------------------------ ------------------------------------------------ -
7844 20000 04001500161C0000 04-SEP-13 02.54.25 PM D
7844 20000 03002000E71C0000 04-SEP-13 02.54.07 PM 04-SEP-13 02.54.25 PM U
7844 10000 05000B00B11C0000 04-SEP-13 02.53.55 PM 04-SEP-13 02.54.07 PM U
7844 1500 04-SEP-13 02.53.55 PM SQL> select empno,sal,versions_xid,versions_starttime,versions_endtime,versions_operation
2 from test versions between timestamp to_timestamp('04-09-13 14:53:34','dd-mm-yy hh24:mi:ss') and to_timestamp('04-09-13 14:54:34','dd-mm-yy hh24:mi:ss')
3 where empno=7844; EMPNO SAL VERSIONS_XID VERSIONS_STARTTIME VERSIONS_ENDTIME V
---------- ---------- ---------------- ------------------------------------------------ ------------------------------------------------ -
7844 20000 04001500161C0000 04-SEP-13 02.54.25 PM D
7844 20000 03002000E71C0000 04-SEP-13 02.54.07 PM 04-SEP-13 02.54.25 PM U
7844 10000 05000B00B11C0000 04-SEP-13 02.53.55 PM 04-SEP-13 02.54.07 PM U
7844 1500 04-SEP-13 02.53.55 PM
Flashback Version Query cannot work against external tables, temporary tables, or V$ views. Why not? Because none of these objects generates undo.
Flashback transaction include two very useful feature. Check the past transactions (you need to enable supplemental logging for this feature)and revert the commited transactions(you need to enable the supplemental logging and archive log). To check the past transactions information you need to check the view flashback_transaction_query.
SQL> desc flashback_transaction_query
Name Null? Type
----------------------------------------- -------- ----------------------------
XID RAW(8)
START_SCN NUMBER
START_TIMESTAMP DATE
COMMIT_SCN NUMBER
COMMIT_TIMESTAMP DATE
LOGON_USER VARCHAR2(30)
UNDO_CHANGE# NUMBER
OPERATION VARCHAR2(32)
TABLE_NAME VARCHAR2(256)
TABLE_OWNER VARCHAR2(32)
ROW_ID VARCHAR2(19)
UNDO_SQL VARCHAR2(4000)
Because this view contains important information, you need to be granted select any transaction privilege to check it. There will be one or more rows in this view for every transaction whose undo data still exists in the undo segments, and every row will refer to one row affected by the transaction. The table that follows describes the columns.
- XID The transaction identifier. This is the join column to the pseudocolumn
- VERSIONS_XID displayed in a Flashback Versions Query
- START_SCN The system change number at the time the transaction started
- START_TIMESTAMP The timestamp at the time the transaction started
- COMMIT_SCN The system change number at the time the transaction was committed
- COMMIT_TIMESTAMP The timestamp at the time the transaction was committed
- LOGON_USER The Oracle username of the session that performed the transaction
- UNDO_CHANGE# The undo system change number. This is not likely to be relevant to most work
- OPERATION The DML operation applied to the row: INSERT, UPDATE, or DELETE
- TABLE_NAME The table to which the row belongs
- TABLE_OWNER The schema to which the table belongs
- ROW_ID The unique identifier of the row affected
- UNDO_SQL A constructed statement that will reverse the operation. For example, if the OPERATION were a DELETE, then this will be an INSERT
The view will show committed transactions and also transactions in progress. For an active transaction, the COMMIT_SCN and COMMIT_TIMESTAMP columns are NULL.
Let`s see an example.
SQL> update test set ename='KRAMER' where empno=7566; 1 row updated. SQL> COMMIT; Commit complete. SQL> update test set sal=99999 where empno=7566; 1 row updated. SQL> commit; Commit complete.
We have run two transactions. Then we use flashback version query to see the xid.
SQL> select empno,ename,sal,versions_xid from test versions between scn minvalue and maxvalue where empno=7566; EMPNO ENAME SAL VERSIONS_XID
---------- ---------- ---------- ----------------
7566 KRAMER 99999 02002100D71C0000
7566 KRAMER 2975 03001200EF1C0000
7566 JONES 2975
Then we use the xid to check the view flashback_transaction_query. But here we have one thing to notice. The xid in flashback_transaction_query is raw type but the versions_xid is hexadecimal. So we have to use type casting function.
SQL> select xid,undo_sql from flashback_transaction_query where xid=hextoraw('02002100D71C0000'); XID UNDO_SQL
---------------- ------------------------------------------------------------------------------------
02002100D71C0000
02002100D71C0000
oh.. nothing found. I dont know where i did wrong so I went to the internet did a few search. It is said we have to enable supplemental logging..
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; Database altered.
SQL> update test set ename='kramer' where empno=7566; 1 row updated. SQL> commit; Commit complete. SQL> update test set sal=10000 where empno=7566; 1 row updated. SQL> commit; Commit complete.
Then check the transaction id again
SQL> select empno,ename,sal,versions_xid from test versions between scn minvalue and maxvalue where empno=7566; EMPNO ENAME SAL VERSIONS_XID
---------- ---------- ---------- ----------------
7566 kramer 10000 09000F00C31C0000
7566 kramer 99999 08002100C01C0000
7566 KRAMER 99999 04000100281C0000
7566 KRAMER 2975 06001000C31C0000
7566 JONES 2975
check the view flashback_transaction_query
SQL> set linesize 180
SQL> select xid,undo_sql from flashback_transaction_query where xid=hextoraw('08002100C01C0000'); XID UNDO_SQL
---------------- ------------------------------------------------------------------------------------
08002100C01C0000 update "SCOTT"."TEST" set "ENAME" = 'KRAMER' where ROWID = 'AAAVXPAAEAAAAIbAAD';
08002100C01C0000 SQL> select xid,undo_sql from flashback_transaction_query where xid=hextoraw('06001000C31C0000'); XID UNDO_SQL
---------------- ------------------------------------------------------------------------------------
06001000C31C0000
06001000C31C0000
This time we succeed. Also note that the transaction before enable supplemental logging still can not check undo_sql.
Besides check the transaction information, we can also revert the transaction with dbms_flashback package as below.
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; Database altered. SQL> conn scott
Enter password:
Connected.
SQL> drop table test; Table dropped. SQL> create table test as select * from emp; Table created. SQL> set linesize 180
SQL> update test set ename='kramer' where empno=7844; 1 row updated. SQL> commit; Commit complete. SQL> update test set sal=99999 where ename='kramer'; 1 row updated. SQL> commit; Commit complete. SQL> select empno,ename,sal,versions_xid from test versions between scn minvalue and maxvalue where versions_xid is not null; EMPNO ENAME SAL VERSIONS_XID
---------- ---------- ---------- ----------------
7844 kramer 99999 08001900C21C0000
7844 kramer 1500 02000100D41C0000 SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@racnode1 nfsdg1]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 4 16:37:47 2013 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options SQL> execute dbms_flashback.transaction_backout(numtxns=>2,xids=>sys.xid_array('08001900C21C0000','02000100D41C0000'),options=>dbms_flashback.cascade);
BEGIN dbms_flashback.transaction_backout(numtxns=>2,xids=>sys.xid_array('08001900C21C0000','02000100D41C0000'),options=>dbms_flashback.cascade); END; *
ERROR at line 1:
ORA-55510: Mining could not start
ORA-06512: at "SYS.DBMS_FLASHBACK", line 37
ORA-06512: at "SYS.DBMS_FLASHBACK", line 70
ORA-06512: at line 1
Check through the internet found below infor
// *Cause: Mining could not start for the following reasons.
// 1. A logminer session was processing
// 2. The database was not mounted or not opened for read and write
// 3. Minimum supplemental logging was not enabled
// 4. Archiving was not enabled
// *Action: Fix the mentioned problems and try again. Note that if
// you enable supplemental logging now, you will not be able to
// remove a transaction that has committed without supplemental
// logging.
It seems i need to enable archive log. Ok I will do another test
[oracle@racnode1 nfsdg1]$ srvctl stop database -d orcl
[oracle@racnode1 nfsdg1]$ srvctl start database -d orcl -o mount
[oracle@racnode1 nfsdg1]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 4 16:51:25 2013 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options SQL> alter database archivelog; Database altered. SQL> alter database open; Database altered. SQL> drop table test; Table dropped. SQL> create table test as select * from emp; Table created. SQL> update test set ename='kramer' where empno=7844; 1 row updated. SQL> commit; Commit complete. SQL> update test set sal=99999 where ename='kramer'; 1 row updated. SQL> commit; Commit complete. SQL> select empno,ename,sal,versions_xid from test versions between scn minvalue and maxvalue where versions_xid is not null; EMPNO ENAME SAL VERSIONS_XID
---------- ---------- ---------- ----------------
7844 kramer 99999 05000200B31C0000
7844 kramer 1500 07001B00F61C0000 SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@racnode1 nfsdg1]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 4 16:55:10 2013 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options SQL> execute dbms_flashback.transaction_backout(numtxns=>2,xids=>sys.xid_array('05000200B31C0000','07001B00F61C0000'),options=>dbms_flashback.cascade); PL/SQL procedure successfully completed.
This time we succeed. So we need supplemental logging to select the flashback_transaction_query. We need the archive log mode and supplemental logging to run dbms_flashback.transaction_backout. You also need to notice that after you run the procedure, the reversed transaction is in an uncommited state. You need to commit it if you want the reverse take effect.
After talking about flashback query, flashback version query, flashback transaction, let`s see the flashback table. This feature seems make you be able to make a table go back to some old state. But actually it is also using some transaction. The flashback table is actually using some transaction to modify the table. So if the tables defination is changed you can not use flashback table feature. Because DDL is not transaction. Before using flashback table, you need to enable row movement for the table.
Also there is an more complicated situation in flashback table. Think in this case. We have two tables parent and child.
SQL> create table parent(id number); Table created. SQL> alter table parent add constraint parent_pk primary key(id); Table altered. SQL> insert into parent values(1); 1 row created. SQL> insert into parent values(2); 1 row created. SQL> commit; Commit complete. SQL> create table child(id number ,constraint child_fk foreign key(id) references parent(id)); Table created. SQL> insert into child values(1); 1 row created. SQL> insert into child values(2); 1 row created. SQL> commit; Commit complete.
Now we have two normal transactions. First modify the child, then modify the parent.
SQL> delete from child ; 2 rows deleted. SQL> commit; Commit complete. SQL> delete from parent; 2 rows deleted. SQL> commit; Commit complete.
Now if you use flashback table to flashback child first.
SQL> flashback table child to timestamp to_timestamp('05-09-13 14:10:00','dd-mm-yy hh24:mi:ss' ) ;
flashback table child to timestamp to_timestamp('05-09-13 14:10:00','dd-mm-yy hh24:mi:ss' )
*
ERROR at line 1:
ORA-02091: transaction rolled back
ORA-02291: integrity constraint (CITOSADMIN.CHILD_FK) violated - parent key not
found
Then you hit constraint issue because the parent do not have data yet.
But you can flashback them togather, oracle will resolve the dependency.
SQL> flashback table child,parent to timestamp to_timestamp('05-09-13 14:10:00','dd-mm-yy hh24:mi:ss' ) ; Flashback complete.
Note that in flashback table, the transaction oracle use to flashback the table is like normal transactions, the only different is that the trigger will not be triggered.
But you can enable the trigger with this syntax.
SQL> flashback table emp,dept to scn 6539425 enable triggers;
flashback drop
You may accidently drop a table. Flashback drop is the mechanism can help us to rescue this situation. But before this happen, will introduce another skill can help you to avoid this kind of error. When you accidently drop some thing, it`s usually because you do not know where you are. You might thought you are in some test enviroment. There is one way to aovid this.
SQL> set sqlprompt "_user'@'_connect_idnetifier>"
user@_connect_idnetifier>
The above command change the SQL prompt which can remmind you where you are. You can also put this command in to the gloign.sql which in ORACLE_HOME/sqlplus/admin directory. Then whenever you login, the command will run automatically.
Now we focuse on the flashback drop. In oracle the dorp command actually do the following things. Rename the table to some system generated names.
Then nothing else. The space taken by the table still exist but can be used by other objects. If these space not being alllocated to other objects, then you can flashback the table anytime. Everything on the table is flashbacked too except the foreign key constraints. But you need to konw that the disk space taken by oracle will not trigger space usage alert. To oracle they are free space.
Here is an example for flashback drop.
SQL> drop table child; Table dropped. SQL> drop table parent; Table dropped. SQL> flashback table child to before drop rename to new; Flashback complete. SQL> select * from new; ID
----------
1
2
As you can see, we esalily flashback the child table. The foreign key constraint is not a problem.
Note that tables under system tablespace can not be flashbacked. If you dorp them then they will be purdge immediately.
flashback database
Flashback database architecture. Once Flashback Database is enabled, images of altered blocks are copied from time to time from the database buffer cache to a new memory area within the SGA, the flashback buffer. This flashback buffer is flushed to disk, to the flashback logs, by a new background process: the Recovery Writer, or RVWR. There is no change to the usual routine of writing changes to the log buffer, which the LGWR then flushes to disk; flashback logging is additional to this. Unlike the redo log, flashback logging is not a log of changes—it is a log of complete block images.
Critical to performance is that not every change is copied to the flashback buffer— only a subset of changes. If all changes to all blocks were copied to the buffer, then the overhead in terms of memory usage and the amount of extra disk I/O required to flush the buffer to disk would be crippling for performance. Internal algorithms limit which versions of which blocks are placed in the flashback buffer, in order to restrict its size and the frequency with which it will fill and be written to disk. These algorithms are intended to ensure that there will be no negative performance hit when enabling Flashback Database: they guarantee that even very busy blocks are logged only infrequently.
When conducting a database flashback, Oracle will read the flashback logs to extract the versions of each changed database block, and copy these versions back into the datafiles. As these changes are applied to the current database in reverse chronological order, this has the effect of taking the database back in time, by reversing the writes that the DBWn process has done.
But since not every datablock change version is saved in the flashback log. For example, the datablock is changed 8 times but only 4 version is saved. So you will not be able to flashback the table to a precise point of time. So you will flashback the table to a previsoue point of time, then use incomplete finnish the rest.
So Flashback Database is in fact a combination of several processes and data structures. First, you must allocate some memory in the SGA (which will be automatic— you cannot control how large the buffer is) and some space on disk to store the flashback data, and start the RVWR process to enable flashback logging. When doing a flashback, Oracle will use the flashback logs to take the database back in time to before the time you want, and then apply redo logs (using whatever archive redo log files and online redo log files are necessary) in the usual fashion for incomplete recovery to bring the datafiles forward to the exact time you want. Then the database can be opened with a new incarnation, in the same manner as following a normal incomplete recovery.
Below are the steps of configure flashback database
. Ensure that the database is in archivelog mode.
Archive log mode is a prerequisite for enabling Flashback Database. Confirm this by querying the V$DATABASE view:
SQL> select log_mode from v$database;
. Set up a flash recovery area.
The flash recovery area is the location for the flashback logs. You have no control over them other than setting the flash recovery area directory and limiting its size. It is controlled with two instance parameters: DB_ RECOVERY_FILE_DEST specifies the destination directory and DB_RECOVERY_ FILE_DEST_SIZE restricts the maximum amount of space in bytes that it can take up. Remember that the flash recovery area is used for purposes other than flashback logs, and it will need to be sized appropriately. For example,
SQL> alter system set db_recovery_file_dest='/flash_recovery_area';
SQL> alter system set db_recovery_file_dest_size=8G;
. Set the flashback retention target.
This is controlled by the DB_FLASHBACK_RETENTION_TARGET instance parameter, which is in minutes, and the default is one day. The flashback log space is reused in a circular fashion, older data being overwritten by newer data. This parameter instructs Oracle to keep flashback data for a certain number of minutes before overwriting it:
SQL> alter system set db_flashback_retention_target=;
It is only a target (four hours in the preceding example) and if the flash recovery area is undersized, Oracle may not be able to keep to it. But in principle, you should be able to flash back to any time within this target.
. Cleanly shut down and mount the database.
SQL> shutdown immediate;
SQL> startup mount;
. Enable flashback logging.
While in mount mode,
SQL> alter database flashback on;
will start the RVWR process and allocate a flashback buffer in the SGA. The process startup will be automatic from now on.
. Open the database.
SQL> alter database open;
Logging of data block images from the database buffer cache to the flashback buffer will be enabled from now on.
The use is very simple
SQL> shutdown abort;
SQL> startup mount;
SQL> flashback database to timestamp
to_timestamp('20-12-08 10:01:00','dd-mm-yy hh24:mi:ss');
SQL> alter database open read only;
FLASH BACK的更多相关文章
- 隐私泄露杀手锏 —— Flash 权限反射
[简版:http://weibo.com/p/1001603881940380956046] 前言 一直以为该风险早已被重视,但最近无意中发现,仍有不少网站存在该缺陷,其中不乏一些常用的邮箱.社交网站 ...
- 百度 flash html5自切换 多文件异步上传控件webuploader基本用法
双核浏览器下在chrome内核中使用uploadify总有302问题,也不知道如何修复,之所以喜欢360浏览器是因为帮客户控制渲染内核: 若页面需默认用极速核,增加标签:<meta name=& ...
- 解决“chrome提示adobe flash player 已经过期”的小问题
这个小问题也确实困扰我许久,后来看到chrome吧里面有人给出了解决方案: 安装install_flash_player_ppapi, 该软件下载地址:http://labs.adobe.com/do ...
- 在 Linux 中使用搜狗拼音输入法以及搞定 Flash 和支付宝
在 Ubuntu 中安装搜狗输入法 在 Ubuntu Kylin 系统中,默认安装搜狗拼音输入法,但是在原生 Ubuntu 系统中则不是.这可以理解,毕竟搜狗输入法的 Linux 版有 Kylin 团 ...
- [异常解决] ubuntukylin16.04 LTS中关于flash安装和使用不了的问题解决
http://www.linuxdiyf.com/linux/25211.html 归纳解决flash插件大法: 启动器中找到 软件更新,启动,点击 其它软件,把Canonical合作伙伴前方框 选上 ...
- 基于Adobe Flash平台的3D页游技术剖析
写在前面 从黑暗之光,佛本是道,大战神的有插件3D页游.再到如今的魔龙之戒. 足以证明,3D无插件正在引领页游技术的潮流. 目前,要做到3D引擎,有以下几个选择. 说到这里,我们发现.这些都不重要. ...
- 强大的flash头像上传插件(支持旋转、拖拽、剪裁、生成缩略图等)
今天介绍的这款flash上传头像功能非常强大,支持php,asp,jsp,asp.net 调用 头像剪裁,预览组件插件. 本组件需要安装Flash Player后才可使用,请从http://dl.pc ...
- MDK st-link下载STM32程序出现Internal command error和Error:Flash download failed. Target DLL
MDK st-link下载STM32程序出现Internal command error和Error:Flash download failed. Target DLL 是因为目标板的芯片处于休眠 ...
- 嵌入式Linux驱动学习之路(二十四)Nor Flash驱动程序
Nor Flash和Nand Flash的不同: 类型 NOR Flash Nand Flash 接口 RAM-like,引脚多 引脚少 容量 小(1M.2M...) 大(512M.1G) 读 简 ...
- mtk flash tool,Win7 On VirtualBox
SP_Flash_Tool_exe_Windows_v5.1624.00.000 Win7 在 VirtualBox, 安裝 mtk flash tool, v5.1628 在燒錄時會 fail. v ...
随机推荐
- java用匿名内部类实现多线程堆内存变量共享
匿名内部类介绍:http://www.cnblogs.com/nerxious/archive/2013/01/25/2876489.html 用Runnable模拟实现共享堆内存变量 import ...
- malloc()函数的使用
malloc是向系统申请分配指定size个字节的内存空间.返回值类型为void *类型.void *表示未确定的类型指针.C语言中,void *类型可以强制转换为任何其他类型的指针. 语法:void ...
- [ USACO 2010 FEB ] Slowing Down
\(\\\) \(Description\) 给出一棵 \(N\) 个点的树和 \(N\) 头牛,每头牛都要去往一个节点,且每头牛去往的点一定互不相同. 现在按顺序让每一头牛去往自己要去的节点,定义一 ...
- Linux 压力测试及内存检测
常用的 Stress / Performance 工具 http://benjr.tw/532 Linux中的常用内存问题检测工具 https://blog.csdn.net/jinzhuojun/a ...
- mysql 性能优化索引、缓存、分表、分布式实现方式。
系统针对5000台终端测试结果 索引 目标:优化查询速度3秒以内 需要优化.尽量避免使用select * 来查询对象.使用到哪些属性值就查询出哪些使用即可 首页页面: 设备-组织查询 优化 避免使用s ...
- jmeter插件之PerfMon
PerfMon是jmeter监控系统资源的一款插件,可以用来监控系统的CPU/内存/IO等性能指标. 一.要准备好的插件:JMeterPlugins-Standard-1.4.0(pwd:cjqd)或 ...
- 打造个人的vimIDE
环境说明 系统版本:centos7.Ubuntu16 vim版本:7.4 安装git工具 整体说明:本文的vim配置是针对Linux的单个系统用户,python的自动补全使用的是 jedi-vim 插 ...
- Docker 安装并定制 Nginx 服务器
安装并定制 Nginx 1.查阅对应的官方文档,首先下载镜像文件: [spider@izwz9d74k4cznxtxjeeur9z local]$ sudo docker pull nginx [su ...
- POJ2454——Jersey Politics
POJ2454——Jersey Politics 题目大意: 在泽西奶牛和荷斯坦奶牛的最新普查中,威斯康星奶牛在谷仓中获得了三个档位. 泽西奶牛目前控制着国家重新分配委员会. 他们想将国家分为三个相当 ...
- linux more-显示文件内容,每次显示一屏
博主推荐:获取更多 linux文件内容查看命令 收藏:linux命令大全 more命令是一个基于vi编辑器文本过滤器,它以全屏幕的方式按页显示文本文件的内容,支持vi中的关键字定位操作.more名单中 ...