溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

oracle temp表空間相關知識點有哪些

發(fā)布時間:2021-11-09 11:56:30 來源:億速云 閱讀:259 作者:iii 欄目:關系型數據庫

本篇內容主要講解“oracle temp表空間相關知識點有哪些”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“oracle temp表空間相關知識點有哪些”吧!

1.  查詢空間的使用率,有用視圖dba_temp_file,   v$temp_extent_pool。

select c.tablespace_name,       

       to_char(c.bytes / 1024 / 1024 / 1024, '99,999.999') total_gb,       

       to_char((c.bytes - d.bytes_used) / 1024 / 1024 / 1024, '99,999.999') free_gb,       

       to_char(d.bytes_used / 1024 / 1024 / 1024, '99,999.999') use_gb,       

       to_char(d.bytes_used * 100 / c.bytes, '99.99') || '%' use

  from (select tablespace_name, sum(bytes) bytes        

          from dba_temp_files

         GROUP by tablespace_name) c,       

       (select tablespace_name, sum(bytes_cached) bytes_used        

          from v$temp_extent_pool

         GROUP by tablespace_name) d

 where c.tablespace_name = d.tablespace_name;

2.   查看那些用戶正在適用temp表空間,用到視圖v$tempseg_usage,  v$temp_space_header

select a.username,       

       a.sql_id,       

       a.SEGTYPE,

       a.tablespace,       

       b.BYTES_USED / 1024 / 1024 / 1024,      

       b.BYTES_FREE / 1024 / 1024 / 1024

  from V$TEMPSEG_USAGE a  ,V$TEMP_SPACE_HEADER b 

  where a.TABLESPACE = b.tablespace_name 

  and a.tablespace='TEMP';

3. 根據查詢到的sql_id值去查看那些session正在適用temp。

到此,相信大家對“oracle temp表空間相關知識點有哪些”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續(xù)學習!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI