Why do you want to open row movement? Flashback table will definitely cause ROWID to follow.

Source: Internet
Author: User
Tags commit

Flashback table will definitely cause ROWID to follow the changes, why to open row move, that's why

Now I'll do an experiment to verify:
Sql> drop tablespace TP2 including contents and datafiles;
Tablespace dropped.
sql> Create tablespace tp2 datafile '/u01/app/oracle/oradata/tp2.dbf ' size 512K;
Tablespace created.
sql> CREATE TABLE t1 (ID int,name char ()) tablespace TP2;
Table created.
Sql> begin
2 for I in 1. 1000 loop
3 INSERT INTO T1 values (i, ' Gyj ' | | i);
4 End Loop;
5 commit;
6 end;
7/
Pl/sql procedure successfully completed.

Check rowid.
Sql> Select Rowid,id from t1 where Id>=1 and id<=5;
ROWID ID
------------------ ----------
AAASVNAAIAAAAAOAAA 1
Aaasvnaaiaaaaaoaab 2
AAASVNAAIAAAAAOAAC 3
Aaasvnaaiaaaaaoaad 4
AAASVNAAIAAAAAOAAE 5
Sql> ALTER TABLE T1 enable row movement;
Table altered.
Sql> select Current_scn from V$database;
Current_scn
-----------
6177172

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Check file number, block number, line number
Sql> select ID,DBMS_ROWID.ROWID_RELATIVE_FNO (ROWID) File#,dbms_rowid.rowid_block_number (rowid ) Block#,dbms_rowid.rowid_row_number (ROWID) row# from T1 where Id>=1 and id<=5;
       id      file#     block#       row#
---------- ------------------------------
        1          8     &NBS P            0
        2         &NBSP;8                  1
        3          8                 &NBSP;2
        4   &NBSP ;      8                  3
        5          8                  4
sql> Delete from t1
1000 rows deleted.
Sql> commit;
Commit complete.

Insert a large number of records to allow space to run out
Sql> begin
2 for I in 1001. 100000 loop
3 INSERT INTO T1 values (i, ' Gyj ' | | i);
4 commit;
5 end Loop;
6 end;
7/
Begin
*
ERROR at line 1:
Ora-01653:unable to extend table GYJ. T1 by 8 in tablespace TP2
Ora-06512:at Line 3

Sql> Flashback table T1 to SCN 6177172;
Flashback complete.

Check the original 1000 rows of the first 5 lines of ROWID, and the original ROWID is not the same
Sql> Select Rowid,id from t1 where Id>=1 and id<=5;
ROWID ID
------------------ ----------
AAASVNAAIAAAAACAFR 1
Aaasvnaaiaaaaacafs 2
Aaasvnaaiaaaaacaft 3
Aaasvnaaiaaaaacafu 4
AAASVNAAIAAAAACAFV 5

Check the original 1000 line records the first 5 lines of the file number, block number, line number, and the original block number line number is not the same
Sql> select Id,dbms_rowid.rowid_relative_fno (ROWID) File#,dbms_ Rowid.rowid_block_number (ROWID) block#,dbms_rowid.rowid_row_number (ROWID) row# from T1 where Id>=1 and id<=5;
       id      file#     block#       row#
---------- ------------------------------
        1          8     &NBS P          363
        2          8   &NBS P            364
        3          8 &nbs P              365
        4         &NBSP 8                366
        5       &N Bsp  8     &NBSP;          367

I did this experiment to make the table space a little bit more convenient to observe, in the T1 table first add 1000 records, and then delete, and then insert some records into the inside until the time to take up the space, so that the last new inserted records will occupy the original 1000 records space ...

Complete!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: [email protected] and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.