select STATUS, sum(bytes)/1024/1024/1024 GB from dba_undo_extents group by status;
select status, file_id, sum(bytes)/1024/1024 MB
from DBA_UNDO_EXTENTS
where tablespace_name='UNDOTBS1'
group by file_id, status
order by status, file_id;
. 임시 undotbs02번 생성
CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE '/oradata/undotbs02.dbf' SIZE 10M;
2. 기본 undotbs를 undotbs2로 변경
ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS2;
3. undotbs1 삭제
DROP TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES;
4. undotbs1 재생성
CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE '/oradata/undotbs01.dbf' SIZE 500M;
5. 기본 undotbs를 undotbs1로 변경
ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS1;
6. 임시 undotbs2 삭제
DROP TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;
======redo 조회
select a.group#,a.type,a.member,b.bytes,b.archived,b.status
from v$logfile a, v$log b
where a.group#=b.group#
order by 1,2;
alter database add logfile group4
'/app_src/oracle/oradata/db11g/redo04.log' size 5M;
alter system switch logfile;
SQL> alter system switch logfile;
으로 해당 파일을 inactive 상태로 변경후 삭제 하여야 한다.
삭제 SQL 은 다음과 같다.
SQL> alter database drop logfile group 4;
각 user 에서 사용중인 rollback segment 를 알아내는 script 이다.
1)PROCESS ID 로 check 하고 싶을때 :
SELECT r.name "ROLLBACK SEGMENT NAME ",
l.sid "ORACLE PID",
p.spid "SYSTEM PID ",
NVL ( p.username , 'NO TRANSACTION'),
p.terminal
FROM v$lock l, v$process p, v$rollname r, v$session s
WHERE l.sid = s.sid and s.paddr=p.addr
AND TRUNC (l.id1(+)/65536) = r.usn
AND l.type(+) = 'TX'
AND l.lmode(+) = 6
ORDER BY r.name
~
2)SESSION ID별로 check 하고 싶을때
select s.sid, s.username, r.name "ROLLBACK SEG"
from v$session s, v$transaction t, v$rollname r
where s.taddr=t.addr
and t.xidusn = r.usn;
트랜잭션 산정 select sid,event,p1,p2,p3, used_ublk, used_urec
from v$session s,v$transaction t
where s.taddr=t.addr
오라크ㅗ