1.언두 세그먼트의 설정과 목적
자동언두관리,수동언두관리
트랜잭션 롤백= 취소
트랜잭션 복구= 복구
읽기 일관성= 커밋이 안되었다면,커밋이전의 정보를 보여줌
2.언두세그먼트 종류
시스템 언두 세그먼트(system table정보)
넌 시스템 언두 세그먼트(그외 정보)
3.언두세그먼트 관리
undo_management = auto
undo_tablespace = undotb01
4.언두테이블스페이스의 생성
생성
create database PSU
...
undo tablespace undo01
datafile '경로/파일' size 20M
autoextend on
파일추가
create undo tablespace undo01
datafile '경로/파일' size 20M
extent management local uniform size 5M;
변경
alter tablespace undots
datafile '경로/파일' size 50M
autoextend on;
(sp파일) alter system set undo_tablespace=undotbs2;
(p파일) 파라미터 위와같이 변경
삭제
drop tablespace undotbs2;
현재 진행중인 트랜잭션이 있는 지 확인방법(v$rollname, V$rollstat 조인해서)
-> DATAFILE도 같이 삭제 including contents and datafiles
5.언두에러 설정
undo_suppress_erros =true 놓을시 대충 넘어감
cf)롤포워드(lgw->dbw),롤백(undo세그먼트->dbw)
8.언두테이블 스페이스의 크기조정
(UR) undo_retention =시간설정 (롤백할 자료들을 900초까지는 저장해놓음)
alter system set undo_retention=900;
show parameter undo_retention
(UPS) v$undostat -1초에 발생되는 언두 데이터 블록의 수
(DBS) db_block_size
undospace= [UR*(UPS*DBS)]+(DBS*24)
UR= select value from v$parameter where name ='undo_retention'
UPS= select sum(undoblks)/sum((end_time-begin_time)*86400)) from v$undostat
DBS= select value from V$parameter where name ='db_block_size'
--------------실습-------------------------------------
1.temporary테이블 스페이스 설정 확인
select * from dba_temp
select * from database_properties where property_name like '%TEMP%';
2.temporary테이블 생성과 default temporary 테이블스페이스 지정
생성
create temporary tablespace tmp
tempfile '/경로/tmp01.dbf' size 10M;
디폴트로 지정(tmp를)
alter database default temporary tablespace tmp;
3. temporary 테이블스페이스 삭제
drop tablespace tmp; 디폴트로 지정중인 것은 삭제 불가능
drop tablespace temp
(including contents and datafiles)
;
4.undo 테이블스페이스 생성과 관리
새파라미터의 설정
undo_management= auto [manual]
undo_tablespace = undotbs1
undo_suppress_errors = true 10는 설정되어있지않음
undo_retention = integer (시간:초)
a1. 현재 undo관련설정확인(10g실행 필요 없으)
show parameter undo;
8i명령어 create rollback segment rbs01 tablespace users;
alter system set undo_suppress_errors = true 10g실행안함
create rollback segment rbs01 tablespace users;
파라미터변경 inittestdb.ora
a2. undo테이블스페이스 생성과 default undo 테이블스페이스 지정
create undo tablespace undo
datafile '경로/undo01.dbf' size 10M
select * from dba_data_files 확인
alter system set undo_tablespace= undo; 언두 테이블 스페이스 설정
show parameter undo;
select * from dba_rollback_segs;