|
确实是比较老啊。。。。。。不过发现难道这个楼主很可能就是我现在的同事啊,呵呵。
其实最近俺也有过一个类似的脚本,可以看到对象名字,结果更清楚一点:
SET ECHO off
REM --------------------------------------------------------------------------
REM REQUIREMENTS:
REM SELECT on DBA_EXTENTS & DBA_FREE_SPACE,
REM --------------------------------------------------------------------------
REM AUTHOR:
REM Cary Millsap
REM --------------------------------------------------------------------------
REM PURPOSE:
REM The purpose of this script is to provide a block-level mapping of tables
REM inside one or more tablespaces.
REM ---------------------------------------------------------------------------
REM EXPLANATION:
REM Provides a block-level mapping of tables inside of a given tablespace.
REM ---------------------------------------------------------------------------
REM
REM ---------------------------------------------------------------------------
REM DISCLAIMER:
REM This script is provided for educational purposes only. It is NOT
REM supported by Oracle World Wide Technical Support.
REM The script has been tested and appears to work as intended.
REM You should always run new scripts on a test instance initially.
REM --------------------------------------------------------------------------
REM Main text of script follows:
def ts = &&1
col tablespace form a15 head 'Tablespace' just c trunc
col file_id form 990 head 'File' just c
col block_id form 9,999,990 head 'Block Id' just c
col blocks form 999,990 head 'Size' just c
col segment form a38 head 'Segment' just c trunc
break -
on tablespace skip page -
on file_id skip 1
select
tablespace_name tablespace,
file_id,
1 block_id,
1 blocks,
'<file hdr>' segment
from
dba_extents
where
tablespace_name = upper('&ts')
union
select
tablespace_name tablespace,
file_id,
1 block_id,
1 blocks,
'<file hdr>' segment
from
dba_free_space
where
tablespace_name = upper('&ts')
union
select
tablespace_name tablespace,
file_id,
block_id,
blocks,
owner||'.'||segment_name segment
from
dba_extents
where
tablespace_name = upper('&ts')
union
select
tablespace_name tablespace,
file_id,
block_id,
blocks,
'<free>'
from
dba_free_space
where
tablespace_name = upper('&ts')
order by
1,2,3
/
undef ts
输出大概是:SQL> @check_space
old 10: tablespace_name = upper('&ts')
new 10: tablespace_name = upper('ODS_LOB')
old 21: tablespace_name = upper('&ts')
new 21: tablespace_name = upper('ODS_LOB')
old 32: tablespace_name = upper('&ts')
new 32: tablespace_name = upper('ODS_LOB')
old 43: tablespace_name = upper('&ts')
new 43: tablespace_name = upper('ODS_LOB')
Tablespace File Block Id Size Segment
--------------- ---- ---------- ----------- --------------------------------------
ODS_LOB 7 1 1 <file hdr>
9 20,480 ENTADMIN.CDO_LOB
20,489 20,480 ENTADMIN.EIA_QUEUE_LOB
40,969 20,480 ENTADMIN.SYS_IL0000029728C00002$$
61,449 20,480 ENTADMIN.EIA_QUEUE_LOB
81,929 20,480 ENTADMIN.EIA_QUEUE_LOB
102,409 20,480 ENTADMIN.EIA_QUEUE_LOB
122,889 20,480 ENTADMIN.EIA_QUEUE_LOB
143,369 20,480 ENTADMIN.EIA_QUEUE_LOB
163,849 20,480 ENTADMIN.EIA_QUEUE_LOB
184,329 20,480 ENTADMIN.EIA_QUEUE_LOB
Tablespace File Block Id Size Segment
--------------- ---- ---------- ----------- --------------------------------------
ODS_LOB 7 204,809 20,480 ENTADMIN.EIA_QUEUE_LOB
225,289 20,480 ENTADMIN.EIA_QUEUE_LOB
245,769 20,480 ENTADMIN.EIA_QUEUE_LOB
266,249 20,480 ENTADMIN.EIA_QUEUE_LOB
286,729 20,480 ENTADMIN.EIA_QUEUE_LOB
307,209 20,480 ENTADMIN.EIA_QUEUE_LOB
327,689 20,480 ENTADMIN.EIA_QUEUE_LOB
348,169 20,480 ENTADMIN.CDO_LOB
368,649 20,480 ENTADMIN.CDO_LOB
389,129 20,480 ENTADMIN.CDO_LOB
409,609 20,480 ENTADMIN.CDO_LOB
Tablespace File Block Id Size Segment
--------------- ---- ---------- ----------- --------------------------------------
ODS_LOB 7 430,089 20,480 ENTADMIN.CDO_LOB
450,569 20,480 ENTADMIN.CDO_LOB
471,049 20,480 ENTADMIN.CDO_LOB
491,529 20,480 ENTADMIN.CDO_LOB
512,009 20,480 ENTADMIN.CDO_LOB
532,489 20,480 ENTADMIN.CDO_LOB
552,969 20,480 ENTADMIN.CDO_LOB
573,449 20,480 ENTADMIN.CDO_LOB
593,929 20,480 ENTADMIN.CDO_LOB
614,409 20,480 ENTADMIN.SYS_IL0000029070C00002$$
634,889 20,480 ENTADMIN.CDO_LOB
...................
...................
................... |
|