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



我在Hijri months(date)之前为表(测试)创建了分区,如何在oracle中通过ROWID匹配特定分区?

使用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/

试试这个:

SELECT dbms_rowid.rowid_object(ROWID) data_object_id
FROM test;

要获得分区名称,可以使用

SELECT partition_name 
from user_tab_partitions
where table_name='test'
select object_name tab_name, subobject_name parttition   from user_objects where object_id =dbms_rowid.rowid_object('xxxxx');

相关内容

  • 没有找到相关文章