Examples with partition

linkaiyi
Follow

Create composite hash-hash partitioned table

CREATE TABLE departments_courses_hash (  
             department_id NUMBER(4) NOT NULL,   
             department_name VARCHAR2(30),  
             course_id NUMBER(4) NOT NULL)  
     PARTITION BY HASH(department_id)  
     SUBPARTITION BY HASH (course_id) SUBPARTITIONS 8 PARTITIONS 4

Viewing the structure of the composite hash-hash partitioned table

SELECT SUBSTR(TABLE_NAME,1,32), SUBSTR(PARTITION_NAME,1,32), SUBSTR(SUBPARTITION_NAME,1,32) FROM USER_TAB_SUBPARTITIONS WHERE TABLE_NAME ='DEPARTMENTS_COURSES_HASH'
SUBSTR(TABLE_NAME,1,32) SUBSTR(PARTITION_NAME,1,32) SUBSTR(SUBPARTITION_NAME,1,32)
DEPARTMENTS_COURSES_HASH SYS_P4841 SYS_SUBP4816
DEPARTMENTS_COURSES_HASH SYS_P4841 SYS_SUBP4815
DEPARTMENTS_COURSES_HASH SYS_P4841 SYS_SUBP4814
DEPARTMENTS_COURSES_HASH SYS_P4841 SYS_SUBP4813

….

Object has 0 attachments

Was this article helpful?

This article is viewed 56 times!

Recent Viewed Articles

0 Comments

Leave a Comment

Support