一、查看整个数据库使用总空间
select sum("file_size(M)") as "total_size(M)" from (
select 'SPFILE' as "file_type",value as "file_name",1 as "file_size(M)" from v$parameter where name ='spfile'
UNION
select 'CONTROL' as "file_type",name as "file_name",round(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024,2) as "file_size(M)" from v$controlfile
UNION
select 'REDOLOG' as "file_type",v$logfile.member as "file_name",round(v$log.bytes/1024/1024,2) as "file_size(M)" from v$log,v$logfile where v$log.group#=v$logfile.group#
UNION
select 'TEMP' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$tempfile
UNION
select 'DATAFILE' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$datafile
);
select * from (
select 'SPFILE' as "file_type",value as "file_name",1 as "file_size(M)" from v$parameter where name ='spfile'
UNION
select 'CONTROL' as "file_type",name as "file_name",round(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024,2) as "file_size(M)" from v$controlfile
UNION
select 'REDOLOG' as "file_type",v$logfile.member as "file_name",round(v$log.bytes/1024/1024,2) as "file_size(M)" from v$log,v$logfile where v$log.group#=v$logfile.group#
UNION
select 'TEMP' as "file_type&