sys使用者檢視資料庫表空間使用情況(ORACLE)

2021-08-08 10:28:23 字數 866 閱讀 4730

--檢視資料庫表空間使用情況,sys使用者登入資料庫:

select a.tablespace_name,a.bytes/1024/1024 "sum mb",

(a.bytes-b.bytes)/1024/1024 "used mb"

,b.bytes/1024/1024 "free mb",

round (((a.bytes-b.bytes)/a.bytes)*100,2) "used%" from

(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,

(select tablespace_name,sum(bytes) bytes,max (bytes) largest from dba_free_space group by tablespace_name)b

where a.tablespace_name=b.tablespace_name

order by ((a.bytes-b.bytes)/a.bytes) desc;

# 總核數 = 物理cpu個數 x 每顆物理cpu的核數 

# 總邏輯cpu數 = 物理cpu個數 x 每顆物理cpu的核數 x 超執行緒數

# 檢視物理cpu個數

cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

# 檢視每個物理cpu中core的個數(即核數)

cat /proc/cpuinfo| grep "cpu cores"| uniq

# 檢視邏輯cpu的個數

cat /proc/cpuinfo| grep "processor"| wc -l

監控資料庫表空間使用情況

1.按使用者查表空間使用情況 select a.tablespace name 表空間名稱,total space 1024 1024 總量,free space 1024 1024 剩餘量,trunc free space total space 100 剩餘比例 from select tabl...

顯示資料庫表空間使用情況

select sysdate 統計時間 d.tablespace name 表空間名稱 d.status 狀態 d.contents 型別 d.extent management 區管理 nvl total.bytes,1 總容量 mb nvl total.bytes free.bytes 1 已使...

檢視 Oracle 表空間使用率

1 用到了 sys.dba free space sys.dba data files 兩個檢視,需要被賦予在這兩個檢視物件上的查詢許可權。connect as sysdba grant select on sys.dba free space to forrest grant select on ...