Install > Installing WebSphere Commerce > Installing WebSphere Commerce using the custom installation > Create a WCS instance > Database considerations when creating WCS instances
DB2 considerations
You can create the database manually before creating an instance, and use the database when creating a new instance.
To manually create the DB2 Database dbname...
db2 create database dbname using codeset UTF-8 territory US
db2 alter bufferpool IBMDEFAULTBP deferred SIZE 10000 AUTOMATIC
db2 CREATE bufferpool BUFF8K deferred SIZE 5000 AUTOMATIC PAGESIZE 8 K
db2 CREATE bufferpool BUFF16K deferred SIZE 5000 AUTOMATIC PAGESIZE 16 K
db2 CREATE bufferpool BUFF32K deferred SIZE 2500 AUTOMATIC PAGESIZE 32 K
db2 "CREATE REGULAR TABLESPACE TAB8K PAGESIZE 8 K BUFFERPOOL BUFF8K"
db2 "CREATE REGULAR TABLESPACE TAB16K PAGESIZE 16 K BUFFERPOOL BUFF16K"
db2 "CREATE SYSTEM TEMPORARY TABLESPACE TEMPSYS8K PAGESIZE 8 K BUFFERPOOL BUFF8K"
db2 "CREATE SYSTEM TEMPORARY TABLESPACE TEMPSYS16K PAGESIZE 16 K BUFFERPOOL BUFF16K"
db2 "CREATE SYSTEM TEMPORARY TABLESPACE TEMPSYS32K PAGESIZE 32 K BUFFERPOOL BUFF32K"
db2 update database configuration for dbname using locklist 2400 AUTOMATIC
db2 update database configuration for dbname using indexrec RESTART
db2 update database configuration for dbname using logfilsiz 1000
db2 update database configuration for dbname using logprimary 12
db2 update database configuration for dbname using logsecond 10
db2 update database configuration for dbname using pckcachesz 4096 AUTOMATIC
db2 update database configuration for dbname using catalogcache_sz 4096
db2 update database configuration for dbname using locktimeout 45
db2 update cli cfg for section dbname using DYNAMIC 1
db2set DB2_WORKLOAD=WC
db2set DB2BIDI=yes
db2 update dbm cfg using cpuspeed -1...where dbname is the database name.
If an existing remote DB2 Database database is used for a WCS instance, the remote database needs to be cataloged locally on the Commerce machine before you create the instance.
Catalog the database
db2 catalog tcpip node node remote DB2serverHostName server TCP/IP_service_name
db2 catalog database localDatabaseAlias as remoteDatabaseName at node node
If the DB2 Database schema user is different than the instance user, it is required that you source the db2profile of the DB2 Database instance in the schema user profile. For example, add the following line in the WebSphere Commerce database user .profile file before creating the WCS instance:
. /home/DB2instanceUser/sqllib/db2profileExamples...
db2 catalog tcpip node SKYWAYN remote 10.1.70.52 server 60004
db2 catalog db SKYSTG as SKYWAYSTG at node SKYWAYN
db2 terminate
db2 connect to SKYWAYSTG user wasuser using wasuser1
db2 attach to SKYWAYN user wasuser using wasuser1
db2 "list node directory"
db2 get instance
db2 list database directory
db2 list tables for schema wasuser
select tabname from syscat.tables
db2 "quit"
Changing hostname of the DB2 server
If you change the hostname of the DB2 server, for example, by moving a VMware image from one host to another, follow the steps in the Technote: Changing hostname of the DB2 server