Rebinding packages

You need to rebind a package when you make changes that affect the package, but the SQL statements in the package have not changed. For example, if an associated object changed or an index was created, you need to rebind the package. When you rebind a package, the Db2 optimizer evaluates whether any access path changes are needed.

Procedure

To rebind a package:

  1. On the DB2 Administration Menu (ADB2) panel, specify option 1, and press Enter.
  2. On the System Catalog (ADB21) panel, specify option K (for packages) and optionally any filtering criteria, and press Enter.
  3. On the Packages (ADB21K) panel, specify the RB line command next to the package that you want to rebind.
    One of the following rebind package panels lists the available REBIND options:
    • For packages created by the BIND PACKAGE command:
      Figure 1. Rebind package (ADB21KR) panel
      Start of change
       ADB21KR n --------------------- DB2X Rebind Package --------------------- 13:20
       Command ===>                                                                   
                                                                                      
                                                                          More:     + 
       Verify REBIND parameters:                                                     
                                                                                      
       REBIND PACKAGE(                                                               
       Location . . . . . .                >                                         
       Collection . . . . . DSNEDCL            >                                     
       Package  . . . . . . DSNECP68 >                                               
       (                                                                             
       Version  . . . . . . V10R1                                                    
                                                                                      
       OWNER  . . . . . . . DB2ADM    > (Owner of package or ? for lookup)          
         OWNERTYPE  . . . . USER     (Role, User)    
       QUALIFIER  . . . . . DB2ADM   >                                               
       VALIDATE . . . . . . R        (Run or Bind, Bind preferred)                   
       ISOLATION  . . . . . CS       (CS, RR, RS, or UR)                             
       RELEASE  . . . . . .          (Commit, Deallocate, Inheritfromplan or blank) 
       EXPLAIN  . . . . . .          (Yes, No, or Only)                               
       CURRENTDATA  . . . . YES      (Yes/No)   (inhibit blocking)                   
       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)                        
       DYNAMICRULES . . . .          (R, B, D, I, E, H or blank)                     
       KEEPDYNAMIC  . . . . NO       (Yes/No)                                        
       DEFER(PREPARE) . . .          (Yes, No, or I - Inheritfromplan)              
       REOPT  . . . . . . . NONE     (N - None, Y - Always, 1 - Once, A - Auto)      
                                                                                     
       OPTHINT  . . . . . .          >  (hint id)                                    
       PATH (UDT/UDF/STP) .                                  >                       
       ENCODING . . . . . . 37       (ASCII, EBCDIC, UNICODE, or ccsid)              
       IMMEDWRITE . . . . . NO       (Yes, No, PH1, or I - Inheritfromplan)          
       PLANMGMT . . . . . .          (Off, Basic or Extended)                    
       SWITCH . . . . . . .          (Original or Previous - ALL OTHER OPTIONS IGNORED
       ROUNDING . . . . . . HALFEVEN (HalfEven, Ceiling, Down, Floor,   
                                      HalfDowN, HalfUp, Up)                
       APREUSE  . . . . . .          (None, Warn or Error)
       APREUSESOURCE. . . .          (Current, Previous, Original)          
       APCOMPARE  . . . . .          (None, Warn or Error)                
       BUSTIMESENSITIVE . . YES      (Yes/No)                              
       SYSTIMESENSITIVE . . YES      (Yes/No)  
       APRETAINDUP  . . . .          (Yes/No) 
       APPLCOMPAT . . . . . V12R1M510 (VnnRn/VnnRnMnnn)    
       EXTENDEDINDICATOR  .          (Yes/No)  
       CONCURRENTACCESSRES           (U – Usecurrentlycommitted, W - Waitforoutcome)
       GETACCELARCHIVE  . .          (Yes/No)                                  
       QUERYACCELERATION  .          (N - None, EN - ENable, EL - ELigible,    
                                     EWF - EnableWithFailback, or A - All)     
       ACCELERATOR  . . . .                            
       ACC.WAITFORDATA  . .          (0 - 3600)                        
       ARCHIVESENSITIVE . .          (Yes/No)                                  
       DESCSTAT . . . . . .          (Yes/No)                                  
       CONCENTRATESTMT  . .          (Yes/No)
       DEPLEVEL . . . . . .          (P – Package, S – Statement)
       RESTSERVICEDEFAULT .          (Yes or blank)
      )                                                                  
      End of change
      Notes: Start of change
      • Db2 13 FL 502 The DEPLEVEL bind option is displayed only if you are running Db2 13 function level 502 or later.
      • The RESTSERVICEDEFAULT bind option is displayed only for REST service packages.
      End of change
    • For trigger packages:
      Figure 2. Rebind Trigger Package (ADB21KRT) panel
      ADB21KRT  ----------------- DD1A Rebind Trigger Package ----------------- 14:07
      Command ===>                                                                   
                                                                                     
                                                                                     
       Verify REBIND parameters:                                                     
                                                                                     
       REBIND TRIGGER PACKAGE(                                                       
       Location . . . . . .                 >                                        
       Collection . . . . . TS4370              >                                    
       Package  . . . . . . ADB_MT_C  >                                              
       CURRENTDATA  . . . . NO       (Yes/No)   (inhibit blocking)                   
       EXPLAIN  . . . . . . NO       (Yes, No, or Only)                              
       ISOLATION  . . . . . CS       (CS, RR, RS, or UR)                             
       RELEASE  . . . . . . C        (Commit, Deallocate, or blank)                  
       PLANMGMT . . . . . . EXTENDED (Off, Basic or Extended)                        
       SWITCH . . . . . . .          (Original, Previous - ALL OTHER OPTIONS IGNORED)
       APRETAINDUP  . . . . YES      (Yes/No)                                        
       CONCURRENTACCESSRES           (U - Usecurrentlycommitted or)                  
                                     (W - Waitforoutcom)                             
       APREUSE  . . . . . . WARN     (None, Warn or Error)                           
       APREUSESOURCE  . . .          (Current, Previous, Original)                   
       APPLCOMPAT . . . . V13R1M506  (V10R1,V11R1,V12R1,V12R1M100,V12R1M5nn,V13R1,V13
       )                                                                             
    • For advanced trigger packages:
      Figure 3. Rebind Package (ADBP1KR1) panel
      Start of change
      ADBP1KR1  --------------------- DD1A  Rebind Package -------------------- 13:56
      Command ===>                                                                   
                                                                                     
                                                                                     
       Verify REBIND parameters:                                                     
                                                                                     
       REBIND PACKAGE(                                                               
       Location . . . . . .                   >                                      
       Collection . . . . . TS5530              >                                    
       Package  . . . . . . JEFSI220  >                                              
       Version  . . . . . . V1                                                       
                                                                                     
       EXPLAIN  . . . . . . NO       (Yes, No, Only)        
       PLANMGMT . . . . . . EXTENDED (Off, Basic or Extended)                        
       )                                                                             
      End of change
    • For SQL function or procedure packages:
      Figure 4. Rebind SQL Function Package (ADB21KRN) panel
      ADB21KRN                  DD1A Rebind SQL Function Package                10:55
      Command ===>                                                                   
                                                                                     
                                                                                     
      Verify REBIND parameters:                                                      
                                                                                     
      REBIND PACKAGE(                                                                
      Location . . . . . .                   >                                       
      Collection . . . . . SYSTOOLS            >                                     
      Package  . . . . . . REG_MATC  >                                               
      Version  . . . . . . V1                                                        
                                                                                     
      PLANMGMT . . . . . . EXTENDED (Off, Basic or Extended)                         
      APREUSE  . . . . . .          (None, Warn or Error)                            
      APREUSESOURCE  . . .          (Current, Previous, Original)                    
      APCOMPARE  . . . . .          (None, Warn or Error)                            
      APRETAINDUP  . . . . YES      (Yes/No)                                         
      EXPLAIN  . . . . . . NO       (Yes, No, or Only)                               
      SWITCH . . . . . . .          (Original, Previous - ALL OTHER OPTIONS IGNORED) 
       )                                                                             
  4. Specify your REBIND options, and press Enter.