oracle 中查詢分區表及其分區字段

版權聲明:本文爲博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/lyh147406/article/details/79214129

數據庫中查詢分區表及其分區字段

select owner,count(1) from dba_tables where partitioned='YES' group By owner; -- 查詢數據庫中不同用戶的分區表的數目

select * from dba_tables where partitioned='YES'  and owner='數據庫用戶名' ; -- 查詢數據庫中用戶的分區表

select * from dba_part_key_columns where name='表名' and owner ='數據庫用戶名';  --查詢數據庫中 該用戶下的對應表的分區字段


SELECT * FROM all_PART_KEY_COLUMNS;----查看該數據庫中 所有用戶的 所有分區表的和對應分區字段


SELECT * FROM all_PART_KEY_COLUMNS t where  t.owner='數據庫用戶名'  and  t.name  in(select table_name from dba_tables where partitioned='YES'  and owner='數據庫用戶名' ); 
--查詢數據庫中,該用戶下對應的分區表的表名 和分區表所對應的分區字段


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章