Partition Table(2) - Management

2009. 6. 17. 14:28Oracle/Oracle Study

반응형
이번에는 Partition Table에 대한 기본적인 관리에 대해서 정리하고자 합니다.

dba_tab_partitions, all_tab_partitions, user_tab_partitions (partition table에 대한 정보가 나와요)

* 파티션 테이블 스페이스 추가.
SQL> alter table range_emp add partition range_p4 values less than(5000) tablespace tbs4;
SQL> alter table range_emp add partition range_p5 values less than(maxvalue) tablespace tbs5;

위와 같이 추가해 줄수 있으며 maxvalue가 설정이 되었을 경우는 더이상 추가를 해줄수가 없습니다.
그러나 maxvalue 파티션 부분을 분할 해 줄수 있습니다.

* 파티션 테이블 스페이스 분할.
SQL> alter table range_emp split partition range_p5 at(6000) 
2 into (partition range_p6 tablespace p6, partition range_p5 tablespace p5);
  -- range_p5 파티션을 range_p6으로 split(분할) 한다.

* 파티션 테이블 스페이스 삭제.
SQL> alter table range_emp drop partition range_p5;

* 파티션 테이블 데이터 삭제.
SQL> delete from range_emp partition (range_p1);
SQL> alter table range_emp truncate partition range_p1;

* 파티션 테이블 스페이스 이름 변경
SQL> alter table range_emp rename partition range_p6 to range_p7;

* 파티션 테이블 스페이스 옮기기
SQL> alter table range_emp move partition range_p7 tablespace tbs7;

위 명령어들을 하나씩 실행시키면서 object를 확인해보면 어떻게 변경이 되는지 이해하실겁니다.



※참고 url

----------------------------------------------------------------------------------
아래 사항은 너무 오래전에 했던거라 다시한번 해봐야 될것같아 확실히 말을 못하겠습니다.
예전 제가 요약한건데..이해를 못한다는..ㅋㅋㅋㅋ

*partition table의 물리적인 속성 변경하기.
alter table part_tbl storage(next 10M); : part_tbl의 모든 partition의 next 값이 변경된다.
alter table part_tbl modify partition part_tbl_200805 storage (maxextents 1000);
: part_tbl_200805 partition의 maxextents 값만 변경한다.

*파티션 상태 확인
select index_name,partiton_name,high_value,status,tablespace_name
from user_ind_partitions;

* partition index rebuild
alter index 인덱스이름 rebuild partition 파티션 이름;

*global index rebuild 하기
alter index 인데스이름 rebuild;

반응형

'Oracle > Oracle Study' 카테고리의 다른 글

number(p,s) : precision, scale ora-01438  (0) 2009.12.10
Oracle Default DB 내 맘대로 바꾸기.  (0) 2009.11.19
Partition Table(1) - Create  (0) 2009.06.17
Row Migration  (0) 2008.11.30
10g Archive Mode로 변경  (0) 2008.10.01