CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle Chained Rows
Version 11.1
 
Manufacturing Chained Rows
Courtesy of Andy Hassall
conn / as sysdba

show parameter db_block_size

conn uwclass/uwclass

SQL> @?/rdbms/admin/utlchn1.sql

CREATE TABLE t (
col1  VARCHAR2(4000),
col2  VARCHAR2(4000));

INSERT INTO t VALUES ('x', '1');
INSERT INTO t VALUES ('xx', '2');

INSERT INTO t
(col1, col2)
VALUES
(LPAD('x',4096,'x'), LPAD('x',4096,'x'));

INSERT INTO t VALUES ('xxxx', '4');
INSERT INTO t VALUES ('xxxxx', '5');
COMMIT;

ANALYZE TABLE t LIST CHAINED ROWS INTO chained_rows;

set linesize 121
col table_name format a15
col head_rowid format a20

SELECT sys_op_rpb(rowid), table_name, head_rowid, analyze_timestamp
FROM chained_rows;

SELECT rowid, dbms_rowid.rowid_block_number(rowid) BN, sys_op_rpb(rowid), length(col1), length(col2)
from t;

SELECT table_name, chain_cnt
FROM user_tables
ORDER BY 1;

ANALYZE TABLE t COMPUTE STATISTICS;

SELECT table_name, chain_cnt
FROM user_tables
ORDER BY 1;
 
Related Topics
Analyze
DBMS_IOT
Tables
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [268 users online]    © 2010 psoug.org