Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2013
    Posts
    13

    Unanswered: DB2 Master Database

    Hi,

    I would like to know is there a master database exist in db2 just like MSSQL Master Database?

    If no, if i would like to connect to db2 using oledb connection without knowing database, is there any solution for me to know how to do it?


    Thanks.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    DB2 does not have a separate master database. For each DB2 database, there are a set of tables (and views) that contain the meta-data for the database. The system catalog views have the schema name of SYSCAT (such as SYSCAT.TABLES, SYSCAT.COLUMNS, etc) and are described in the Appendix of the SQL Reference manual Vol I.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Apr 2013
    Posts
    13
    Thanks for the reply. Since, they is no master database, so, is there anywhere for me to connect to db2 through Oledb without specified database name? I need to list all the database exist in db2 server through c# application.
    Can i know what are the available solutions to solve this problems?

    Thanks.

  4. #4
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    There are a lot of differences between MSSQL and DB2, so you have to first read some documentation. After that, you will see that you need a different approach.

    You will see that a DB2 database is somehow similar to a MSSQL instance, so you have no reason to list all the available databases.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by pangjiu View Post
    Thanks for the reply. Since, they is no master database, so, is there anywhere for me to connect to db2 through Oledb without specified database name? I need to list all the database exist in db2 server through c# application.
    Can i know what are the available solutions to solve this problems?

    Thanks.
    You can attach to the instance (but you need to know instance name) and then issue a command to show databases in that instance. I don't know how to do that with C#, although there is probably API for that.

    Another way is use the discovery feature (via API) to discover the instance or databases, but the instances and databases must have discovery enabled.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  6. #6
    Join Date
    Apr 2013
    Posts
    13
    Thanks for reply Marcus.
    May i know how to use the discovery feature? Is there any example for this? Thanks a lot.

Posting Permissions

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