Oracle分割槽表資訊的查詢

2021-06-02 07:26:00 字數 2219 閱讀 3750

檢視所有使用者分割槽表及分割槽策略(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

顯示子分割槽資訊顯示資料庫所有組合分割槽表的子分割槽資訊: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;

如果我要將分割槽表中各個分割槽的資料都清空,可以用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分割槽表資訊的查詢

原帖 http space.itpub.net 11813230 viewspace 663226 檢視所有使用者分割槽表及分割槽策略 1 2級分割槽表均包括 select p.table name as 表名,decode p.partitioning key count,1,主分割槽 as 分割...

檢視oracle分割槽表資訊

顯示資料庫所有分割槽表的資訊 dba part tables 顯示當前使用者可訪問的所有分割槽表資訊 all part tables 顯示當前使用者所有分割槽表的資訊 user part tables 顯示表分割槽資訊 顯示資料庫所有分割槽表的詳細分割槽資訊 dba tab partitions 顯...

Oracle分割槽表

1 範圍分割槽 range create table range part tab id number,deal date date,area code number,contents varchar2 4000 partition by range deal date partition p201...