ORACLE臨時表空間的清理
column TablespaceName format a
column TotalUsedBytes format
column TotalFreeBytes format
column FreeRatio format
column TotalExtensibleBytes format
column TotalExtends format
compute sum label
break on report
select b
round(sum(b
round(sum(a
round(sum(b
round(sum(a
sum(a
from (select sum(bytes) FreeByte
count(*) Extend
file_id FileID
tablespace_name TablespaceName
from dba_free_space
group by file_id
tablespace_name
union all
select sum(bytes_free) FreeByte
count(*) Extend
file_id FileID
tablespace_name TablespaceName
from v$temp_space_header
group by file_id
tablespace_name) a
(select decode(autoextensible
bytes UsedByte
file_id FileID
tablespace_name TablespaceName
from dba_data_files
union all
select decode(autoextensible
bytes UsedByte
file_id FileID
tablespace_name TablespaceName
from dba_temp_files) b
where b
b
group by b
正常來說
法一
庫重啟時
法二
修改一下TEMP表空間的storage參數
SQL>alter tablespace temp increase
SQL>alter tablespace temp increase
法三
SELECT username
sid
serial#
sql_address
machine
program
tablespace
segtype
contents
FROM v$session se
v$sort_usage su
WHERE se
SQL>Alter system kill session
SQL>Alter tablespace TEMP coalesce;
法四
SQL>select ts#
TS# NAME
SQL>alter session set events
說明
temp表空間的TS# 為
其它
SELECT UPPER(F
D
D
TO_CHAR(ROUND((D
F
F
FROM (SELECT TABLESPACE_NAME
ROUND(SUM(BYTES) / (
ROUND(MAX(BYTES) / (
FROM SYS
GROUP BY TABLESPACE_NAME) F
(SELECT DD
ROUND(SUM(DD
FROM SYS
GROUP BY DD
WHERE D
ORDER BY
From:http://tw.wingwit.com/Article/program/Oracle/201311/18994.html