Prev | Current Page 810 | Next

Richard Niemiec

"Oracle Database 10g Performance Tuning Tips & Techniques"


The procedure ROWID_INFO returns five attributes for the specified ROWID via output
parameters. In Table 16-4 you can see the parameters of the ROWID_INFO procedure.
Chapter 16: Managing Large Databases 549
In the following example, we??™ll use an anonymous PL/SQL block to extract the values for
OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, and ROW_NUMBER for a row in the
table OE.ARCH_ORDERS:
variable object_number number
variable relative_fno number
variable block_number number
variable row_number number
declare
oe_rownum rowid;
rowid_type number;
begin
select rowid into oe_rownum from oe.arch_orders
where order_id = 2358 and rownum = 1;
dbms_rowid.rowid_info (rowid_in => oe_rownum,
ts_type_in => 'BIGFILE',
rowid_type => rowid_type,
object_number => :object_number,
relative_fno => :relative_fno,
block_number => :block_number,
row_number => :row_number);
end;
PL/SQL procedure successfully completed.
SQL> print
OBJECT_NUMBER
-------------
73749
ROWID_INFO Parameter Description
ROWID_IN ROWID to be described
TS_TYPE_IN Tablespace type (SMALLFILE or BIGFILE)
ROWID_TYPE Returns ROWID type (restricted or extended)
OBJECT_NUMBER Returns data object number
RELATIVE_FNO Returns relative file number
BLOCK_NUMBER Returns block number in this file
ROW_NUMBER Returns row number in this block
TABLE 16-4 ROWID_INFO Parameters
550 Oracle Database 11g DBA Handbook
RELATIVE_FNO
------------
1024
BLOCK_NUMBER
------------
20
ROW_NUMBER
----------
4
SQL>
Note that the return value for RELATIVE_FNO is always 1024 for a bigfile tablespace, and
the BLOCK_NUMBER is 20, as you saw in the previous example that used the DBMS_ROWID.


Pages:
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822
calivita paraprotex calivita calivita paraprotex