Tutorial: Binding plans and packages

You can bind plans and packages in Db2 Admin Tool.

Before you begin

Ensure that the System Catalog (ADB21) panel is displayed.

About this task

In this stage of the tutorial, you will view a list of application plans in the system catalog and bind a plan.

Procedure

  1. Specify option P, and press Enter to list the application plans in the catalog.
    The Application Plans (ADB21P) panel is displayed:
    Figure 1. Application Plans (ADB21P) panel
     DB2 Admin ---------------- DB2X Application Plans ---------------- Row 1 of 25 
     																											   
     Commands:  BIND  REBIND  FREE  GRANT                                           
     Line commands:                                                                 
     DP - Depend  A - Auth  T - Tables  V - Views  X - Indexes  S - Table spaces   
     Y - Synonyms  RB - Rebind  F - Free  B - Bind  GR - Grant  RO - Role                 
     ? - Show all line commands                                                    
                              Bind   Bind   V I V O Bound    Quali-     Pack A R E D
     Select Name     Owner    Date   Time   D S A P By       fier      Lists Q L X R
            *        *        *      *      * * * * *        *             * * * * *
     ------ -------- -------> ------ ------ - - - - -------- -------> ------ - - - -
            ADBTEP2  DSCGDB2  010828 100153 B S Y Y ISTFL2   DSCGDB2       1 U C N  
            ADBV3    DSCGDB2  010912 024459 B S Y Y ISTFL    DSCGDB2       2 U C Y  
            ADB2GEN  DSCGDB2  010623 005531 B S Y Y ISTJE    DSCGDB2       1 U C Y  
            ADB2GE2  DSCGDB2  010526 003803 B S Y Y ISTFL    DSCGDB2       1 U C Y  
            ADB21    DSCGDB2  010623 004026 B S Y Y ISTJE    DSCGDB2       1 U C N  
            ADB31    DSCGDB2  011030 170150 B S Y Y ISTJE    DSCGDB2       1 U C N  
            DB2E81   DPGROTH  011029 145636 R S Y Y DPGROTH  DPGROTH       0 U C Y  
            DSNEDCL  DSCGDB2  010524 190326 R S Y Y ISTJE    DSCGDB2       1 U C N  
            DSNESPCS DSCGDB2  010524 190324 R S Y Y ISTJE    DSCGDB2       1 U C N  
            DSNESPRR DSCGDB2  010524 190325 R R Y Y ISTJE    DSCGDB2       1 U C N  
            DSNTIAD  DSCGDB2  010524 024119 R S Y Y ISTJE    DSCGDB2       0 U C N  
     ******************************* END OF DB2 DATA *******************************
    
    On this panel, you can issue a B (Bind), RB (Rebind), or F (Free) line command for a particular plan. You can also issue a BIND, REBIND, FREE, or GRANT primary command for all plans that are listed.
  2. For example, specify B against plan DSNTIAD, and press Enter to bind this plan.
    The Bind Application Plan (ADB21PB) panel is displayed:
    Figure 2. Bind Application Plan (ADB21PB) panel
    Start of change
    ADB21PB n ------------------ DBAB Bind Application Plan ----------------- 13:41
    Command ===>                                                                   
                                                                                   
                                                                       More:     + 
     Verify BIND parameters:                                                       
                                                                                   
     BIND PLAN(                                                                    
     Plan name  . . . . . DSNTIAD                                                 
     OWNER  . . . . . . . DSCGDB2   > (Owner of package or ? for lookup)          
       OWNERTYPE  . . . . USER     (Role, User)                                     
     QUALIFIER  . . . . . DSCGDB2  >  (qualifier to resolve unqualified SQL)        
     PKLIST . . . . . . . *.DSNESPRR.DSNESM68 *.DSNTIAP.DSNTIAP          >         
     DEFER(PREPARE) . . . NO       (Yes/No, used for distributed dynamic SQL)      
     VALIDATE . . . . . . R        (Run or Bind, Bind preferred)                   
     ISOLATION  . . . . . RR       (CS, RR, RS, or UR)    
     CACHE  . . . . . . . 3072     (cache size in bytes for authorization IDs)     
     ACQUIRE  . . . . . . U        (Use or Allocate, Use preferred)                
     RELEASE  . . . . . . C        (Commit or Deallocate, Commit preferred)        
     EXPLAIN  . . . . . . NO       (Yes/No, to explain access path)                
     CURRENTDATA  . . . . NO       (Yes/No)                                        
     CURRENT SERVER . . .                  >  (blank=local, else first location)   
     ACTION . . . . . . . REPLACE  (Add or Replace)                                
     RETAIN . . . . . . . YES      (Yes/No)  (Retain auth list)                    
     ENABLE . . . . . . .          (use ? to get current values from the catalog)  
     DISABLE  . . . . . .          (use ? to get current values from the catalog)  
     En/disable names . .            
                                   (use ? to get current values from the catalog) 
     DEGREE . . . . . . . 1        (1 or ANY)  (Parallelism)                       
     SQLRULES . . . . . . D        (DB2 or STD)                                    
     DISCONNECT . . . . . E        (Explicit, Automatic, or Conditional)           
     DYNAMICRULES . . . .          (Run or Bind)                                  
     ENABLE . . . . . . .          (use ? to get current values from the catalog)  
     DISABLE  . . . . . .          (use ? to get current values from the catalog)  
     En/disable names . .            
                                   (use ? to get current values from the catalog) 
     DEGREE . . . . . . . 1        (1 or ANY)  (Parallelism)                       
     SQLRULES . . . . . . D        (DB2 or STD)                                    
     DISCONNECT . . . . . E        (Explicit, Automatic, or Conditional)           
     DYNAMICRULES . . . .          (Run or Bind)                                  
     KEEPDYNAMIC  . . . . NO       (Yes/No)                             
     REOPT(VAR) . . . . . NONE     (N - None, Y - Always, 1 - Once, or A-Auto)
                                               
     OPTHINT  . . . . . .          >                                               
     PATH . . . . . . . .                                            >             
     ENCODING . . . . . . 37       (ASCII, EBCDIC, UNICODE or ccsid)               
     IMMEDWRITE . . . . . NO       (Yes,No or PH1)                                 
     ROUNDING . . . . . . HALFEVEN (Ceiling, Down, Floor, HalfDown,)
                                   (HalfEven, HalfUp, or Up)        
     CONCURRENTACCESSRES           (U - Usecurrentlycommitted or)
                                   (W - Waitforoutcome)
    )
    End of change
  3. Press Enter to verify the BIND parameters.
    Db2 Admin Tool uses the catalog to find the DBRM members and libraries for the bind operation.

    If an SQL error occurs, Db2 Admin Tool displays the DSNTIAR message:

    Figure 3. DSNTIAR error messages
     DB2 Admin --------------------- DB2 Error Display 1 --------------------- 12:54
     Command ===>
     Rollback done
        SQLCODE : -206                           DSNTIAR CODE :  0  
    
     DSNT408I SQLCODE = -206, ERROR:  T.TYP IS NOT A COLUMN OF AN INSERTED TABLE,
              UPDATED TABLE, OR ANY TABLE IDENTIFIED IN A FROM CLAUSE, OR IS NOT A
              COLUMN OF THE TRIGGERING TABLE OF A TRIGGER
     DSNT418I SQLSTATE   = 42703 SQLSTATE RETURN CODE
     DSNT415I SQLERRP    = DSNXORSO SQL PROCEDURE DETECTING ERROR
     DSNT416I SQLERRD    = -600  0  0  -1  0  0 SQL DIAGNOSTIC INFORMATION
     DSNT416I SQLERRD    = X'FFFFFDA8'  X'00000000'  X'00000000'  X'FFFFFFFF'
              X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION 
    

    When you press Enter, a second error panel opens to display the SQL statement that caused the error:

    Figure 4. SQL statement in error
     DB2 Admin --------------------- DB2 Error Display 2 --------------------- 12:54
     Command ===> 
    
        SQLCODE : -206                           DSNTIAR CODE :  0  
    
    PREPARE  
    
    SELECT T.* FROM SYSIBM.SYSTABLES T  WHERE  T.CREATOR LIKE 'DSN and T.TYP = 'V'
     FOR FETCH ONLY 
    

What to do next

Return to the Application Plans (ADB21P) panel.