- 最后登录
- 2012-7-10
- 在线时间
- 28 小时
- 威望
- 73
- 金钱
- 535
- 注册时间
- 2011-10-14
- 阅读权限
- 50
- 帖子
- 60
- 精华
- 0
- 积分
- 73
- UID
- 35
|
4#
发表于 2012-2-2 19:57:00
原帖由 maclean 于 2012-2-2 19:04 发表
2.
请你跑一下这个脚本 :REM tablespace report
set linesize 200
select a.tablespace_name,
round(a.bytes_alloc / 1024 / 1024) megs_alloc,
round(nvl(b.bytes_free, 0) / 1024 / 1024) megs_f ...
SQL> select a.tablespace_name,
2 round(a.bytes_alloc / 1024 / 1024) megs_alloc,
3 round(nvl(b.bytes_free, 0) / 1024 / 1024) megs_free,
4 round((a.bytes_alloc - nvl(b.bytes_free, 0)) / 1024 / 1024) megs_used,
5 round((nvl(b.bytes_free, 0) / a.bytes_alloc) * 100) Pct_Free,
6 100 - round((nvl(b.bytes_free, 0) / a.bytes_alloc) * 100) Pct_used,
7 round(maxbytes / 1048576) Max
8 from (select f.tablespace_name,
9 sum(f.bytes) bytes_alloc,
10 sum(decode(f.autoextensible, 'YES', f.maxbytes, 'NO', f.bytes)) maxbytes
11 from dba_data_files f
12 group by tablespace_name) a,
13 (select f.tablespace_name, sum(f.bytes) bytes_free
14 from dba_free_space f
15 group by tablespace_name) b
16 where a.tablespace_name = b.tablespace_name(+)
17 union all
18 select h.tablespace_name,
19 round(sum(h.bytes_free + h.bytes_used) / 1048576) megs_alloc,
20 round(sum((h.bytes_free + h.bytes_used) - nvl(p.bytes_used, 0)) /
21 1048576) megs_free,
22 round(sum(nvl(p.bytes_used, 0)) / 1048576) megs_used,
23 round((sum((h.bytes_free + h.bytes_used) - nvl(p.bytes_used, 0)) /
24 sum(h.bytes_used + h.bytes_free)) * 100) Pct_Free,
25 100 -
26 round((sum((h.bytes_free + h.bytes_used) - nvl(p.bytes_used, 0)) /
27 sum(h.bytes_used + h.bytes_free)) * 100) pct_used,
28 round(sum(f.maxbytes) / 1048576) max
29 from sys.v_$TEMP_SPACE_HEADER h,
30 sys.v_$Temp_extent_pool p,
31 dba_temp_files f
32 where p.file_id(+) = h.file_id
33 and p.tablespace_name(+) = h.tablespace_name
34 and f.file_id = h.file_id
35 and f.tablespace_name = h.tablespace_name
36 group by h.tablespace_name
37 ORDER BY 1
38 /
TABLESPACE_NAME MEGS_ALLOC MEGS_FREE MEGS_USED PCT_FREE PCT_USED MAX
------------------------------ ---------- ---------- ---------- ---------- ---------- ----------
ACCO 250 41 209 16 84 32768
BASE 1650 31 1619 2 98 32768
BUSI 550 50 500 9 91 32768
INDE 350 21 329 6 94 32768
REPO 650 23 627 4 96 32768
SYSAUX 270 9 261 3 97 32768
SYSTEM 500 6 494 1 99 32768
TEMP 44 44 0 100 0 32768
UNDOTBS1 140 119 21 85 15 32768
USERS 55 1 54 3 97 32768
10 rows selected
SQL> |
|