Notes for getting records using rowid and rownum

Source: Internet
Author: User
We know that rowid and rownum can both be used as fake in Oracle and are mainly used to locate specific records in the table, but they are different. rowid is different from row record.

We know that rowid and rownum can both be used as fake in Oracle and are mainly used to locate specific records in the table, but they are different. rowid is different from row record.

In Oracle 8 or lower, rowid (also called restricted rowid) is: FFFF. BBBBBBBB. RRRR, which occupies 6 bytes (10bit file # + 22bit + 16bit). However, to expand the data file, change the rowid to OOOOOOFFFBBBBBBRRR, occupies 10 bytes (32bit + 10bit rfile # + 22bit + 16bit ). Here, O is the Object number, F is the File number, B is the Block number, and R is the Row number. Since the composition of rowid changes from file # To rfile #, the limit on the number of data files cannot exceed 1023 in the entire database, but cannot exceed 1023 data files in each tablespace. The object_id here is an information related to the physical storage location of a segment, because a segment object can only be in one tablespace. object_id can uniquely confirm ts #, object_id + rfile # can finally locate the specified physical data file where the rowid is located.

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.