oracle 11g 分區表

來源:互聯網
上載者:User

標籤:

查看所有使用者分區表及分區策略(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 分區表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.