oracle composite partition組合分割槽_composite partition range
前幾篇文章:http://space.itpub.net/index.php?uid/9240380/action/spacelist/php/1,
簡要測試了range,hash,list分割槽的語法及維護操作;
oracle也提供了組合分割槽的功能,詳細資料請參考:
大致分為:
組合範圍分割槽
組合列表分割槽
組合雜湊分割槽
本文我們主要測試組合範圍分割槽,奉上例項
----測試情景:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
簡要測試了range,hash,list分割槽的語法及維護操作;
oracle也提供了組合分割槽的功能,詳細資料請參考:
大致分為:
組合範圍分割槽
組合列表分割槽
組合雜湊分割槽
本文我們主要測試組合範圍分割槽,奉上例項
----測試情景:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
--oracle官方說,組合範圍分割槽子分割槽可以是range,list,hash
--先測試range型別的子分割槽
---子分割槽仍為range
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by range(b)
4 subpartition template
5 (
6 subpartition sub1 values less than(5),
7 subpartition sub2 values less than(10)
8 )
9 (
10 partition p1 values less than (10),
11 partition p2 values less than (20),
12 partition p3 values less than (30)
13 )
14 /
Table created
---查詢組合分割槽子分割槽鍵資訊
SQL> select name,object_type,column_name,column_position from user_subpart_key_columns;
NAME OBJECT_TYPE COLUMN_NAME COLUMN_POSITION
------------------------------ ----------- -------------------------------------------------------------------------------- ---------------
T_PARTITION TABLE B 1
SQL> select name,object_type,column_name,column_position from user_subpart_key_columns;
NAME OBJECT_TYPE COLUMN_NAME COLUMN_POSITION
------------------------------ ----------- -------------------------------------------------------------------------------- ---------------
T_PARTITION TABLE B 1
---組合分割槽之子分割槽模組的相關資訊
SQL> select table_name,subpartition_name,subpartition_position,tablespace_name,high_bound from user_subpartition_templates;
TABLE_NAME SUBPARTITION_NAME SUBPARTITION_POSITION TABLESPACE_NAME HIGH_BOUND
------------------------------ ---------------------------------- --------------------- ------------------------------ --------------------------------------------------------------------------------
T_PARTITION SUB1 1 5
T_PARTITION SUB2 2 10
---組合分割槽之子分割槽柱狀圖資訊
SQL> select table_name,subpartition_name,column_name,bucket_number,endpoint_value,endpoint_actual_value from user_subpart_histograms;
TABLE_NAME SUBPARTITION_NAME COLUMN_NAME BUCKET_NUMBER ENDPOINT_VALUE ENDPOINT_ACTUAL_VALUE
------------------------------ ------------------------------ -------------------------------------------------------------------------------- ------------- -------------- --------------------------------------------------------------------------------
SQL>
SQL> select table_name,subpartition_name,subpartition_position,tablespace_name,high_bound from user_subpartition_templates;
TABLE_NAME SUBPARTITION_NAME SUBPARTITION_POSITION TABLESPACE_NAME HIGH_BOUND
------------------------------ ---------------------------------- --------------------- ------------------------------ --------------------------------------------------------------------------------
T_PARTITION SUB1 1 5
T_PARTITION SUB2 2 10
---組合分割槽之子分割槽柱狀圖資訊
SQL> select table_name,subpartition_name,column_name,bucket_number,endpoint_value,endpoint_actual_value from user_subpart_histograms;
TABLE_NAME SUBPARTITION_NAME COLUMN_NAME BUCKET_NUMBER ENDPOINT_VALUE ENDPOINT_ACTUAL_VALUE
------------------------------ ------------------------------ -------------------------------------------------------------------------------- ------------- -------------- --------------------------------------------------------------------------------
SQL>
---組合分割槽子分割槽相關資訊,類似於分割槽表user_tab_partitions
SQL> select table_name,partition_name,subpartition_name,high_value,tablespace_name from user_tab_subpartitions;
TABLE_NAME PARTITION_NAME SUBPARTITION_NAME HIGH_VALUE TABLESPACE_NAME
------------------------------ ------------------------------ ------------------------------ -------------------------------------------------------------------------------- ------------------------------
T_PARTITION P1 P1_SUB1 5 TBS_HANG
T_PARTITION P1 P1_SUB2 10 TBS_HANG
T_PARTITION P2 P2_SUB1 5 TBS_HANG
T_PARTITION P2 P2_SUB2 10 TBS_HANG
T_PARTITION P3 P3_SUB1 5 TBS_HANG
T_PARTITION P3 P3_SUB2 10 TBS_HANG
6 rows selected
---組合分割槽之子分割槽型別為list
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by list(b)
4 subpartition template
5 (
6 subpartition sub1 values (1,2,3,4,5),
7 subpartition sub2 values (6,7,8,9,10)
8 )
9 (
10 partition p1 values less than (10),
11 partition p2 values less than (20),
12 partition p3 values less than (30)
13 )
14 /
Table created
---組合分割槽之子分割槽型別hash
---建立子分割槽型別hash方法一
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by hash(b)
4 subpartitions 2
5 (
6 partition p1 values less than (10),
7 partition p2 values less than (20),
8 partition p3 values less than (30)
9 )
10 /
Table created
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by hash(b)
4 subpartitions 2
5 (
6 partition p1 values less than (10),
7 partition p2 values less than (20),
8 partition p3 values less than (30)
9 )
10 /
Table created
---建立子分割槽型別hash方法二
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by hash(b)
4 subpartition template
5 (subpartition sub1,
6 subpartition sub2
7 )
8 (
9 partition p1 values less than (10),
10 partition p2 values less than (20),
11 partition p3 values less than (30)
12 )
13 /
Table created
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by hash(b)
4 subpartition template
5 (subpartition sub1,
6 subpartition sub2
7 )
8 (
9 partition p1 values less than (10),
10 partition p2 values less than (20),
11 partition p3 values less than (30)
12 )
13 /
Table created
---建立子分割槽型別hash方法方法三(注:子分割槽可混合並用subpartition和subpartition)
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by hash(b)
4 (
5 partition p1 values less than (10)
6 subpartitions 2,
7 partition p2 values less than (20)
8 (subpartition subp1,
9 subpartition subp2),
10 partition p3 values less than (30)
11 )
12 /
Table created
SQL> create table t_partition(a int,b int)
2 partition by range(a)
3 subpartition by hash(b)
4 (
5 partition p1 values less than (10)
6 subpartitions 2,
7 partition p2 values less than (20)
8 (subpartition subp1,
9 subpartition subp2),
10 partition p3 values less than (30)
11 )
12 /
Table created
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-752465/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 分割槽Partition
- Oracle Partition 分割槽詳細總結Oracle
- 組合模式(Composite)模式
- 分割槽partition知識點
- composite pattern(組合模式)模式
- Oracle查詢Interval partition分割槽表內資料Oracle
- Spark學習——分割槽Partition數Spark
- B. Range and Partition
- 分割槽函式Partition By的基本用法函式
- Kafka分割槽分配策略(Partition Assignment Strategy)Kafka
- 分割槽函式partition by的基本用法【轉載】函式
- 《設計模式》 - 7. 組合模式( Composite )設計模式
- [C++設計模式] composite 組合模式C++設計模式
- 設計模式之組合模式(Composite)分享設計模式
- C#設計模式-組合模式(Composite Pattern)C#設計模式
- oracle partition by group by,詳解partition by和group by對比Oracle
- 使用parted建立大分割槽時 mkpart Warning: The resulting partition is not properly
- oracle partition by 語法Oracle
- Partition|Disk Utility 如何分割磁碟
- 理解 Go 語言中的組合字面量(Composite Literal)Go
- Oracle分割槽表基礎運維-07增加分割槽(6RANGE_RANGE)Oracle運維
- MySQL全面瓦解29:使用Partition功能實現水平分割槽MySql
- Oracle分割槽表基礎運維-05組合分割槽Oracle運維
- 02. 複合型別(Composite Types)型別
- 【設計模式自習室】結構型:組合模式 Composite設計模式
- Partition Pruning和Partition-Wise Joins
- 使用C# (.NET Core) 實現組合設計模式 (Composite Pattern)C#設計模式
- B. Composite Coloring
- 【Abaqus】Composite Layup建模
- Body SweptSolid Composite GeometrySolid
- Oracle分割槽表基礎運維-07增加分割槽(4 RANGE_HASH)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(5RANGE_LIST)Oracle運維
- Clique Partition
- 6 Thing that determine composite cost
- Laravel Query Builder 複雜查詢案例:子查詢實現分割槽查詢 partition byLaravelUI
- 設計模式系列之組合模式(Composite Pattern)——樹形結構的處理設計模式
- 如何讓阿三 Windows 10、11 的恢復分割槽(Recovery Partition)恢復到 “蓋茨” 模式Windows模式
- 7.74 DATAOBJ_TO_PARTITIONOBJ
- 86. Partition List