Database transfer: Create DB2 database
- Copy the JDBC driver library JAR files from the database server...
/opt/ibm/db2/V10.5/java/db2jcc4.jar
/opt/ibm/db2/V10.5/java/db2jcc_license_cu.jar...to the portal server, in the directory specified by...
- Log on to the DB2 host
- Switch user to a DB2 system administrator (SYSADM or SYSCTRL).
su - domain.DBA.DbUser
- Copy the downloaded script for this step to the database server, and extract the file.
- Rename the file to include a .sh extension.
- Run the shell file on the database server.
cd /path/to/db/server/files/ ./CreateDB2Database.sh
Example of the wizard-generated script...
db2set DB2COMM=TCPIP
db2set DB2_EVALUNCOMMITTED=YES
db2set DB2_INLIST_TO_NLJN=YES
db2 "UPDATE DBM CFG USING sheapthres 0"
db2 "CREATE DB WPSDB using codeset UTF-8 territory us PAGESIZE 8192"
db2 "UPDATE DB CFG FOR WPSDB USING locktimeout 30"
db2 "CONNECT TO WPSDB USER dba_ID USING dba_pwd"
db2 "CREATE BUFFERPOOL ICMLSFREQBP4 SIZE 1000 AUTOMATIC PAGESIZE 4K"
db2 "CREATE BUFFERPOOL ICMLSVOLATILEBP4 SIZE 16000 AUTOMATIC PAGESIZE 4K"
db2 "CREATE BUFFERPOOL ICMLSMAINBP32 SIZE 16000 AUTOMATIC PAGESIZE 32K"
db2 "CREATE BUFFERPOOL CMBMAIN4 SIZE 1000 AUTOMATIC PAGESIZE 4K"
db2 "CREATE REGULAR TABLESPACE ICMLFQ32 PAGESIZE 32K BUFFERPOOL ICMLSMAINBP32"
db2 "CREATE REGULAR TABLESPACE ICMLNF32 PAGESIZE 32K BUFFERPOOL ICMLSMAINBP32"
db2 "CREATE REGULAR TABLESPACE ICMVFQ04 PAGESIZE 4K BUFFERPOOL ICMLSVOLATILEBP4"
db2 "CREATE REGULAR TABLESPACE ICMSFQ04 PAGESIZE 4K BUFFERPOOL ICMLSFREQBP4"
db2 "CREATE REGULAR TABLESPACE CMBINV04 PAGESIZE 4K BUFFERPOOL CMBMAIN4"
db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE32 PAGESIZE 32K BUFFERPOOL ICMLSMAINBP32"
db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE4 PAGESIZE 4K BUFFERPOOL ICMLSVOLATILEBP4"
db2 "CREATE USER TEMPORARY TABLESPACE ICMLSUSRTSPACE4 PAGESIZE 4K BUFFERPOOL ICMLSVOLATILEBP4"
db2 "DISCONNECT WPSDB"
db2 "TERMINATE"
db2 "UPDATE DB CFG FOR WPSDB USING logfilsiz 16000"
db2 "UPDATE DB CFG FOR WPSDB USING logprimary 20"
db2 "UPDATE DB CFG FOR WPSDB USING logsecond 50"
db2 "UPDATE DB CFG FOR WPSDB USING logbufsz 500"
db2 "UPDATE DB CFG FOR WPSDB USING DFT_QUERYOPT 2"Instructions for Windows
- Copy the JDBC Driver JAR files from the database server to the portal server.
Example location:
C:\\Program Files\\IBM\\SQLLIB\\java\\db2jcc4.jar
C:\\Program Files\\IBM\\SQLLIB\\java\\db2jcc_license_cu.jar
Place the files on the portal server in the directory specified for database library files.
db2.DbLibrary
- Log in as a DB2 system administrator. This DB2 system administrator must have the required database privileges (SYSADM or at a minimum SYSCTRL) to create the database. This user is typically a member of both the Administrators and DB2ADMNS groups.
- Copy the script downloaded for this step to the database server, and extract the file.
- Rename the file downloaded to include a .bat extension.
- Run the batch file on the database server.
db2cmdadmin.exe -w C:\\/path/to/db/server/files\\CreateDB2Database.bat
Example of the script is not available for Windows.
See Also