DB2 Database Configuration
Create an operating system user named wsdemo, with a password
of wsdemo1. 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.
Run the ImportSamples script to create a SAMPLE database, create a SAMPLE data
source, and install the Samples Enterprise Application on your WebSphere Application
Server.
- On Windows:
- Verify that the WebSphere Application Server has started.
- Open a command window.
- Change to the <WAS_ROOT>\bin directory.
- Invoke the following script:
ImportSamplesDB2.bat db2admin db2pwd
where:
- db2admin is the DB2 Administrator's user ID.
- db2pwd is the DB2 Administrator's password.
The database
script requires that you provide the user ID and password of an account
that has database create authority.
- Start or restart the Default Server.
- Select Enterprise Application and click Refresh,
to show the newly installed Enterprise Application. The name of the application
is Samples.
- On UNIX:
- Verify that the WebSphere Application Server has started.
- Open a command window.
- Change to the <WAS_ROOT>/bin directory.
- Invoke the following script:
./ImportSamplesDB2/.sh db2admin db2pwd
where:
- db2admin is the DB2 administrator's user ID.
- db2pwd is the DB2 administrator's password.
The database
script requires that you provide the user ID and password of an account
that has database create authority.
- Start or restart the Default Server.
- Select Enterprise Application and click Refresh
button, to show the newly installed Enterprise Application.
The name of the application is Samples.
- On Linux:
Create a database
and an alias which connects to the database through TCP/IP. The Linux server
machine and Linux client machine described in these instructions can be the
same machine.
- Set up the Linux server machine:
- From the server machine, open a command window and log on 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 log on 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 that is
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
Use
all lower case letters when specifying db2cdb2inst1
- Restart DB2.
- Setup the Linux client machine:
- From the client machine, open a command window and log on 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 log on as the DB2 administrator
- Issue the command:
CATALOG TCPIP NODE WASNODE REMOTE hostname
SERVER db2cdb2inst1
Use all
lower case letters when specifying db2cdb2inst1
- Verify that the WebSphere Application Server has started.
- Open a command window.
- Change to the <WAS_ROOT>/bin directory.
- Invoke the following script:
./ImportSamplesDB2/.sh db2admin db2pwd
where:
- db2admin is the DB2 Administrator's user ID.
- db2pwd is the DB2 Administrator's password.
The database
script requires that you provide the user ID and password of an account
that has database create authority.
- Start or restart the Default Server.
- Select Enterprise Application from the topology and click on
the Refresh button in the toolbar to show the newly installed Enterprise
Application. The name of the application is Samples.
Run the servlet to create and configure the tables in the SAMPLE database.