You can choose to have databases created dynamically like SQL Server and PostgreSQL, but because Db2 database creation can be very slow, we recommended that you create them ahead of time using SQL scripts.
dbfhadmin -script -type:datastore -provider:db2 -name:<datastore-name> -file:<script-name.sql> [-existdb:<db-name>|-db:<db-name>]
where <datastore-name> must be 8 characters or less (a Db2 restriction), and where <script-name.sql> is the name of the script file to be created.
Additionally, there are two (mutually exclusive) optional parameters that you can specify: if you are creating the datastore to be within an existing Db2 database (for example, you may have one database that holds all datastores, region databases, and a cross-region database), use the -existdb option; if you are creating a new Db2 database for the datastore, use the -db option to specify the name of the database; if you omit both options, a new database with a default name will be created - the default name is the value given for the -name option.
Once you have created the script files, use the dbfhadmin utility to run them, and create the required databases.
dbfhadmin -createdb -file:<script-name.sql> -type:datastore -provider:db2
where <script-name.sql> is the name of the script file that was created in an earlier step.
Next, you must create or edit a configuration file, so that it contains entries to the datastore databases.