DB2 Database Configuration
Step 1: Create the SAMPLE Database
- Create an operating system user named wsdemo with a password
of wsdemo1. Be sure to use all lower case letters when creating the wsdemo user.
The wsdemo user does not have to have special privileges.
- On Windows, set the wsdemo user with the following properties:
- Select Password Never Expires
- De-select User must change password at next Logon
- Create the SAMPLE database:
- On OS/2:
- Open a command window
- Change to the <WAS_ROOT>\bin directory
- Invoke the following script:
DB2createSampleDB.cmd db2admin db2pwd
where:
- db2admin is the DB2 Administrator's user ID
- db2pwd is the DB2 Administrator's password
Take Note!
The database script requires that you use a user ID and password of
an account that has database create authority.
- Shut down and restart the WebSphere Application Server
- On Windows:
- Open a command window
- Change to the <WAS_ROOT>\bin directory
- Invoke the following script:
DB2createSampleDB.bat db2admin db2pwd
where:
- db2admin is the DB2 Administrator's user ID
- db2pwd is the DB2 Administrator's password
Take Note!
The database script requires that you use a user ID and password of
an account that has database create authority.
- Shut down and restart the WebSphere Application Server
- On UNIX:
- Open a command window.
- Change to the <WAS_ROOT>/bin directory
- Invoke the following script:
./DB2createSampleDB.sh db2admin db2pwd
where:
- db2admin is the DB2 Administrator's user ID
- db2pwd is the DB2 Administrator's password
Take Note! The
database script requires that you use a user ID and password of an
account that has database create authority.
- Shut down and restart the WebSphere Application Server
- On Linux:
Take Note!
Linux users create a database and an alias which connects to the database via TCP/IP.
The Linux server machine and Linux client machine described in these instructions can be the
same machine.
- Setup the Linux server machine:
- From the server machine, open a command window and logon as the DB2 administrator
- Issue the command:
db2set DB2COMM=tcpip
- Set up the server port on which DB2 listens for incoming requests:
- From the server machine, open a command window and logon as root user
- Edit the /etc/services file to add the following line:
db2cdb2inst1 port_number/tcp #DB2 connection service port
where:
- port_number is an unused port number not already listed in the /etc/services file
- From the server machine, configure the database to use the new service:
- Open a DB2 command window and issue the command:
UPDATE DBM CFG USING SVCENAME db2cdb2inst1
Take Note!
Be sure to use all lower case letters when specifying db2cdb2inst1
- Restart DB2
- Setup the Linux client machine:
- From the client machine, open a command window and logon as root user
- Edit the /etc/services file to add the following line:
db2cdb2inst1 port_number/tcp #DB2 connection service port
where:
- port_number is the same port number you specified in the /etc/services file on the server machine
- From the client machine, open a DB2 command window and logon as the DB2 administrator
- Issue the command:
CATALOG TCPIP NODE WASNODE REMOTE hostname SERVER db2cdb2inst1
Take Note!
Be sure to use all lower case letters when specifying db2cdb2inst1
- Open a command window.
- Change to the <WAS_ROOT>/bin directory
- Invoke the following script:
./DB2createSampleDB.sh db2admin db2pwd
where:
- db2admin is the DB2 Administrator's user ID
- db2pwd is the DB2 Administrator's password
Take Note! The
database script requires that you use a user ID and password of an
account that has database create authority.
- Shut down and restart the WebSphere Application Server