Creating the database
If you have an existing database, you can do one of the following
with the database:
- To preserve the data in the database, you must migrate it to the current schema level using the Migration Utility. Download the utility from the following web site: http://www-01.ibm.com/support/docview.wss?uid=swg27007137. The instructions for using the utility are located on the web site.
- To not preserve the data in the database, manually drop the database and then complete the instructions for creating a database.
Before beginning to create the new database, ensure that the application server is stopped.
To create the database, follow these steps:
- On the ISPF Install menu, select Option 1, Create database. A JCL stream is presented in an editor. The JCL uses program DMHTEP2 to submit the DDL to create the database with all associated tablespaces, tables, and indexes. There are database COMMIT statements at regular intervals in the input stream. You might need to change some of the following entries on the input stream:
- The CREATE INDEX . . . FREEPAGE option is set to 10 for
most of the indexes. This setting adds a free page to the index space
for every ten full index pages that are created by using DB2® utilities, or if CREATE INDEX is invoked
after the table already contains data rows. However, in Rational® Asset
Analyzer for System z®, DB2 is loaded by using only SQL INSERT statements
(never the DB2 LOAD utility),
and indexes are never created dynamically.
Thus the only time that DB2 will use the FREEPAGE setting is if the database is REORGed. As a result, the CREATE INDEX . . . FREEPAGE value might never get used. If, however, there is a policy to REORG all DB2 tables at regular intervals and you have very limited DASD space, the DBA might want to change this value to 0 or 20. In addition, in an environment of constrained memory, the DBA might want to set the SECQTY to 20 percent of the primary quantity.
- If you run the job to create the database a second time after a successful creation, before resubmitting the job, you must uncomment the DROP statements for DATABASE and STOGROUP and their corresponding COMMIT statements. To uncomment, remove the '––' symbols preceding the statements.
- The CREATE INDEX . . . FREEPAGE option is set to 10 for
most of the indexes. This setting adds a free page to the index space
for every ten full index pages that are created by using DB2® utilities, or if CREATE INDEX is invoked
after the table already contains data rows. However, in Rational® Asset
Analyzer for System z®, DB2 is loaded by using only SQL INSERT statements
(never the DB2 LOAD utility),
and indexes are never created dynamically.
- This job must be submitted by a user with the proper DB2 authority for creating a database, tables, indexes, views and triggers. If you do not have the authority to create these objects, save this file and have the appropriate user submit this job. If you do have the proper authority, submit the job by entering the SUB command.
- Check each step in the JESYSMSG JES2 for a condition code of 0000.
- Check for errors within the DMHTEP2 step. Use
the following process to find errors, correct them, and resubmit the
job to create the database:
- Search the SYSPRINT DMHTEP2 file for the string, SQLERRP, to find the group of statements that document the error.
- Correct the error.
- Identify what components, if any, were created, and then delete
them before you try to create the database again. Edit SYSPRINT
DMHTEP2, and scan each CREATE statement for SQLCODE
= 000. Below is an example of a successful creation
of database DMHDB:
***INPUT STATEMENT: CREATE DATABASE DMHDB DMHSTOGR SYSDEFLT BUFFER POOL BP0; RESULT OF SQL STATEMENT: DSNT400I SQLCODE = 000, SUCCESSFUL EXECUTION CREATE SUCCESSFUL - If the database was created successfully, uncomment the DROP DATABASE and COMMIT statements. If during installation you specified “Y” to “New storage group?” and the STOGROUP was created successfully, uncomment the DROP STOGROUP and COMMIT statements.
- Resubmit the job.
- Check
for errors within the INSERTS step. Use the following
process to find errors, correct them, and resubmit the job to finish
preparing the database:
- Determine the particular error by looking in the PRINT PRTERR output for any errors or exceptions.
- If you find an OutOfMemoryError indicator or
a message indicating Could not create the Java virtual machine,
submit the job again after making the following changes:
- Update the JOB card to increase the REGION value to at least 128M. If the JVM still cannot be created, continue to increase the value in 10M increments.
- Delete the job steps prior to the INSERTS step.
- Submit the job and check the results.