--> 가능하게 하려면 undo tablespace의 retention을 guarantee 해줘야함
SYS @ ORA19 > show parameter undo_tablespace
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_tablespace string UNDOTBS1
SYS @ ORA19 > select tablespace_name, retention
from dba_tablespaces
where tablespace_name='UNDOTBS1';
TABLESPACE_NAME RETENTION
------------------------------ -----------
UNDOTBS1 NOGUARANTEE
SYS @ ORA19 >
alter tablespace 테이블스페이스_이름 retention guarantee;
SYS @ ORA19 > alter tablespace undotbs1 retention guarantee;
테이블스페이스가 변경되었습니다.
SYS @ ORA19 > select tablespace_name, retention
from dba_tablespaces
where tablespace_name='UNDOTBS1';
TABLESPACE_NAME RETENTION
------------------------------ -----------
UNDOTBS1 GUARANTEE
SYS @ ORA19 >
--> GUARANTEE로 변경됨
- update가 더 중요하면 --> noguarantee로 해줘야됨
- flashback이 더 중요하면 --> guarantee로 해줘야합니다.
SYS @ ORA19 > alter tablespace UNDOTBS1 retention noguarantee;
테이블스페이스가 변경되었습니다.
SYS @ ORA19 > select tablespace_name, retention
2 from dba_tablespaces
3 where tablespace_name='UNDOTBS1';
TABLESPACE_NAME RETENTION
------------------------------ -----------
UNDOTBS1 NOGUARANTEE
SYS @ ORA19 >
3600초 = 1시간
-- undo_retention을 1시간으로 변경
SYS @ ORA19 > alter system set undo_retention=3600;
시스템이 변경되었습니다.
-- 잘 변경되었는지 확인
SYS @ ORA19 > select name, value
2 from v$parameter
3 where name='undo_retention';
NAME
------------------------------------------------------------------------------ --
VALUE
------------------------------------------------------------------------------ --
undo_retention
3600
-- undotbs1의 retention 설정을 gurantee로 설정
SYS @ ORA19 > alter tablespace undotbs1 retention guarantee;
테이블스페이스가 변경되었습니다.
-- 혹시 ts.sql이 저장되어있지 않으면 설정하기
SYS @ ORA19 > !cat ts.sql
col tablespace_name for a10
col file_name for a55
col mb_size for 9999
select tablespace_name, file_name, bytes/1024/1024 mb_size
from dba_data_files
order by tablespace_name asc;
-- UNDOTBS1의 size 확인: 340m
SYS @ ORA19 > @ts
TABLESPACE FILE_NAME MB_SIZE
---------- ------------------------------------------------------- -------
HR_DATA_TS /u01/app/oracle/oradata/ORA19/hr_data_ts01.dbf 1024
HR_INDEX_T /u01/app/oracle/oradata/ORA19/hr_index_ts01.dbf 1024
S
OWI_TBS /home/oracle/owi01.dbf 330
SYSAUX /u01/app/oracle/oradata/ORA19/sysaux01.dbf 710
SYSAUX /u01/app/oracle/oradata/ORA19/sysaux02.dbf 100
SYSTEM /u01/app/oracle/oradata/ORA19/system01.dbf 900
TEST_BIG /u01/app/oracle/oradata/ORA19/test_big.dbf 20
TS300 /u01/app/oracle/oradata/ORA19/ts300.dbf 10
TS7000 /u01/app/oracle/oradata/ORA19/ts7000.dbf 10
TABLESPACE FILE_NAME MB_SIZE
---------- ------------------------------------------------------- -------
UNDOTBS1 /u01/app/oracle/oradata/ORA19/undotbs01.dbf 340
USERS /u01/app/oracle/oradata/ORA19/users01.dbf 5
11 행이 선택되었습니다.
-- undo tablespace의 공간 2배(680m)로 늘리기
SYS @ ORA19 > alter database datafile '/u01/app/oracle/oradata/ORA19/undotbs01.dbf' resize 680m;
데이타베이스가 변경되었습니다.
-- 잘 변경되었는지 확인
SYS @ ORA19 > @ts
TABLESPACE FILE_NAME MB_SIZE
---------- ------------------------------------------------------- -------
HR_DATA_TS /u01/app/oracle/oradata/ORA19/hr_data_ts01.dbf 1024
HR_INDEX_T /u01/app/oracle/oradata/ORA19/hr_index_ts01.dbf 1024
S
OWI_TBS /home/oracle/owi01.dbf 330
SYSAUX /u01/app/oracle/oradata/ORA19/sysaux01.dbf 710
SYSAUX /u01/app/oracle/oradata/ORA19/sysaux02.dbf 100
SYSTEM /u01/app/oracle/oradata/ORA19/system01.dbf 900
TEST_BIG /u01/app/oracle/oradata/ORA19/test_big.dbf 20
TS300 /u01/app/oracle/oradata/ORA19/ts300.dbf 10
TS7000 /u01/app/oracle/oradata/ORA19/ts7000.dbf 10
TABLESPACE FILE_NAME MB_SIZE
---------- ------------------------------------------------------- -------
UNDOTBS1 /u01/app/oracle/oradata/ORA19/undotbs01.dbf 680
USERS /u01/app/oracle/oradata/ORA19/users01.dbf 5
11 행이 선택되었습니다.
SYS @ ORA19 >