数据库环境简易检测(二)
sga;
tti '***** Log Files ******'
select group# AS GroupNum,members AS GroupMem,bytes/1024/1024 MB from v$log order by GroupNum;
www.2cto.com
col Locate for a70
select group# AS GroupNum,status ,type ,member AS Locate from v$logfile order by GroupNum;
tti '***** Control Files ******'
col Locate for a70
select name AS Locate from v$controlfile;
tti '***** Temp Files ******'
select file#,status AS Status,bytes/1024/1024 MB,name Locate from v$tempfile;
tti '***** Data File ******'
col FileName for a65
col TableSP for a15
col FileNum for 999
select a.file_id AS FileNum,a.file_name AS FileName,a.tablespace_name AS TableSP,a.bytes/1024/1024 MB,
a.status AS Status,b.status AS status ,b.CREATION_TIME
from dba_data_files a,v$datafile b where a.file_name=b.name order by a.file_id;
tti '***** Tablespace ******'
select tablespace_name AS TName,extent_management AS SegMana,allocation_type AS TType,segment_space_management AS SegSMana
from dba_tablespaces;
tti '***** TUsed ******'
select f.tablespace_name,a.total "total(M)",a.total-f.free "Used(M)",f.free "Leave(M)",round((f.free/a.total)*100) "Leave(%)"
from (select tablespace_name,sum(bytes/1024/1024) total
from dba_data_files group by tablespace_name)a,
(select tablespace_name,round(sum(bytes/1024/1024)) free
from dba_free_space group by tablespace_name)f
where a.tablespace_name=f.tablespace_name(+) order by "Leave(%)";
--set echo off
spool off