Wednesday 16 April 2014

List the count of Objects schema wise in Oracle

select owner,
max( decode( object_type, 'TABLE', cnt, null ) ) Tables,
max( decode( object_type, 'VIEW', cnt, null ) ) Views,
max( decode( object_type, 'TRIGGER', cnt, null ) ) triggers,
max( decode( object_type, 'PACKAGE', cnt, null ) ) packages
from ( select owner, object_type, count(*) cnt
from dba_objects
group by owner, object_type )
group by owner
/

2 comments:

  1. Short and sweet. Very good

    ReplyDelete
  2. Short and simple.... very good..

    ReplyDelete