scn in oracle [message #222792] |
Tue, 06 March 2007 06:49 |
p.bhaskar
Messages: 33 Registered: February 2007 Location: kolkata
|
Member |
|
|
pls tell me daetails of scn number and what is the purpose of using of this number in flashback query
|
|
|
|
|
|
|
|
Re: scn in oracle [message #223203 is a reply to message #223195] |
Thu, 08 March 2007 00:17 |
Mohammad Taj
Messages: 2412 Registered: September 2006 Location: Dubai, UAE
|
Senior Member |
|
|
Hi,
Try this
SQL> create table SCN_TEST (no number, name varchar2(20));
Table created.
SQL> insert into scn_test values (1,'a');
1 row created.
SQL> insert into scn_test values (2,'b');
1 row created.
SQL> insert into scn_test values (3,'c');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from scn_test;
NO NAME
---------- --------------------
1 a
2 b
3 c
SQL> show parameter undo_retention
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_retention integer 22719
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
15893109
SQL> delete from scn_test where no = 2;
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from scn_test AS OF SCN 15893109 where no = 2;
NO NAME
---------- --------------------
2 b
SQL> insert into scn_test ( select * from scn_test AS OF SCN 15893109
2 where no = 2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from scn_test;
NO NAME
---------- --------------------
1 a
3 c
2 b
SQL>
Note :
Read before using FLASHBACK feature.
http://download-uk.oracle.com/docs/cd/B14117_01/appdev.101/b10795/adfns_fl.htm#1009344
regards
Taj
[Updated on: Thu, 08 March 2007 00:21] Report message to a moderator
|
|
|
|
|
|
|