Results 1 to 5 of 5

Thread: Doubt

  1. #1
    Join Date
    Dec 2004
    Posts
    5

    Unanswered: Doubt

    I am using MSV DB2 . I want to query a table in a specific database. How do I do it? is it

    select * from databasename..Tablename or how it will be

    Thanks

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    On DB2 for MVS you never reference the database name in a query. A database in DB2 MVS is totally different than a database on DB2 for other platforms.

    You are usually already connected to a DB2 subsystem name through the attachment you are using. If you are using TSO, you can select the DB2 subsystem with DB2I options or defaults (I forget the exact name of the panel). The subsystem name is usually a 3 or 4 character name.

    You select from the table-name, just like any other DB2.
    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
    Dec 2004
    Posts
    5
    Hi Marcus,

    Thank you for the reply.

    When I am queries sysibm.sysdatabase I am able to see so many databases.
    How to assign to a specific database?

    Or suppose I am a DBA and created a new database in that subsystem. And I want a specific group only access the that database how it would be done

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    In DB2 for OS/390 you can have many databases in a subsystem. The database is an administrative level only in DB2 for OS/390 and does not affect DML (insert, update, delete, select).

    You can grant DBADM access at the database level, but not insert, update, delete, or select access. In DB2 for OS/390, the database is more like a schema in DB2 for other platforms.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Aug 2004
    Posts
    330
    In the Mainframe world, a Database is not the same as a Database in the midrange/PC world. The Mainframe Database is a logical grouping of objects that only share a few physical characteristics. In order to get acces to the tables in the database, someone with administrative privileges (DBA) should grant access to those objects. Once you are connected to the subsystem, you can query any object in that subsytem that you have access to. (Sorry to end that last sentence with a preposition.)

Posting Permissions

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