Control Center Operations Guide for VSE


|Chapter 13. Installing Stored Procedures Support

|

|DB2 UDB's Web Control Center, running on your workstation, can be used |to perform certain tasks using a DB2 Server for VSE & VM database running |on a "host" computer. Control Center for VSE and VM provides |stored procedures that are used to do that type of processing. The |stored procedures are invoked by UDB's Web Control Center to process DB2 |commands such as Reorganize Index and Rebind Package.

|Web Control Center stored procedures support requires Version 7 or greater |of DB2 UDB, DB2 for VSE, and Control Center for VSE. If you are |planning to use DB2 Web Control Center, then perform the process described |below. If you will not be installing DB2 Web Control Center, then the |following process is not needed.

|This optional procedure is used to install two IBM-supplied stored |procedures. One can be used to Reorganize an Index and to Rebind a |Package; the other is used as part of the Visual Explain services.

|To use stored procedures, you must define a stored procedure server (part |of your DB2 installation and tailoring process) and then inform DB2 about the |stored procedures you want to execute. The stored procedures must be |accessible to the stored procedure server at execution time. Stored |procedures are explained in detail in the DB2 Server for |VSE & VM Database Administration manual.

|In this step, you will: |

  1. |Define the stored procedures to DB2. (Step 1 in SQMSPRC1)
  2. |Linkedit the procedures into the Control Center library. A linkedit |is necessary because the Language Environment (LE) used by the Control Center |development team may be different than that you are using. (Step 2 in |SQMSPRC1)
  3. |Load the stored procedure packages into the databases that will use |them. (Step 3 in SQMSPRC1)
  4. |Make the Control Center library accessible to the stored procedure |server. |

|To install the support, punch SQMSPRC1.Z from your Control Center |installation library, tailor it for your installation and submit it for |execution.
Note:The SQMSPRC1 job must be re-run for each database that will use these stored procedures. Each time you re-run it, the stored procedures' phases will be linkedited into the Control Center library again although the rest of the job will involve a different database each time. Setting up the job in this manner involves a little extra CPU time, but simplifies your installation process.

|Executing this process does not START the stored procedure server nor any |stored procedures; it only enables those actions.

|There are a number of stored procedure server initialization procedures |that are required, including previously defining a stored procedure |server. See the DB2 Server for VSE & VM |Database Administration manual for information about these.

|To complete this step: |

  1. |Punch SQMSPRC1.Z and edit.
  2. |Modify EACH procedure used to start a stored procedure server so that it |can refer to your Control Center library. The sample procedure is in |the DB2 Server for VSE & VM Database |Administration manual which discusses Stored Procedures. |

|Figure 54. Install Stored Procedures (SQMSPRC1.Z)
$ $$ JOB JNM=SQMSPRC1,CLASS=0,DISP=D,PRI=9                           
$ $$ LST CLASS=Q                                                     
// JOB SQMSPRC1       INSTALL THE STORED PROCEDURES   04/22/2000     
// LIBDEF *,SEARCH=PRD2.DB2710                                       
*                                                                    
* ********************************************                       
*                                                                    
* NOTE: YOU MUST HAVE AT LEAST ONE PSERVER DEFINED TO DB2 BEFORE     
*       RUNNING THIS PROCESS!                                        
*                                                                    
* ********************************************                       
*                                                                    
* CHANGE ALL PARAMETERS ENCLOSED IN <> AND REMOVE THE <>.            
* THE PARAMETERS ARE:                                                
*   DATABASE NAME                                               (4X) 
*   SQLDBA PASSWORD                                             (2X) 
*   CONTROL CENTER LIBRARY:   WHERE CONTROL CENTER IS INSTALLED (2X) 
*   STORED PROCEDURE LIBRARY: WHERE THE EXECUTABLE MODULES FOR  (1X) 
*                             THE STORED PROCEDURES WILL RESIDE      
*                                                                    
 * ********************************************                            
 *                                                                         
 * STEP 1: DEFINE THE STORED PROCEDURES                                    
 *                                                                         
 * ********************************************                            
 *                                                                         
 // EXEC ARIDBS,SIZE=AUTO,PARM='DBNAME(<DATABASE NAME>)'       
  CONNECT SQLDBA IDENTIFIED BY <SQLDBA PASSWORD> TO <DATABASE NAME>
  CREATE PROCEDURE ARISCCF                                                 
        (IN  FUNCODE INT,                                                  
         IN  OWNER   CHAR(8),                                              
         IN  PARM1 CHAR(18),                                               
         IN  PARM1LN INT,                                                  
         IN  PARM2 INT,                                                    
         OUT RETCODE INT )                                                 
    LANGUAGE PLI,                                                          
    EXTERNAL,                                                              
    SERVER GROUP,                   
   GENERAL,                                      
   RESULT SET 0;                                 
 CREATE PROCEDURE ARISVEF                        
      (IN  CREATOR CHAR(8),                      
       IN  PKNAME  CHAR(8),                      
       OUT RETCODE INT )                         
   LANGUAGE PLI,                                 
   EXTERNAL,                                     
   SERVER GROUP,                                 
   GENERAL,                                      
   RESULT SET 0;                                 
#*                                               
// IF $RC > 0 THEN                         
// GOTO $EOJ                                     
* ********************************************   
*                                                
* STEP 2. LINK EDIT THE STORED PROCEDURES        
*                                                
* ********************************************                         
*                                                                      
// OPTION CATAL                                                        
// LIBDEF *,SEARCH=(<CONTROL CENTER LIBRARY>,PRD2.DB2710)  
// LIBDEF PHASE,CATALOG=<STORED PROCEDURE LIBRARY>         
   PHASE ARISCCF,*                                                     
   INCLUDE ARISCCF                                                     
// EXEC LNKEDT,PARM='MSHP'                                             
// IF $RC > 4 THEN                                               
// GOTO $EOJ                                                           
   PHASE ARISVEF,*                                                     
   INCLUDE ARISLKSV                                                    
// EXEC LNKEDT,PARM='MSHP'                                             
// IF $RC > 4 THEN                                               
// GOTO $EOJ  
                                                         * ********************************************                         
*                                                                      
* STEP 3. LOAD THE STORED PROCEDURE PACKAGE INTO THE DATABASE          
*                                                                       
* ********************************************                          
*                                                                       
// LIBDEF *,SEARCH=(<CONTROL CENTER LIBRARY>,PRD2.DB2710)   
// OPTION LOG                                                           
// EXEC ARIDBS,SIZE=AUTO,PARM='DBNAME(<DATABASE NAME>)'     
 CONNECT SQLDBA IDENTIFIED BY <SQLDBA PASSWORD> TO <DATABASE NAME>
 COMMENT '***** RELOAD PACKAGE SQLDBA.ARIS7VE *****'                    
 RELOAD PACKAGE (SQLDBA.ARIS7VE)                                        
     REPLACE                                                            
     KEEP                                                               
 INFILE(SYSIPT BLKSZ(80) PDEV(DASD));                                   
 READ MEMBER ARIS7VE.Q (NOCONT                                          
#*                                                                      
#&                                                                      
$ $$ EOJ                                                                                                                                                 


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]