Search This Blog

Total Pageviews

Monday, 9 August 2010

Oracle Number of Objects in Tablespaces



Oracle  Users and Number of Objects in Tablespaces



set pagesize 60  echo off
column tablespace_name         format a20
column owner format a20
column objects format a20
break on owner on tablespace_name 
spool users_ts
select substr(owner,1,20) owner,substr(tablespace_name,1,32) tablespace_name,count(*)||decode(count(*),1,' table',' tables') objects
from sys.dba_tables
group by substr(owner,1,20),substr(tablespace_name,1,32) 
union
select substr(owner,1,20) owner,substr(tablespace_name,1,32) tablespace_name,count(*)||decode(count(*),1,' index',' indexes') objects
from sys.dba_indexes
group by substr(owner,1,20),substr(tablespace_name,1,32) 
/

spool off


OWNER                TABLESPACE_NAME      OBJECTS
-------------------- -------------------- --------------------
ANUJ                 USERS                2 tables
APEX_040200          SYSAUX               1518 indexes
                                          450 tables
                                          2 tables

AUDSYS                                    1 table
                                          4 indexes

No comments:

Oracle DBA

anuj blog Archive