显示oracle的各种文件(报表显示)

set pages 200
set lines 132
set trims on

col name new_value x noprint
select name from v$database;


spool s_db_files_all.&x..log

col file_name format a40 heading "Data File Name"
col tabsp_name format a15 heading "Tablespace Name"
col max_size format 999,999,999.99 heading "Max|Size MB"
col inc_by format 999,999.99 heading "Increment|By MB"
col unallocated format 999,999.99 heading "Unallocated|MB"
col cur_size format 999,999,999.99 heading "Current|Size MB"


break on mount_point skip 1
col mount_point format a8 heading "Mnt"
compute sum of max_size cur_size unallocated on mount_point

select  SUBSTR(fn.name,1,DECODE(INSTR(fn.name,'/',2),0,INSTR(fn.name,':',1),INSTR(fn.name,'/',2))) mount_point
,       tn.name
   tabsp_name
,
fn.name
   file_name
,
ddf.bytes/1024/1024
   cur_size
,
decode(fex.maxextend,
                NULL,ddf.bytes/1024/1024
                    ,fex.maxextend*tn.blocksize/1024/1024) max_size
,       nvl(fex.maxextend,0)*tn.blocksize/1024/1024 -
        decode(fex.maxextend,NULL,0,ddf.bytes/1024/1024)   unallocated
,
nvl(fex.inc,0)*tn.blocksize/1024/1024
   inc_by
from
sys.v_$dbfile
fn
,
sys.ts$
tn
,
sys.filext$
fex
,
sys.file$
ft
,
DBA_data_files
ddf
where
fn.file# = ft.file#
and
fn.file# = ddf.file_id
and
tn.ts# = ft.ts#
and
fn.file# = fex.file#(+)
order by 1
/

col redo_logs format a45

select
group#, status, member redo_logs
from
v$logfile
/

select * from v$log
/

col control_files format a45

select
name control_files
from
v$controlfile
/

spool off
标签: 暂无标签
oraunix

写了 199 篇文章,拥有财富 1026,被 339 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

P5 | 发表于 2014-3-8 08:56:23
xuexixuexi
回复

使用道具

P3 | 发表于 2014-3-11 21:20:15
学习了
回复

使用道具

P5 | 发表于 2014-3-13 08:41:18
学习了
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈