I created the partitions for the table (test) by Hijri months (date) , How to match a particular partition by ROWID in oracle?
Asked
Active
Viewed 2,327 times
1
-
you can extract file_id and block_id from ROWID (by calling some dbms_package). Then you can find the "closest" extent header by querying dba_extents. – ibre5041 Nov 10 '15 at 12:27
3 Answers
1
Try this:
SELECT dbms_rowid.rowid_object(ROWID) data_object_id
FROM test;
To get the partition name you can use
SELECT partition_name
from user_tab_partitions
where table_name='test'

Rahul Tripathi
- 168,305
- 31
- 280
- 331
-
-
-
I want to give Rowid and oracle returns to me partition My record belongs to which partition SELECT partition_name from user_tab_partitions -- I don't know which table it is? where ROWID = 'xxx' – mohsen.nour Nov 10 '15 at 12:56
1
select object_name tab_name, subobject_name parttition from user_objects where object_id =dbms_rowid.rowid_object('xxxxx');

Arkadiusz Łukasiewicz
- 6,241
- 1
- 11
- 17
1
Quite straightforward, using DBMS_RowID and dba_objects.
select *
from dba_objects
where data_object_id = dbms_rowid.rowid_object(ROWID_OF_THE_ROW)
Further tips and observations here: https://oraclesponge.wordpress.com/2006/05/11/getting-the-subpartition-name-for-a-row/

David Aldridge
- 51,479
- 8
- 68
- 96