안녕하세요 테이블 스페이스가 갑자기 늘어났습니다.
체크는 아래 쿼리로 했구요..결과를 매주마다 체크했는데 특정 테이블 스페이스가 늘어났습니다.
그런데 어떤 테이블 때문에 늘어났는지 알수 있는 방법없을까요?
그리고 다른 질문인데 최근의 insert 된 트랜잭션을 조회하는 방법없을까요? 날짜별루요..
답변부탁드립니다.
SELECT 'dummy' "Dummy",
ts.tablespace_name "Ts",
count(*) "NbrFiles",
ts.status "Status",
sum(bytes)/(1024*1024) "Size",
sum(decode(maxbytes,0,bytes,maxbytes)-bytes)/(1024*1024) "MaxAutoExt",
round(100*(1-(nvl(fs.SumFree,0)+
(sum(decode(maxbytes,0,bytes,maxbytes)-bytes)/(1024*1024)))/
sum(decode(maxbytes,0,bytes,maxbytes)/(1024*1024)))) "PctUsed",
nvl(fs.SumFree,0) "SumFree",
to_char(decode(fs.MaxFree,null,0,fs.MaxFree),'99G999G999') "MaxFree",
allocation_type "AllType",
initial_extent/1024 "InExt",
block_size "BlockSize",
segment_space_management "ASSM"
FROM dba_tablespaces ts,
dba_data_files df,
( SELECT tablespace_name,
sum(bytes)/(1024*1024) SumFree,
max(bytes)/1024 MaxFree
FROM dba_free_space
GROUP BY tablespace_name ) fs
WHERE ts.tablespace_name = df.tablespace_name
AND ts.tablespace_name = fs.tablespace_name (+)
GROUP BY ts.tablespace_name, ts.status, allocation_type, initial_extent,
block_size, fs.SumFree, fs.MaxFree, segment_space_management
union all
SELECT 'dummy' "Dummy",
ts.tablespace_name "Ts",
count(bytes) "NbrFiles", -- instead of count(*), use a column which is null if the temp file is missing
ts.status "Status",
sum(bytes)/(1024*1024) "Size",
sum(decode(maxbytes,0,bytes,maxbytes)-bytes)/(1024*1024) "MaxAutoExt",
to_number(null) "PctUsed",
to_number(null) "SumFree",
' temporary' "MaxFree",
allocation_type "AllType",
initial_extent/1024 "InExt",
block_size "BlockSize",
segment_space_management "ASSM"
FROM dba_tablespaces ts,
dba_temp_files tf
WHERE ts.contents = 'TEMPORARY'
AND ts.tablespace_name = tf.tablespace_name (+)
GROUP BY ts.tablespace_name, ts.status, allocation_type, initial_extent,
block_size, 5, 6, segment_space_management
ORDER BY "Ts";