ORACLE下回收TEMP表空间
释放临时表空间
alter tablespace temp shrink space;
--确定TEMP表空间的ts#
SELECT TS#, NAME FROM SYS.TS$;
--执行清理操作 temp表空间的TS# 为 3*, So TS#+ 1= 4
BEGIN FOR CUR IN 1 .. 10 LOOP EXECUTE IMMEDIATE ‘alter session set events ‘‘immediate trace name DROP_SEGMENTS level 4‘‘‘; END LOOP; END; /
查看占用temp表空间对象;
set lines 200 col username for a20 col b.BYTES_USED/1024/1024/1024||‘G‘ for a30 SELECT a.username,a.sql_id,a.SEGTYPE,b.BYTES_USED/1024/1024/1024||‘G‘,b.BYTES_FREE/1024/1024/1024 FROM V$TEMPSEG_USAGE a JOIN V$TEMP_SPACE_HEADER b ON a.TABLESPACE=b.tablespace_name; set line 232 set pagesize 49999 set wrap off col USERNAME for a8 col tablespace for a10 col sql_text for a60 Select se.username,se.sid,se.serial#,su.extents,su.blocks*to_number(rtrim(p.value))as Space,tablespace,segtype,sql_text from v$sort_usage su,v$parameter p,v$session se,v$sql s where p.name=‘db_block_size‘ and su.session_addr=se.saddr and s.hash_value=su.sqlhash and s.address=su.sqladdr order by se.username,se.sid;
TEMP临时表空间的数据文件使用情况
SELECT file_id,TABLESPACE_NAME AS TABLESPACE_NAME,BYTES_USED/1024/1024/1024 AS TABLESAPCE_USED_GB, BYTES_FREE/1024/1024/1024 AS TABLESAPCE_FREE_GB FROM V$TEMP_SPACE_HEADER ORDER BY 1 DESC;
删除临时表空间文件
ALTER TABLESPACE TEMP DROP TEMPFILE ‘/u01/app/oracle/oradata/GSP/temp02.dbf‘;
相关推荐
bfcady 2020-08-16
Hody 2020-08-16
FightFourEggs 2020-08-16
流云追风 2020-07-04
dataminer 2020-06-25
lidongliang 2020-08-16
warden00 2020-06-11
zhangchaoming 2020-06-04
FightFourEggs 2020-06-02
FightFourEggs 2020-05-28
elitechen 2020-05-21
zhangchaoming 2020-05-17
流云追风 2020-05-14
bianxq 2020-04-27
流云追风 2020-04-22
oraclemch 2020-04-19
oraclemch 2020-04-10
oraclemch 2020-02-21
FightFourEggs 2020-02-12
Streamoutput 2020-02-09
talkingDB 2020-02-03
LuoXinLoves 2020-02-02
Streamoutput 2020-01-21
zhangchaoming 2020-01-04