< 문제 >

운영중인 Undo tablespace 가 가진 datafile의 size가  너무 크게 늘어나서 새로운
undo tablespace로 변경이 필요할 경우


< 해결 방법 >

1. 운영중인 현재의 undo tablespace name 확인
*****************************************************************

SQL> show parameter undo_tablespace

NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------------
undo_tablespace                      string      UNDOTBS


2. UNDOTBS와 대체할 새로운 undo tablespace를 생성
*****************************************************************

SQL> create undo tablespace undotbs2
2 datafile '/home/oradata/undotbs2.dbf' size 10m
3 autoextend on maxsize 100m;


3. 생성된 undo tablespace를 확인
*****************************************************************

SQL> select tablespace_name, contents, extent_management
2 from dba_tablespaces
3 where contents = 'UNDO';


TABLESPACE_NAME                CONTENTS  EXTENT_MAN
------------------------------ --------- ----------
UNDOTBS                        UNDO      LOCAL
UNDOTBS2                       UNDO      LOCAL


4. undo tablespace에 설정된 rollback segment를 확인
*****************************************************************

SQL> select segment_name, tablespace_name, status
2 from dba_rollback_segs
3 order by 2;


SEGMENT_NAME                   TABLESPACE_NAME                STATUS
------------------------------ ------------------------------ ---------
_SYSSMU1$                      UNDOTBS                         ONLINE
_SYSSMU2$                      UNDOTBS                         ONLINE
_SYSSMU3$                      UNDOTBS                         ONLINE
_SYSSMU4$                      UNDOTBS                         ONLINE
_SYSSMU5$                      UNDOTBS                         ONLINE
_SYSSMU6$                      UNDOTBS                         ONLINE
_SYSSMU7$                      UNDOTBS                         ONLINE
_SYSSMU8$                      UNDOTBS                         ONLINE
_SYSSMU9$                      UNDOTBS                         ONLINE
_SYSSMU10$                     UNDOTBS                         ONLINE
_SYSSMU11$                     UNDOTBS2                        OFFLINE
_SYSSMU12$                     UNDOTBS2                        OFFLINE
_SYSSMU13$                     UNDOTBS2                        OFFLINE
_SYSSMU14$                     UNDOTBS2                        OFFLINE
_SYSSMU15$                     UNDOTBS2                        OFFLINE
_SYSSMU16$                     UNDOTBS2                        OFFLINE
_SYSSMU17$                     UNDOTBS2                        OFFLINE
_SYSSMU18$                     UNDOTBS2                        OFFLINE
_SYSSMU19$                     UNDOTBS2                        OFFLINE
_SYSSMU20$                     UNDOTBS2                        OFFLINE


5. 새로운 undo tablespace를 지정
*****************************************************************
5-1) undotbs2 를 ONLINE 모드로 변경

SQL> alter system set undo_tablespace = undotbs2;

 

5-2) undotbs2 가 ONLINE 모드로 변경되었는지 확인 한다.

SQL> select segment_name, tablespace_name, status
2 from dba_rollback_segs
3 order by 2;

SEGMENT_NAME                   TABLESPACE_NAME                STATUS
------------------------------ ------------------------------ ---------
_SYSSMU1$                      UNDOTBS                         OFFLINE
_SYSSMU2$                      UNDOTBS                         OFFLINE
_SYSSMU3$                      UNDOTBS                         OFFLINE
_SYSSMU4$                      UNDOTBS                         OFFLINE
_SYSSMU5$                      UNDOTBS                         OFFLINE
_SYSSMU6$                      UNDOTBS                         OFFLINE
_SYSSMU7$                      UNDOTBS                         OFFLINE
_SYSSMU8$                      UNDOTBS                         OFFLINE
_SYSSMU9$                      UNDOTBS                         OFFLINE
_SYSSMU10$                     UNDOTBS                         OFFLINE
_SYSSMU11$                     UNDOTBS2                        ONLINE
_SYSSMU12$                     UNDOTBS2                        ONLINE
_SYSSMU13$                     UNDOTBS2                        ONLINE
_SYSSMU14$                     UNDOTBS2                        ONLINE
_SYSSMU15$                     UNDOTBS2                        ONLINE
_SYSSMU16$                     UNDOTBS2                        ONLINE
_SYSSMU17$                     UNDOTBS2                        ONLINE
_SYSSMU18$                     UNDOTBS2                        ONLINE
_SYSSMU19$                     UNDOTBS2                        ONLINE
_SYSSMU20$                     UNDOTBS2                        ONLINE


6. 기존의 undo tablespace를 drop(삭제)
*****************************************************************

SQL> drop tablespace undotbs;

: undotbs 는 이제 사용하지 않고, undotbs2 만 사용할 것이므로 삭제 한다.


%% 주의 %%
- spfile이 아닌 initSID.ora(pfile)를 사용하는 경우

: initSID.ora file(pfile)에 undo_tablespace parameter의 값을
해당 tablespace, 여기서는 변경한 "undotbs2"로 변경 한다.
(pfile 을 수정하기전에는 DB shutdown immediate 후 pfile 을 수정하고
수정 완료 후, DB startup 시킨다.)




'Oracle > AdminⅠ,Ⅱ' 카테고리의 다른 글

External Table  (0) 2011.03.08
ORACLE 정보 확인 view  (0) 2011.03.08
SQL*Loader  (0) 2011.03.08
용어정리  (0) 2011.03.06
OMF (Oracle Managed Files) : 실습  (0) 2011.03.02
Posted by 나른한스누피