본문 바로가기

oracle

[ORACLE] TABLE, INDEX TABLESPACE MOVE

728x90

TABLE

<일반 테이블>
SQL> alter table scott.emp move tablespace users [parallel 4] [nologging];
SQL> alter table scott.emp [parallel 1] [logging]; -- 운영타입에 따라 테이블의 parallel과 logging 수정

<파티션 테이블>
SQL> alter table scott.emp move partition p_202302 tablespace users [parallel 4] [nologging];
SQL> alter table scott.emp partition p_202302 [parallel 1] [logging]; -- 운영타입에 따라 테이블의 parallel과 logging 수정
SQL> alter table partition modify default attributes tablespace users; -- 파티션 테이블 무브한 테이블스페이스로 디폴트 테이블스페이스 변경해줌


INDEX

<일반 인덱스>
SQL> alter index scott.emp_idx rebuild tablespace users [online] [parallel 4] [nologging];
SQL> alter index scott.emp_idx   [parallel 1] [logging];

<파티션 인덱스>
SQL> alter index scott.emp_idx rebuild partition p_202302 tablespace users [online] [parallel 4] [nologging];
SQL> alter index scott.emp_idx partition p_202302  [parallel 1] [logging]; -- 운영타입에 따라 인덱스의 parallel과 logging 수정

728x90