b.r*_*oth 12 oracle storage oracle10g
如何找出(如果可能的话,通过企业管理器)某个表正在使用的总数(以 Mb 为单位)?
Guy*_*Guy 17
通过 OEM 10g,
Schema
选项卡Tables
在数据库对象中的链接上Go
Edit
(不要单击表名链接)Segments
选项卡(并等待...)好的,这在技术上回答了你的问题。但更好的方法是:
我喜欢将脚本保存t.sql
为快速参考
COLUMN size_mb FORMAT '999,999,990.0'
COLUMN num_rows FORMAT '999,999,990'
COLUMN fmt_short FORMAT A24
COLUMN owner FORMAT A16
COLUMN table_name LIKE fmt_short
COLUMN tablespace_name LIKE fmt_short
SET LINESIZE 200
SET AUTOTRACE OFF
COMPUTE SUM OF size_mb ON REPORT
BREAK ON REPORT
SELECT
lower( owner ) AS owner
,lower(table_name) AS table_name
,tablespace_name
,num_rows
,blocks*8/1024 AS size_mb
,pct_free
,compression
,logging
FROM all_tables
WHERE owner LIKE UPPER('&1')
OR owner = USER
ORDER BY 1,2;
CLEAR COMPUTES
CLEAR BREAKS
Run Code Online (Sandbox Code Playgroud)
小智 13
表使用的空间是其所有盘区使用的空间:
SELECT SUM(bytes), SUM(bytes)/1024/1024 MB
FROM dba_extents
WHERE owner = :owner
AND segment_name = :table_name;
SUM(BYTES) MB
---------- ----------
3066429440 2924,375
Run Code Online (Sandbox Code Playgroud)
您确定使用 all_tables 视图的原始方法包括 LOB 范围吗?我想不会。这是我发现有用的一个:
with da as (
SELECT owner, segment_name, SUM(bytes)/1024/1024 size_mb
FROM dba_extents
group by rollup(owner, segment_name)
) select owner, segment_name, size_mb, round(size_mb/total_mb*100)
from da
cross join (
select size_mb as total_mb
from da t where owner is null and segment_name is null
)
order by size_mb desc
Run Code Online (Sandbox Code Playgroud)
它向我展示了使用最多空间的内容。
归档时间: |
|
查看次数: |
171513 次 |
最近记录: |