Delete Uncommitted rollback will change line number

Source: Internet
Author: User

Do a test today, DELETE uncommitted rollback will change the line number?

Creating a Test table: CREATE TABLE dxmy (ID number,name varchar2 (100)), inserting data insert into dxmy values (1, ' dxmy '); insert into dxmy values (2, ' d Xmy '); insert into dxmy values (3, ' dxmy '); insert into dxmy values (4, ' dxmy '); View line number sql> Select Dbms_rowid.rowid_ RELATIVE_FNO (ROWID) fno,  2         Dbms_rowid.rowid_block_number ( ROWID) block_id,  3         dbms_rowid.rowid_row_number (ROWID) row_id ,  4         id  5    from dxmy;         fno   block_id     row_id          ID----------------------------------------         4         462          0           1         4        462          1           2         4         462          2           3         4         462          3           4 Delete, but do not commit:sql> delete dxmy where id = 1; 1 row deleted sql> sql> SE Lect dbms_rowid.rowid_relative_fno (ROWID) fno,  2         Dbms_ Rowid.rowid_block_number (ROWID) block_id,  3         Dbms_ Rowid.rowid_row_number (ROWID) row_id,  4         id  5 & nbsp;  from dxmy;        fno   block_id     ROW_ id         ID----------------------------------------          4        462           1          2          4        462           2          3          4        462          3           4rollback:sql> Rollback; rollback completesql> Select Dbms_rowid.rowid_relative_fno (ROWID) fno,  2         DBMS_rowid.rowid_block_number (ROWID) block_id,  3         Dbms_ Rowid.rowid_row_number (ROWID) row_id,  4         id  5     from dxmy;        fno   block_id     row_id         ID----------------------------------------          4        462           0          1          4        462           1          2          4        462           2&NBsp;         3         4         462          3   The         4 line number has not changed. What if I submit it after the delete, and then reinsert it? sql> Delete dxmy where id = 1; 1 row deleted sql> commit; commit completesql> insert into Dxmy val UEs (1, ' dxmy ');  1 row inserted sql> commit; commit completesql> Select Dbms_rowid.rowid_relative _FNO (ROWID) fno,  2         dbms_rowid.rowid_block_number (ROWID) block_id,  3         dbms_rowid.rowid_row_number (rowid) row_id,   4         id  5    from dxmy;         fno   block_id     row_id          ID----------------------------------------         4         462          1           2         4         462          2           3         4        462           3          4          4        463           0          1<pre name= "Code" class= "html" >SQL> delete dxmy where id = 1; 1 row deleted sql> commit; commit complete

sql> INSERT INTO dxmy values (1, ' dxmy2 ');

1 row inserted

Sql> commit;

Commit Complete

Sql>
Sql> Select Dbms_rowid.rowid_relative_fno (ROWID) FNO,
2 Dbms_rowid.rowid_block_number (ROWID) block_id,
3 Dbms_rowid.rowid_row_number (ROWID) row_id,
4 ID
5 from Dxmy;

FNO block_id row_id ID
---------- ---------- ---------- ----------
4 462 1 2
4 462 2 3
4 462 3 4
4 463 1 1

Then we find:
1.delete UNCOMMITTED or rollback does not change line numbers
Inserting data after 2.delete commits may change the line number, but it may not change, but the position of the row will definitely change.



Delete Uncommitted rollback will change line number

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: info-contact@alibabacloud.com 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.