(DB2)Configure a Db2 Database
Use a script to prepare a Db2 Database for use with WebSphere Commerce.
Before beginning
- Ensure that you have a Db2 server ready for use. For information, see Installing the IBM Db2 database.
- Create a database user (dbuser). For example, wcs.
- (Windows) Initialize variable to support running Db2 commands in the Windows command line.
Procedure
- If we are using a remote IBM Db2 server, transfer the WCDE_installdir/bin/create_database_db2.bat/sh script to your remote Db2 server into a directory that a database administrator can access.
Note: The create_database_db2.sh script is for IBM Db2 on Linux and the create_database_db2.bat script is for IBM Db2 on Windows.
- (Linux) Add execute permissions to be able to run the script.
chmod +x create_database_db2.sh
- Log on as a system administrator or database administrator.
- Open a command line interface. (Windows)
Note: Open the Db2 command line processor (db2cmd.exe). If the command line processor automatically displays the db2> prompt, enter quit to exit.
- Go to the create_database_db2 script.
- Run the script to create a database.
- (Linux)
./create_database_db2.sh dbNamedbaUser dbaPassword dbUser
- (Windows)
create_database_db2.bat dbNamedbaUser dbaPassword dbUser
- dbName
- The name of the database to create.
- dbaUser
- The database administrator.
- dbaPassword
- The database administrator password.
- dbUser
- The name of a database user.
For example,
./create_database_db2.sh mall db2admin passw0rd wcs
Note: If you need to troubleshoot any issues, the log file createdb.db2.log is created in the same directory as the script file.
- Back up the database. For more information about how to back up, see BACKUP DATABASE COMMAND.
What to do next
Configure the development environment to use a DB2 database by following the steps in Changing the development database type using setdbtype.