Sunday, November 30, 2008

show a schemas objects



-- dbschema.sql
--
-- desc: lists schema objects for a particular schema.
-- performance improved. Script orginally
-- by Tom Kyte.
-- usage: dbschema.sql
--
column object_name format a30
column status format a8
set linesize 160
select object_type, object_name,
decode(status,'INVALID','*','') status,
decode( object_type,
'TABLE', (select tablespace_name
from user_tables
where table_name = object_name),
'TABLE PARTITION', (select tablespace_name
from user_tab_partitions
where partition_name =
subobject_name),
'INDEX', (select tablespace_name
from user_indexes
where index_name = object_name),
'INDEX PARTITION', (select tablespace_name
from user_ind_partitions
where partition_name =
ubobject_name),
'LOB', (select tablespace_name
from user_segments
where segment_name = object_name),
null ) tablespace_name
from user_objects a
order by object_type, object_name
/






******************************************
keywords:
******************************************
rdbms version:
******************************************

1 comment:

Anonymous said...

Working Script:

column object_name format a30
column status format a8
set linesize 160
select object_type, object_name,
decode(status,'INVALID','*','') status,
decode( object_type,
'TABLE', (select tablespace_name
from user_tables
where table_name = object_name),
'TABLE PARTITION', (select tablespace_name
from user_tab_partitions
where partition_name =
subobject_name),
'INDEX', (select tablespace_name
from user_indexes
where index_name = object_name),
'INDEX PARTITION', (select tablespace_name
from user_ind_partitions
where partition_name =
-- ubobject_name),
subobject_name),
'LOB', (select tablespace_name
from user_segments
where segment_name = object_name),
null ) tablespace_name
from user_objects a
order by object_type, object_name
/