IBM WCS - Configuration to point to new DB - switching between local DB and development / integration / production DB

Step1 - Go to xml/config and Open <instance_name>.xml or could be wc-server.xml

Step 2 - Identify the Database sectionat the top of the file and make the appropriate changes in this section.

<Database>
      <DB DBAHomeDir=""
          DBAName=""
          DBAPwd=""
          DBHost="myhost.ibm.com"
          DBMSName="DB2"
          DBNode="mynode"
          DBServerPort=""
          DBUserHomeDir=""
          DBUserID="myuserid"
          DBUserPwd="Minsq+r9JqRrQSWb4dmuWQ=="
          DefaultLang=""
          JDBCDriverType="native"
          OraUserID=""
          RemoteDB="false"
          RunDB2SG="false"
          ServiceName=""
          StagingEnable="false"
          active="true"
          name="MyDBName" />
    </Database>

CreateDB

Optional: true or false.If specified true, the command creates the DB Schema.

DBAHomeDir

Database Home Directory. Keep it blank if you don't have different instances installed on your database server. 
 
DBAName

Name of the DBA. 
For example - wasadmin
 

DBAPwd

DBA Password
 

DBHost

Host Name or IP address of the Database.
For example - myhost.ibm.com
 
DBMSName


Database type. 
For example - "oracle" , "DB2"
 
DBNode


Optional. 
Node of the remote database.
 
DBServerPort


Optional. 
Port number of remote database server.
 
DBUserHomeDir


Optional
Home Directory of the user that connects to the DB.
 

DBUserID

User Id with which you want to connect to DB. 
For example - dbadmin
Could be same as DBAName 
 

DBUserPwd

Password of the user with which you want to connect.
Could be same as DBAPwd
 

DefaultLang

Optional. 
 

JDBCDriverType

Optional. 
JDBC driver type.
 

OraUserID

Optional
 

RemoteDB

true or false.
false if its on local DB. 
true if its remote DB.

RunDB2SG

True or False. 
Default is false. 
 

ServiceName

Optional.
 

StagingEnable

Default is "false".
"true" to enable Management Center tool to support workspaces. 
 

active

true or false. 
Default - true.  
Make it false to deactivate the DB.

name

Name of the DB. 
For example - MyDB




Step 3 - Restart the application server to load the new Database configuration.

If it doesn't work by making change directly in wc-server.xml , try using setdbtype


Step 1 - Open command prompt using "Run as Administrator"

Step 2 - Go to WCTK\bin

Step 3 -

Execute the following command -

setdbtype oracle C:\oracle\product\10.2.0\db_1 <ServiceName> <DBAName> <DBAPwd> <DBUserID> <DBUserPwd> <DBHost> <DBServerPort>

Example -

setdbtype oracle C:\oracle\product\10.2.0\db_1 localDB system pass build pass localhost 1521