Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: Count database objects ??

    Hey friends : How do we count all database objects ??

    please help with query if possible .


    Regards
    DBFinder

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Can you be a little more specific what you want?

    Andy

  3. #3
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    I want to keep the count of all user database objects count for keeping an eye on new objects in an OLTP database.

    If the count increases, my DBA will look immediately and act if an action is needed. Operational DBA is some times bypassed by higher authority DBA team members. This watch will just let DBA know that something new has entered the database.

    Reagrds

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Are you talking about Tables, Views, Triggers, Stored Procedures, etc?

    Then something like:
    Code:
     select tabschema,count(*) from syscat.tables group by tabschema
    should work.


    Andy

  5. #5
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Actually I was expecting whole list of DB object types so that I can add up for total count of user database objects.

    eg
    1. Tables
    2. Views
    3. Triggers
    4. Functions
    5. Procedures
    6. Sequences
    7. . . . . . . ..
    8. . . . . . . .
    9. . . . . . . .

    Can some one help complete the list so that I do not miss even one of all ??

    Regards
    DBFinder

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    The DB2 catalog tables are described in the Appendix of the SQL Reference Vol 1. You will have to look at the layouts since (for example) syscat.tables includes tables and views, even though syscat.views includes the view information. See the TYPE column of syscat.tables for more info.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Thanks Marcus,

    It is Appendix D in v8 manual. I will do my home work now.

    Regards
    DBFinder

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •