This topic applies only to the z/OS platform

Sample DB2 for z/OS commands and SQL

Use these samples to create the DB2® for z/OS® databases and storage groups after configuring the stand-alone server or deployment manager.

Before you begin

Before running createDB2.sh, you must allocate the required buffer pools. Work with your DB2 for z/OS database administrator to determine which buffer pools to use. For each buffer pool, define the buffer pool BPn with yyyyy pages by using the following DB2 command:
-ALTER BUFFERPOOL (BPn) VPSIZE(yyyyy)
For example:
-ALTER BUFFERPOOL (BP1) VPSIZE(20000)
You can also run the DB2 commands in a batch job, for example:
//JOBLIB  DD  DISP=SHR,DSN=db2hlq.SDSNLOAD
//STEP1   EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//SYSTSIN  DD  *
  DSN SYSTEM(ssid)
  -ALTER BUFFERPOOL (BPn) VPSIZE(yyyyy)
  RUN PROGRAM(DSNTIAD)  PLAN(DSNTIAnn) -
       LIBRARY('db2hlq.RUNLIB.LOAD')
  END
//SYSIN    DD  *
GRANT USE OF BUFFERPOOL BPn TO PUBLIC ;
/*

If you are in data sharing mode, make sure that you define the cache XCF structures for the group buffer pools being used. For further information, see Cross-system coupling facility component of z/OS in the DB2 for z/OS Information Center.

The following sample SQL statements are provided to assist you when creating separate databases and storage groups. Customize and then run the scripts using a tool such as SPUFI or DSNTEP2. For more information, see Creating and configuring the databases.

You do not need to run this SQL if you use the createDB2.sh script to create the database objects. For more information, see Creating and configuring the databases.

Sample SQL

Business Process Choreographer
-- ########################################################################
-- # Licensed Materials - Property of IBM
-- # 5724-L01, 5724-I82, 5655-W05, 5655-W09
-- # (C) Copyright IBM Corporation 2006. All Rights Reserved.
-- # US Government Users Restricted Rights - Use, duplication or disclosure
-- # restricted by GSA ADP Schedule Contract with IBM Corp.
-- ########################################################################
DROP   DATABASE BPEDB ;                                                
DROP   STOGROUP BPEDBSTO;                                              
CREATE STOGROUP BPEDBSTO VOLUMES (WBIUS3,WBIUS4,WBIUS5) VCAT WSDB2;    
CREATE DATABASE BPEDB                                                  
  STOGROUP BPEDBSTO                                                    
  BUFFERPOOL BP1
  CCSID UNICODE                                                       
  INDEXBP BP2;                                                         
COMMIT;                                                                
IBM® Business Process Manager for z/OS features using the common database:
-- ########################################################################
-- # Licensed Materials - Property of IBM
-- # 5724-L01, 5724-I82, 5655-W05, 5655-W09
-- # (C) Copyright IBM Corporation 2006. All Rights Reserved.
-- # US Government Users Restricted Rights - Use, duplication or disclosure
-- # restricted by GSA ADP Schedule Contract with IBM Corp.
-- ########################################################################
DROP   DATABASE CMNDB ;                                             
DROP   STOGROUP WPRCSSTO;                                           
CREATE STOGROUP WPRCSSTO VOLUMES (WBIUS3,WBIUSR,WBIUS5) VCAT WSDB2; 
CREATE DATABASE CMNDB                                               
  STOGROUP WPRCSSTO                                                 
  BUFFERPOOL BP1
  CCSID UNICODE                                                    
  INDEXBP BP2;                                                      
COMMIT;             
The following IBM Business Process Manager for z/OS features use the common database:
  • Recovery
  • Relationship service
  • Mediation
  • Application Scheduler
  • Customization (selector and business rule group)
Common Event Infrastructure
-- ########################################################################
-- # Licensed Materials - Property of IBM
-- # 5724-L01, 5724-I82, 5655-W05, 5655-W09
-- # (C) Copyright IBM Corporation 2006. All Rights Reserved.
-- # US Government Users Restricted Rights - Use, duplication or disclosure
-- # restricted by GSA ADP Schedule Contract with IBM Corp.
-- ########################################################################
DROP   DATABASE EVENT ;                                          
DROP   DATABASE EVENTCAT ;                                       
DROP   STOGROUP EVTSTO;                                          
CREATE STOGROUP EVTSTO VOLUMES (WBIUS3,WBIUS4,WBIUS5) VCAT WSDB2;
CREATE DATABASE EVENT                                            
  STOGROUP EVTSTO                                                
  BUFFERPOOL BP1
  CCSID UNICODE                                                       
  INDEXBP BP2;                                                   
CREATE DATABASE EVENTCAT                                         
  STOGROUP EVTSTO                                                
  BUFFERPOOL BP1
  CCSID UNICODE                                                       
  INDEXBP BP2;                                                   
COMMIT;                                                          
Business Space
-- ########################################################################
-- # Licensed Materials - Property of IBM
-- # 5724-L01, 5724-I82, 5655-W05, 5655-W09
-- # (C) Copyright IBM Corporation 2006. All Rights Reserved.
-- # US Government Users Restricted Rights - Use, duplication or disclosure
-- # restricted by GSA ADP Schedule Contract with IBM Corp.
-- ########################################################################
DROP   DATABASE B6BSPACE ;                                                
CREATE STOGROUP B6BSPSTO VOLUMES (WBIUS3,WBIUS4,WBIUS5) VCAT WSDB2;
CREATE DATABASE B6BSPACE                                            
  STOGROUP B6BSPSTO                                                
  BUFFERPOOL BP1
  CCSID UNICODE                                                       
  INDEXBP BP2;                                                              
COMMIT;