To set up a database in DB2 to be used as the WebSphere administrative repository, you need to perform the following tasks on the database server:
Here, you create the WebSphere Application Server repository database, also known as the WebSphere database. The database will be populated with WebSphere schema and default values later. To set up the WebSphere database, complete the following steps:
- Open a DB2 command window by clicking Start>Programs>IBM DB2>Command Window.
- Create the WebSphere database and configure its heap size to suit WebSphere requirements:
D:\ > db2 create db was1D:\ > db2 update db cfg for was1 using applheapsz 256
- Check that the new database is known to DB2:
D:\ > db2 list db directory. This command should give output containing the following:Database 1 entry:
Database alias =WAS1 Database name =WAS1 Database drive =D:\DB2 Database release level =9.00 Comment = Directory entry type =Indirect Catalog node number =0 - To access the administrative database via TCP/IP, the DB2 node must first be cataloged:
D:\ > db2 catalog tcpip node node_name remote local_hostname server service_nameImportant note: The service_name used to catalog the node must be the same as the database instance connection port name in the Windows services file -- in our case, DB2CDB2. The node_name chosen can be any valid DB2 node name. Windows network name is a valid DB2 node name, so we used our network name (DB2WAS) for both node_name and local_hostname.
- The administrative database must now be cataloged as part of this TCP/IP node:
D:\ > db2 catalog db was1 as was at node node_name - Check that the database TCPIP alias is known to DB2:
D:\> db2 list db directoryDatabase 2 entry:
Database alias =WAS Database name =WAS1 Node name = node_name Database release level =9.00 Comment = Directory entry type =Remote Catalog node number =-1 - Verify connection to the local database via TCP/IP:
D:\> db2 connect to was user db2admin_user using db2admin_passwd
D:\> db2 disconnect currentNote: Passwords are case-sensitive. db2admin_user and db2admin_passwd are the DB2 administration account and password respectively on the local DB2 server.
- Close the DB2 command window.
Create the WebSphere access account
A new user must be set up in the WebSphere administrative database for use by WebSphere for all database access:
- Create a new local Windows user account, was_user.
Tip: We suggest that a user called was be used as the WebSphere DB2 access account. Our examples assume this is the case.
- Open a DB2 command window by clicking Start>Programs>IBM DB2>Command Window.
- Connect to the WebSphere database as the DB2 administrator:
D:\> db2 connect to was user db2admin_user using db2admin_passwd
D:\> db2 grant connect,createtab on database to user was_user
D:\> db2 disconnect was - Test the connection to the WebSphere database using the was_user account:
D:\> db2 connect to was user was_user using was_password. This should give output containing the following:Database Connection Information Database server =DB2/NT 7.2.1 SQL authorization ID = was_user Local database alias =WAS
This test mimics the method used by the WebSphere administrative server to access the WAS database.
- Disconnect from the current database:
D:\> db2 disconnect current - Close the DB2 command window.