[11g architecture, 5] rowid, 11g architecture rowid

Source: Internet
Author: User

[11g architecture, 5] rowid, 11g architecture rowid
I. rowid
The extended rowid is displayed in a 64-based encoding scheme. The rowid is a data ID card number. It has a total of 18 bits, 6 bits, 3 is the file number, 6 bits, and 3 bits. The first 15 digits of rowid indicate the block address. The first 15 digits share the same data in the same block.
# Query EMProwidSQL> select rowid from scott. emp;
ROWID ------------------ INVALID RESPONSE
ROWID ------------------ aaacgbaaeaaadaalaaacgbaaeaaaaadaamaaacgbaaeaaadaan
14 rows selected.
# Query object idSQL> select object_id, object_name, object_type from dba_objects where owner = 'Scott ';
OBJECT_ID OBJECT_NAM OBJECT_TYP ---------- 10239 dept table 10240 PK_DEPT INDEX 10241 emp table 10242 PK_EMP INDEX 10243 bonus table 10244 SALGRADE TABLE
6 rows selected.
# Obtain the object number SQL> select dbms_rowid.rowid_object ('aaacgbaaeaaadaag') from dual;
DBMS_ROWID.ROWID_OBJECT ('aaacgbaaeaaadaag ') ----------------------------------------------- 10241
# File number SQL> select dbms_rowid.rowid_relative_fno ('aaacgbaaeaaadaag ') from dual;
DBMS_ROWID.ROWID_RELATIVE_FNO ('aaacgbaaeaaadaag') Blocks 4 # block number SQL> select dbms_rowid.rowid_block_number ('aaacgbaaeaaadaag ') from dual;
DBMS_ROWID.ROWID_BLOCK_NUMBER ('aaacgbaaeaaadaag ') limit 29 # row number, 7th records SQL> select dbms_rowid.rowid_row_number ('aaacgbaaeaaadaag') from dual;
DBMS_ROWID.ROWID_ROW_NUMBER ('aaacgbaaeaaadaag ') --------------------------------------------- 6 # query area information. emp contains 8 blocks and block_id is 25-25 ~ 32. SQL> col segment_name for a10SQL> select extent_id, segment_name, bytes/1024 k, blocks, file_id, block_id from dba_extents where owner = 'Scott ';
EXTENT_ID SEGMENT_NA k blocks FILE_ID BLOCK_ID ---------- 0 DEPT 64 8 8 4 9 0 EMP 64 8 4 25 0 BONUS 64 8 41 0 SALGRADE 64 8 4 49 0 PK_DEPT 64 8 4 17 0 PK_EMP 64 8 4 33
6 rows selected.

2. How much data can be stored in a data block and how much data can be stored in 1 GB space:

Iii. OFA: optimal and flexible architecture ofa: naming conventions and storage location rules for oracle software and database file set folders.
$ ORACLE_BASE:/u01/app/oracle $ oracle_home:/u01/app/oracle/11.2.0/db_home_1 $ ORACLE_BASE // oradata data file/product software address/admin place dump file
$ Oracle_home/dbs initialization file (parameter file, password file)/network/admin configuration listening

Iv. Relationship between instance_name, sid, db_name, and global_name 1. sid is the operating system used to represent the instance number. It can be understood as the operating system number of the instance. Therefore, sid and instance_name correspond one to one. Select instance_name from v $ instance stores sid2. however, instance_name differs from db_name: in rac, db_name is racdb, but the instance names may be racdb1 and dacdb23.global _ name, which is db_name.db_domain, global_name is set up to identify the database name in a distributed database composed of multiple databases.
SQL> select * from global_name; GLOBAL_NAME--------------LOSCSMAN
SQL> select instance_name from v $ instance;
INSTANCE_NAME -------------------------------- loscsmanager
SQL> show parameter db_name;
Name type value ------------------------------------ -------------------------------------------------- db_name string loscsman








Many people on the Internet say that when processing big data paging in oracle 11g, rowid is much more efficient than rownum. The principle of rowid and rownum paging Efficiency

Rownum and rowid are two different things. I don't know how to use rowid for paging?
Rownum is the number of the returned record. Rowid can be understood as the actual address of the returned record.
When you access data by rowid, it is equivalent to taking the number directly without query. rownum must be used for query (that is, there is a query action in the database ). If you already know the rowid and then get the data and get the data through the rownum count, you must use the rowid quickly.
In fact, because oracle does not support real paging queries, the so-called paging refers to first querying data from the database and then returning the data on the corresponding page to the caller, the remaining data is discarded. Therefore, in this case, it is better to use rowid than to use rownum.
 

Related Article

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.