Flashback six major technologies: flashback version query environment: [SQL] 23:47:03 hr @ ORCL (^ ω ^) select * from v $ version where rownum = 1; BANNER login Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Prod www.2cto.com 1 principles introduction flashback query can only "traverse" the Database version at a certain time point in the past, however, at the current time and a certain time point in the past, the data in a table may have been changed multiple times, and a single version may not be able to meet the recovery requirements. You can use the flashback version query to view different versions of records submitted in the undo tablespace within a specified period of time. The pseudo-column description of flashback version query indicates that versions_startscnversions_starttime records the SCN or time during the operation. If it is null, it indicates that the created versions_endscnversions_endtime outside the query range records the SCN or time when the query fails, check with the version_operation column. If it is null, It is deleted, or the current time of the record does not exist in the current table, versions_operation I: insert D: delete U: updateversions_operation transaction ID www.2cto.com 2 experiment [SQL] 23:38:26 hr @ ORCL (^ ω ^) select dbms_flashback.get_system_change_number from dual; GET_SYSTEM_CHANGE_NUMBER ------------- ----------- 3930808 23:38:48 hr @ ORCL (^ ω ^) update t1 set empno = 122 where ename = 'water'; 1 line has been updated. 23:39:42 hr @ ORCL (^ ω ^) commit; www.2cto.com submitted completely. 23:40:06 hr @ ORCL (^ ω ^) delete t1 where rownum <5; four rows have been deleted. 23:40:25 hr @ ORCL (^ ω ^) commit; submitted completely. 23:40:29 hr @ ORCL (^ ω ^) insert into t1 values (155, 'qao'); 1 row has been created. 23:40:56 hr @ ORCL (^ ω ^) insert into t1 values (156, 'qinqin'); 1 row has been created. 23:41:19 hr @ ORCL (^ ω ^) commit; www.2cto.com submitted completely. 23:41:22 hr @ ORCL (^ ω ^) select region from dual; GET_SYSTEM_CHANGE_NUMBER ---------------------- 3931066 23:46:34 hr @ ORCL (^ ω ^) select empno, ename, versions_startscn, versions_endscn, versions_operation, versions_xid 23:47:00 2 from t1 versions between scn 3930808 and 3931066; empno ename VERSIONS_STARTSCN VERSIONS_ENDSCN VE VERSIONS_XID ---------------------------- --------- --------------- -- ---------------- 155 qao 3930985 I 04002000D4030000 111 Linshuibin 3930897 D release 122 Water 3930897 D release 122 Water 3930883 3930897 U release 111 Water 3930883 111 Linshuibin 3930897 7566 JONES 3930897 D release 7521 WARD 3930897 D 06002F00B6040000 7521 WARD 3930897 7566 JONES 3930897 7788 SCOTT www.2cto.com 7844 TURNER 7900 J AMES 7902 FORD 156 qinqin 3930985 I 04002000D4030000 110 Think has 16 rows selected.