Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Unanswered: database in catalog table.

    Hi Colleagues,

    Somebody can say me in what system catalog table is save the database name in a instance db2 9.5.

    Thank you for you help.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    afaik, the db name is not in any system table/view.

    you may use db snapshot table function/view to get db name

    hth

    sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You can get the name of the (connected) database through SQL.

    Code:
    select CURRENT SERVER from sysibm.sysdummy1
    Andy

  4. #4
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    it seems to me very strange that not this in tables of the catalogue of the system db2 not this keeping nowhere.
    Greetings.

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    DB2 does know what databases are in its catalog. If you enter "DB2 LIST DB DIRECTORY" or "DB2 LIST DATABASE DIRECTORY", you will see all the databases catalogged on the server both local and remote.

    Andy

  6. #6
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    I make this question because I want to know the size of the database, I know that this information could be are in the catalogue tables.
    Greetings.

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Your original post only wanted to get the database name from the catalog tables. It does not exist there. If you want the size of the database, if your runstats are current, i recently posted a query that would give you the information.

    Andy

  8. #8
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    get_dbsize_info procedure will help to get size
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  9. #9
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The thing is that each database has its own catalog (in DB2 LUW). So it doesn't make much sense to store the database name in the catalog; it would just be a single value to begin with. The special register CURRENT SERVER - as mentioned by Andy - serves this purpose very well. So why would you want to have it "in a catalog table"?

    p.s: LIST DB DIRECTORY shows the database directory known to the instance. That is a level above databases.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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