oracle常用包之dbms_rowid oracle rowid含義分析
如果我們查詢一個表的ROWID,就可以獲得object的資訊,檔案資訊,塊資訊與行資訊等等,如根據其中塊的資訊,可以知道該表確切佔用了多少個塊,每行在哪個塊上,哪個資料檔案上。
SQL> select rowid from t;
ROWID
------------------
AAANkiAAGAAAAZfAAA
AAANkiAAGAAAAZfAAB
拿第一個rowid AAANkiAAGAAAAZfAAA分解一下看到如下
Data Object number = AAANki
File = AAG
Block = AAAAZf
ROW = AAA
SQL> select dbms_rowid.rowid_block_number(rowid) from t;
DBMS_ROWID.ROWID_BLOCK_NUMBER(
------------------------------
1631
1631
SQL> select header_file, header_block, blocks from dba_segments where segment_name = 'T';
HEADER_FILE HEADER_BLOCK BLOCKS
----------- ------------ ----------
6 1627 8
另外,我們需要注意的是,ROWID是64進位制的,分佈關係如下
A-Z <==> 0 - 25 (26)
a-z <==> 26 - 51 (26)
0-9 <==> 52 - 61 (10)
+/ <==> 62 - 63 (2)
SQL> --AAANki=55586 AAG=6 AAAAZf=1631 AAA=0
SQL> select 25*64 + 31 from dual;
25*64+31
----------
1631
SQL> select 13*64*64 + 36*64 +34 from dual;
13*64*64+36*64+34
-----------------
55586
SQL> select object_id from user_objects where object_name ='T';
OBJECT_ID
----------
55586
也可以透過dbms_rowid包來查詢
SQL> select dbms_rowid.rowid_object('AAANkiAAGAAAAZfAAA') data_object_id#,2 dbms_rowid.rowid_relative_fno('AAANkiAAGAAAAZfAAA') rfile#,
3 dbms_rowid.rowid_block_number('AAANkiAAGAAAAZfAAA') block#,
4 dbms_rowid.rowid_row_number('AAANkiAAGAAAAZfAAA') row# from dual;
DATA_OBJECT_ID# RFILE# BLOCK# ROW#
--------------- ---------- ---------- ----------
55586 6 1631 0[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70612/viewspace-1019466/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle rowid 的含義Oracle
- oracle實驗記錄 (dbms_rowid使用)Oracle
- dbms_rowid之dbms_rowid.rowid_info儲存過程使用(in out)儲存過程
- ROWID的含義與塊地址rdba深入分析
- oracle常用包之dbms_jobOracle
- oracle rowidOracle
- 【ROWID】Oracle rowid說明Oracle
- Oracle主要版本命名含義Oracle
- oracle中斜槓(/)的含義Oracle
- ORACLE ROWID (zt)Oracle
- 閉包的含義
- Oracle Statspack各項指標含義Oracle指標
- Oracle redo解析之-4、rowid的計算Oracle Redo
- oracle rowid詳解Oracle
- Oracle rowid 詳解Oracle
- Oracle ROWID-1Oracle
- Oracle ROWID-2Oracle
- oracle rowid (轉載)Oracle
- oracle 11g常用隱含引數Oracle
- oracle buffer busy waits等待的含義OracleAI
- 部分Oracle 配置檔案引數含義Oracle
- Oracle常用分析函式Oracle函式
- Oracle中rowid的用法Oracle
- 【oracle中rowid的用法】Oracle
- 快速顯示oracle錯誤號的含義Oracle
- 安裝oracle時核心引數的含義Oracle
- ORACLE之常用FAQ:ORACLE構架體系Oracle
- ORACLE之常用FAQ:ORACLE網路與安全Oracle
- 安裝oracle時引數shmmax,shmall的含義OracleHMM
- Oracle LISTENER 中各種狀態資訊的含義Oracle
- Oracle 12c新特性之——TABLE ACCESS BY INDEX ROWID BATCHEDOracleIndexBAT
- oracle 11.2.0.4 sequence之dba_sequences last_number含義測試之一OracleAST
- CBO,ORACLE,隱含引數,_sort_elimination_cost_ratio的含義Oracle
- Nginx常用配置引數的含義Nginx
- oracle預定義的包使用小記Oracle
- Oracle 透過rowid秒優SQLOracleSQL
- Oracle 通過rowid秒優SQLOracleSQL
- oracle8的ROWID結構Oracle