標籤:
查看所有使用者分區表及分區策略(1、2級分區表均包括):
SELECT p.table_name AS 表名, decode(p.partitioning_key_count, 1, ‘主要磁碟分割‘) AS 分區類型,
p.partitioning_type AS 分區類型, p.column_name AS 分區鍵,
decode(nvl(q.subpartitioning_key_count, 0), 0, ‘無子分區‘, 1, ‘子分區‘) AS 有無子分區,
q.subpartitioning_type AS 子分區類型, q.column_name AS 子分區鍵
FROM (SELECT a.table_name, a.partitioning_type, b.column_name, a.partitioning_key_count
FROM user_part_tables a, user_part_key_columns b
WHERE a.table_name = b.NAME
AND b.object_type = ‘TABLE‘) p,
(SELECT a.table_name, a.subpartitioning_type, b.column_name, a.subpartitioning_key_count
FROM user_part_tables a, user_subpart_key_columns b
WHERE a.table_name = b.NAME
AND a.subpartitioning_key_count <> 0
AND b.object_type = ‘TABLE‘) q
WHERE p.table_name = q.table_name(+)
ORDER BY 5,4,1;
顯示資料庫所有分區表的資訊:DBA_PART_TABLES
顯示目前使用者可訪問的所有分區表資訊:ALL_PART_TABLES
顯示目前使用者所有分區表的資訊:USER_PART_TABLES
顯示表分區資訊顯示資料庫所有分區表的詳細分區資訊:DBA_TAB_PARTITIONS
顯示目前使用者可訪問的所有分區表的詳細分區資訊:ALL_TAB_PARTITIONS
顯示目前使用者所有分區表的詳細分區資訊:USER_TAB_PARTITIONS
select * from user_tab_partitions;
顯示子分區資訊顯示資料庫所有組合分區表的子分區資訊:DBA_TAB_SUBPARTITIONS
顯示目前使用者可訪問的所有組合分區表的子分區資訊:ALL_TAB_SUBPARTITIONS
顯示目前使用者所有組合分區表的子分區資訊:USER_TAB_SUBPARTITIONS
顯示分區列顯示資料庫所有分區表的分區列資訊:DBA_PART_KEY_COLUMNS
顯示目前使用者可訪問的所有分區表的分區列資訊:ALL_PART_KEY_COLUMNS
顯示目前使用者所有分區表的分區列資訊:USER_PART_KEY_COLUMNS
顯示子分區列顯示資料庫所有分區表的子分區列資訊:DBA_SUBPART_KEY_COLUMNS
顯示目前使用者可訪問的所有分區表的子分區列資訊:ALL_SUBPART_KEY_COLUMNS
顯示目前使用者所有分區表的子分區列資訊:USER_SUBPART_KEY_COLUMNS
--------------------------------------------------------------------------------------------------
怎樣查詢出Oracle資料庫中所有的的分區表
select * from user_tables a where a.partitioned=‘YES‘
刪除一個表的資料是truncate table table_name;
刪除分區表一個分區的資料是alter table table_name truncate partition p5;
如:alter table table_name truncate partiton SYS_P5;
如果我要將分區表中各個分區的資料都清空,可以用truncate table table_name直接刪除;
也可以用:
alter table table_name truncate partition p1;
alter table table_name truncate partition p2;
alter table table_name truncate partition p3;
alter table table_name truncate partition p4;
alter table table_name truncate partition p5;
alter table table_name truncate partition p6;
逐個刪除。
oracle 11g 分區表