This topic applies only to the z/OS platform

Ddl2Pds.sh script

You can use the Ddl2Pds.sh sample script to copy your database configuration scripts from the UNIX System Services environment into a z/OS® PDS. The script optionally converts the database scripts from ASCII to EBCDIC format. The database scripts must have a .ddl or a .sql suffix.

The Ddl2Pds.sh script is found in the samples directory in product file system, which by default is /usr/lpp/zWebSphere/V8R0/zOS-config/samples. You can copy the script and customize it with your configuration information.

Syntax

Ddl2Pds.sh
   -Source <Directory containing source files>
   -PDS    <Target PDS name>
   -Component <Files to transfer WPS/BPC/BSP/BPS/BDW/file name/ALL>
   -Prefix <2-character PDS member name prefix> (default AA)
   -WorkDir <Work directory> (default /tmp)
   -ConvertCodepage <Convert codepage y/n> (default use file suffix)

Required parameters

<Component>
A specification of the DDL to copy over together with the name of a specific SQL file name ending in .ddl or .sql. The specification can be made by component or by individual file. For a component specification, only the DDL to create the databases is copied out. For the upgrade DDL, copy the files over individually.
This parameter requires one of the following values:
  • WPS - Copy over all SQL files associated with creating the Common database.
  • BPC - Copy over all SQL files associated with creating the Business Process Choreographer database.
  • BSP - Copy over all SQL files associated with creating the Business Space database.
  • BPS - Copy over all SQL files associated with creating the IBM® BPM Process Server database.
  • BDW - Copy over all SQL files associated with creating the IBM BPM Performance Data Warehouse database.
  • ALL - Copy over all files with a suffix of .ddl or .sql.
  • file_name - Copy over a specific file with a suffix of .ddl or .sql.
<PDS>
A prefix to apply to the member names which are created in the PDS. The prefix has a maximum length of two characters. The default value is AA.
<Source directory>
The UNIX System Services file system directory containing the .sql and .ddl files to copy out.

Optional parameters

<Codepage conversion flag>
A flag to specify whether to convert the code page of the SQL files. A value of y specifies that an ASCII to EBCDIC conversion should be performed as the files are copied into the PDS. A value of n specifies that no code page conversion should occur. If no value is provided for this parameter, conversion is performed based on the suffix of the file:
  • .ddl files are assumed to already be in EBCDIC and are not converted
  • .sql files are assumed to be in ASCII and are converted
The default value is on suffix.
<Prefix>
Two-character PDS member name prefix. The default value is AA. This value is used to prefix the names of the PDS members that are created. The value of this parameter is arbitrary, so you can assign any meaning to it. For example, you might use it to indicate the component to which the PDS members belong; for example, CO for Common DB and BP for BPC. Alternatively, you might assign it the value of a two-character cell identifier.
<Work directory>
The location of a work directory in the UNIX System Services file system. This directory must exist. The default location is /tmp.

Function

Run the script in a UNIX System Services environment. The script displays the parameter values, then asks whether it is safe to proceed.

If the PDS does not exist, the script attempts to create it. If the PDS exists, the script prompts for confirmation that it can reuse the existing PDS. The script aborts if it cannot reuse an existing PDS.

The files are copied into the PDS with member names of the format <Prefix><Component><Suffix> where:
  • <Prefix> is the one or two-character member name prefix provided as the script parameter -Prefix.
  • <Component> is one of WPS, BPC, BSP, BPS, or BDW if a component was specified for the -Component parameter; or MISC if a specific file name was specified for -Component.
  • <Suffix> is a numeric suffix incrementing from 1 for each execution of the script.

As members are copied over, if an identically-named member is found to exist in the PDS, the script prompts you to confirm whether to overwrite the existing member. The file is skipped if the existing member cannot be overwritten.

Finally, the script creates a <Prefix> README member that contains a log of which SQL files were copied into the PDS.

Sample

/u/healdr/dbutil/20120120-0001:>./Ddl2Pds.sh -Source /u/healdr/dbutil/DustBowl/WBI_CommonDB
 -PDS HEALDR.DDL2PDS.TEST -Component WPS

Ddl2Pds script executing ... Tue Jan 24 11:59:32 GMT 2012

Source  = /u/healdr/dbutil/DustBowl/WBI_CommonDB
PDS Name = HEALDR.DDL2PDS.TEST
PDS Member Prefix = AA
Work Directory = /tmp
Component = WPS
Codepage conversion = OnSuffix

Enter y to proceed, anything else to cancel
y

Reuse HEALDR.DDL2PDS.TEST (y to confirm)?
y

   Processing SQL file dropDatabase.sql

   Processing SQL file createDatabase.sql

   Processing SQL file createTable_AppScheduler.sql

   Processing SQL file createTable_CommonDB.sql

   Processing SQL file createTable_customization.sql

   Processing SQL file createTable_DirectDeploy.sql

   Processing SQL file createTable_EsbLoggerMediation.sql

   Processing SQL file createTable_governancerepository.sql

   Processing SQL file createTable_lockmanager.sql

   Processing SQL file createTable_mediation.sql

   Processing SQL file createTable_Recovery.sql

   Processing SQL file createTablespace_Relationship.sql

   Processing SQL file createTable_RelationshipService.sql

   Processing SQL file insertTable_CommonDB.sql

Ddl2Pds processing complete
This run copies the WPS database creation scripts over. There is no parameter supplied to determine code page conversion, so all these files do undergo an ASCII to EBCDIC conversion because they have a .sql suffix. The member HEALDR.DDL2PDS.TEST(AAREADME) is also created, which contains the following content:
Ddl2Pds log file created by HEALDR Tue Jan 24 11:59:43 GMT 2012
   dropDatabase.sql copied to member AAWPS1                    
   createDatabase.sql copied to member AAWPS2                  
   createTable_AppScheduler.sql copied to member AAWPS3        
   createTable_CommonDB.sql copied to member AAWPS4            
   createTable_customization.sql copied to member AAWPS5       
   createTable_DirectDeploy.sql copied to member AAWPS6        
   createTable_EsbLoggerMediation.sql copied to member AAWPS7  
   createTable_governancerepository.sql copied to member AAWPS8
   createTable_lockmanager.sql copied to member AAWPS9         
   createTable_mediation.sql copied to member AAWPS10          
   createTable_Recovery.sql copied to member AAWPS11           
   createTablespace_Relationship.sql copied to member AAWPS12  
   createTable_RelationshipService.sql copied to member AAWPS13
   insertTable_CommonDB.sql copied to member AAWPS14           
Ddl2Pds log file closing Tue Jan 24 11:59:46 GMT 2012