如何在oracle中通过ROWID找到分区?

时间:2015-11-10 11:36:17

标签: oracle partition rowid

我通过Hijri月(日期)创建了表(测试)的分区,  如何在oracle中按ROWID匹配特定分区?

3 个答案:

答案 0 :(得分:1)

试试这个:

SELECT dbms_rowid.rowid_object(ROWID) data_object_id
FROM test;

要获取分区名称,您可以使用

SELECT partition_name 
from user_tab_partitions
where table_name='test'

答案 1 :(得分:1)

select object_name tab_name, subobject_name parttition   from user_objects where object_id =dbms_rowid.rowid_object('xxxxx');

答案 2 :(得分:1)

非常简单,使用DBMS_RowID和dba_objects。

select *
from   dba_objects
where  data_object_id = dbms_rowid.rowid_object(ROWID_OF_THE_ROW)

此处提供更多提示和观察:https://oraclesponge.wordpress.com/2006/05/11/getting-the-subpartition-name-for-a-row/