進入oracle數(shù)據庫中,輸入以下代碼即可
select total.tablespace_name,
round(total.MB, 2) as Total_MB,
round(total.MB - free.MB, 2) as Used_MB,
round((1 - free.MB / total.MB) 100, 2) || '%' as Used_Pct
from (select tablespace_name, sum(bytes) / 1024 / 1024 as MB
from dba_free_space
group by tablespace_name) free,
(select tablespace_name, sum(bytes) / 1024 / 1024 as MB
from dba_data_files
group by tablespace_name) total
where free.tablespace_name = total.tablespace_name;
SELECT a.tablespace_name, a.BYTES total, a.bytes - nvl(b.bytes, 0) free FROM (SELECT tablespace_name, SUM (bytes) bytes FROM dba_temp_files GROUP BY tablespace_name) a,(SELECT tablespace_name, SUM (bytes_cached) bytes FROM v$temp_extent_pool GROUP BY tablespace_name) b WHERE a.tablespace_name = b.tablespace_name(+)
SELECT temp_used.tablespace_name,total - used as "Free",total as "Total",round(nvl(total - used, 0) 100 / total, 3) "Free percent" FROM (SELECT tablespace_name, SUM(bytesused) / 1024 / 1024 used FROM GV$TEMP_SPACE_HEADER GROUP BY tablespace_name) temp_used,(SELECT tablespace_name, SUM(bytes) / 1024 / 1024 total FROM dba_temp_files GROUP BY tablespace_name) temp_total WHERE temp_used.tablespace_name = temp_total.tablespace_name;
成都創(chuàng)新互聯(lián)公司是由多位在大型網絡公司、廣告設計公司的優(yōu)秀設計人員和策劃人員組成的一個具有豐富經驗的團隊,其中包括網站策劃、網頁美工、網站程序員、網頁設計師、平面廣告設計師、網絡營銷人員及形象策劃。承接:成都做網站、網站制作、網站改版、網頁設計制作、網站建設與維護、網絡推廣、數(shù)據庫開發(fā),以高性價比制作企業(yè)網站、行業(yè)門戶平臺等全方位的服務。
那些語句待用臨時表空間
SELECT se.username,sid,serial#,sql_address,machine,program,tablespace,segtype,contents FROM v$session se, v$sort_usage su WHERE se.saddr = su.session_addr;