LOB LOBSEGMENT, LOBINDEX 넘기는 방법
1. SELECT OWNER,SEGMENT_NAME, SEGMENT_TYPE, BYTES , TABLESPACE_NAME
FROM DBA_SEGMENTS
WHERE
SEGMENT_NAME = 'TEST_LOB' OR
SEGMENT_NAME IN ( SELECT SEGMENT_NAME FROM DBA_LOBS WHERE TABLE_NAME='TEST_LOB') OR
SEGMENT_NAME IN ( SELECT INDEX_NAME FROM DBA_LOBS WHERE TABLE_NAME='TEST_LOB');
=>> 테이블, LOBSEGMENT, LOBINDEX 확인 하는쿼리
2. SELECT OWNER,SEGMENT_NAME,PARTITION_NAME,SEGMENT_TYPE,BYTES/1024/1024
FROM DBA_SEGMENTS
WHERE TABLESPACE_NAME='TEST_TS' AND OWNER='SCOTT'
ORDER BY 2,3 DESC; <<==실행 TEST_TS에 있는 LOB테이블 확인
테이블스페이스에 존재하는 테이블들
TABLE---------
SELECT 'ALTER TABLE '||OWNER||'.'||TABLE_NAME||' MOVE LOB('||COLUMN_NAME||') STORE AS (TABLESPACE TEST) TABLESPACE TEST;'
FROM DBA_LOBS WHERE TABLESPACE_NAME='TEST_TS' AND OWNER='SCOTT';
<<== LOB 데이터 이관쿼리문
SELECT 'ALTER TABLE '||OWNER||'.'||SEGMENT_NAME||' MOVE TABLESPACE 이동할 테이블스페이스;'
FROM DBA_SEGMENTS WHERE TABLESPACE_NAME='TEST_TS' AND OWNER='SCOTT' AND SEGMENT_NAME NOT LIKE 'BIN%';
INDEX --------
SELECT 'ALTER INDEX '||OWNER||'.'||SEGMENT_NAME||' REBUILD TABLESPACE 이동할 테이블스페이스 ;'
FROM DBA_SEGMENTS WHERE TABLESPACE_NAME='TEST_IDX' AND OWNER='SCOTT' AND SEGMENT_TYPE='INDEX';
결과
ALTER TABLE SCOTT.TEST_LOB MOVE LOB(META) STORE AS (TABLESPACE TEST) TABLESPACE TEST;
ALTER INDEX SCOTT.IDX_TABLE_LOB REBUILD TABLESPACE TEST;
'DBMS > Oracle' 카테고리의 다른 글
database 기본정보, 설치된 옵션 (0) | 2022.07.04 |
---|---|
JOB 관리 (0) | 2022.07.04 |
cursors(커서) 관리 (0) | 2022.07.04 |
SGA,PGA 메모리 할당 조회 (0) | 2022.07.04 |
tablespace별 사용량 보기 (0) | 2022.07.04 |