Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2015

    Unanswered: how to list all files belonging to the database in DB2


    I would like to list all the files that belongs to DB2 using SELECT statement.
    What is the most secure way to do that?

    Is this reliable?

    db2 connect to XXX
    db2 "select distinct CONTAINER_NAME from sysibmadm.SNApcontainer"

    Or should I use

    db2 get snapshot for tablespaces on XXX

  2. #2
    Join Date
    May 2012
    Canberra, Australia
    Provided Answers: 6
    you can use either but you should probably be using MON_GET_CONTAINER instead of snapcontainer as it's deprecated

    "All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can’t get them together again, there must be a reason. By all means, do not use hammer.” — IBM maintenance manual, 1975 "

  3. #3
    Join Date
    Aug 2015

    missing the database path


    But how do I also include the files for the database?

    -bash-4.1$ db2 get snapshot for tablespaces on tsmdb1|grep home
    Database path = /tsmtest4/home/tsminst1/NODE0000/SQL00001/

  4. #4
    Join Date
    Apr 2006
    Provided Answers: 11
    if doing list db directory you get the path where db has been cataloged and all config files are created
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

  5. #5
    Join Date
    Aug 2015

    select paths from sysibmadm.DBPATHS only shows directory not the files?

    Hi again,

    The query:
    db2 "SELECT paths FROM sysibmadm.dbpaths"

    Will only show in which directory the database files are located, not the actual files used by the database.

  6. #6
    Join Date
    Aug 2015

    which of the PATH is relevant for snapshot?

    Hi again,
    Sorry for spaming, but if I use the DBPATHS table to get the name of DIRectories, instead of files.
    Which of the PATH is needed by the snapshots?

    -bash-4.1$ db2 -x "SELECT VARCHAR(path,70),type FROM sysibmadm.dbpaths WHERE type!='LOGPATH'"
    /tsmtest3/db/6/ DB_STORAGE_PATH
    /tsmtest3/db/5/ DB_STORAGE_PATH
    /tsmtest3/db/4/ DB_STORAGE_PATH
    /tsmtest3/db/3/ DB_STORAGE_PATH
    /tsmtest3/db/2/ DB_STORAGE_PATH
    /tsmtest3/db/1/ DB_STORAGE_PATH
    /tsmtest4/home/tsminst1/NODE0000/sqldbdir/ LOCAL_DB_DIRECTORY
    /tsmtest4/home/tsminst1/NODE0000/SQL00001/ DBPATH

Tags for this Thread

Posting Permissions

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