SQL> alter table p_emp rename partition emp_p1 to emp_p01;
SQL> alter table p_emp rename partition emp_p2 to emp_p02;
SQL> alter table p_emp rename partition emp_p3 to emp_p03;
SQL> select table_name,partition_name,high_value from dba_tab_partitions where table_name = 'P_EMP';
TABLE_NAME PARTITION_NAME HIGH_VALUE
------------------------------ ------------------------------ ----------
P_EMP EMP_MAX MAXVALUE
P_EMP EMP_P01 2000
P_EMP EMP_P02 3000
P_EMP EMP_P03 4000
partition table의 partition 이름 변경시 index의 partition 이름은 같이 변경되지 않는다. 따라서 index partition이름도 같이 변경해 주어야 한다.
SQL> select INDEX_NAME,PARTITION_NAME,HIGH_VALUE,STATUS from dba_ind_partitions where index_name = 'P_EMP_I';
INDEX_NAME PARTITION_NAME HIGH_VALUE STATUS
-------------------- ------------------------------ ---------- --------
P_EMP_I EMP_MAX MAXVALUE USABLE
P_EMP_I EMP_P1 2000 USABLE
P_EMP_I EMP_P2 3000 USABLE
P_EMP_I EMP_P3 4000 USABLE
SQL> ALTER INDEX p_emp_i RENAME PARTITION emp_p1 TO emp_p01;
SQL> ALTER INDEX p_emp_i RENAME PARTITION emp_p2 TO emp_p02;
SQL> ALTER INDEX p_emp_i RENAME PARTITION emp_p3 TO emp_p03;
SQL> select INDEX_NAME,PARTITION_NAME,HIGH_VALUE,STATUS from dba_ind_partitions where index_name = 'P_EMP_I';
INDEX_NAME PARTITION_NAME HIGH_VALUE STATUS
-------------------- ------------------------------ ---------- --------
P_EMP_I EMP_MAX MAXVALUE USABLE
P_EMP_I EMP_P01 2000 USABLE
P_EMP_I EMP_P02 3000 USABLE
P_EMP_I EMP_P03 4000 USABLE
SQL> alter table p_emp rename partition emp_p2 to emp_p02;
SQL> alter table p_emp rename partition emp_p3 to emp_p03;
SQL> select table_name,partition_name,high_value from dba_tab_partitions where table_name = 'P_EMP';
TABLE_NAME PARTITION_NAME HIGH_VALUE
------------------------------ ------------------------------ ----------
P_EMP EMP_MAX MAXVALUE
P_EMP EMP_P01 2000
P_EMP EMP_P02 3000
P_EMP EMP_P03 4000
partition table의 partition 이름 변경시 index의 partition 이름은 같이 변경되지 않는다. 따라서 index partition이름도 같이 변경해 주어야 한다.
SQL> select INDEX_NAME,PARTITION_NAME,HIGH_VALUE,STATUS from dba_ind_partitions where index_name = 'P_EMP_I';
INDEX_NAME PARTITION_NAME HIGH_VALUE STATUS
-------------------- ------------------------------ ---------- --------
P_EMP_I EMP_MAX MAXVALUE USABLE
P_EMP_I EMP_P1 2000 USABLE
P_EMP_I EMP_P2 3000 USABLE
P_EMP_I EMP_P3 4000 USABLE
SQL> ALTER INDEX p_emp_i RENAME PARTITION emp_p1 TO emp_p01;
SQL> ALTER INDEX p_emp_i RENAME PARTITION emp_p2 TO emp_p02;
SQL> ALTER INDEX p_emp_i RENAME PARTITION emp_p3 TO emp_p03;
SQL> select INDEX_NAME,PARTITION_NAME,HIGH_VALUE,STATUS from dba_ind_partitions where index_name = 'P_EMP_I';
INDEX_NAME PARTITION_NAME HIGH_VALUE STATUS
-------------------- ------------------------------ ---------- --------
P_EMP_I EMP_MAX MAXVALUE USABLE
P_EMP_I EMP_P01 2000 USABLE
P_EMP_I EMP_P02 3000 USABLE
P_EMP_I EMP_P03 4000 USABLE
'Oracle Database' 카테고리의 다른 글
DB link를 통한 remote DB를 query하는데 적용되는 10가지 법칙 (2) | 2009.10.23 |
---|---|
oracle pre complier의 그 유명한 hold_cursor/release_cursor option (0) | 2009.10.22 |
oracle partition table 중간에 partition 추가하기 (split partition) (0) | 2009.10.22 |
oracle의 Instance Load Balancing (client-side vs server-side) (8) | 2009.10.13 |
Oracle SQLPLUS에서 CASE문 사용하기 (4) | 2009.10.12 |