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

    Unanswered: see the details of a package in db2

    Hi colleagues,
    I am using DB2 8.1 AIX 5.3.

    If I run this:
    db2 "LIST PACKAGES"
    The output is this:
    MIGESCAL KJCPCEBU MIGESCAL 24 Y 0 CS U
    I want to know how I can see the details or statements that contain in package?

    Thank you very much and greetings.
    DBA DB2 for LUW

  2. #2
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    If your application(s) use embedded-static-SQL then they will have a bindfile (*.bnd) and you can use the db2bfd tool to view contents of those bindfiles.

    If your applications use only dynamic-SQL ( no bindfiles) it is best to view the statements from the dynamic sql cache, and view the access plans of those statements via tools like explain and db2exfmt.

  3. #3
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    I am executing this:
    db2bfd -s KJCPCEBU
    The output is this:
    Error: "KJCPCEBU" cannot be opened.
    DBA DB2 for LUW

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    db2bfd - Bind File Description Tool

    specify the full path to the bnd file..... if not executed in current directory
    in some dba tools you can display the statements from a package..
    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
    http://www.infocura.be

  5. #5
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Please check the documentation about db2bfd.

    Do you have a file called KJCPCEBU.bnd in the current directory?
    If you do not have such a file anywhere, then you cannot use db2bfd.
    If you have a file with that name, give its full path to db2bfd.

  6. #6
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    I don't have a file called KJCPCEBU.bnd in the path /migescal/sqllib/bnd.
    Where save db2 the path of yours packages?

    Greetings.
    DBA DB2 for LUW

  7. #7
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    bind files can be loaded in db from any path...
    only db2 bind files are by default located in xx/sqllib/bnd
    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
    http://www.infocura.be

  8. #8
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    Did you not understand the advice that you can only use db2bfd if you have a bindfile?


    IF you got the name KJCPCEBU from syscat.packages, then join with syscat.packagedep to find more details about the package (for example, syscat.packagedep.btype + bschema + bname ). If the package is associated with dynamic-SQL then please use explain + db2exfmt to see the statements in the plan.

  9. #9
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    It has been a while since I used V8.x, but I think I recall you can use db2expln to see what is in the package.

    Andy

  10. #10
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    See syscat.statements.

  11. #11
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Thank you for yours answers colleagues.

    Greetings.
    DBA DB2 for LUW

Posting Permissions

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