Configuring DB2 for TRIRIGA on UNIX and Linux by using scripts
Use the db2createinst, db2configinst, and db2createdb commands to create and configure a DB2 database on UNIX or Linux.
Procedure
-
Log in to the server that is running DB2 as a user that has administrative
permissions on the system.
The user must be able to create system users and DB2 instances.
- Create system users for TRIRIGA.
- Create a system user for TRIRIGA to access the database, for example, tridata. This user is given permission to access to the database by the scripts.
- Create the DB2 instance owner, for example triinst. The DB2 instance owner creates the DB2 instance for TRIRIGA. This user must not have any existing DB2 instances associated with it. The triinst user ID must be assigned to the db2iadm1 group.
- Create the fenced user ID for the DB2 instance, for example, db2fenc1. This user ID might already exist on the system and can serve as the fenced user ID for other DB2 instances. The db2fenc1 user ID must be assigned to the db2iadm1 group.
- Create a system user for TRIRIGA to access the database, for example, tridata.
- Create the DB2 database instance.
- Copy the db2createinst.sh command file from /Scripts in the installation media to a temporary directory on the DB2 server.
- Ensure the user ID has execute privileges on the file and write privileges to the current directory.
- Open a shell window and run the db2createinst command to create the database instance.
db2createinst.sh name port installDir fenceUser > outputfilename
The name parameter specifies the DB2 instance owner. The port parameter specifies the server port that is used by this instance of DB2. The installDir parameter specifies the installation location of DB2. The fenceUser parameter specifies the DB2 fence user. The outputfilename parameter specifies the file that is used to capture output from the command.The following example provides sample syntax for the db2createinst command../db2createinst.sh triinst 50006 /opt/ibm/db2/V11.x db2fenc1 > db2createinst.log
If the command generates an instance creation return code of 0, the DB2 database instance is created, and the message Instance instance name has been created successfully on port port number is displayed. If the command generated any return codes other than 0, examine the output of the command to determine the cause of the error. You can capture the output of the script to a file to evaluate the command results. Do not attempt to configure the database instance until the db2createinst command completes successfully. - Log in to the server that is running DB2 as the instance user.
- Configure the DB2 database instance.
- Copy the db2configinst.sh command file from /scripts in the installation media to a temporary directory on the DB2 server.
- Ensure the user ID has execute privileges on the file and write privileges to the current directory.
- From the shell window, run the db2configinst command to create the database instance.
db2configinst.sh name port installDir > outputfilename
The name parameter specifies the DB2 instance to configure. The port parameter specifies the server port that is used by this instance of DB2. The installDir parameter specifies the installation location of DB2. The outputfilename parameter specifies the file that is used to capture output from the command.The following example provides sample syntax for the db2configinst command../db2configinst.sh triinst 50006 /opt/ibm/db2/V11.x > db2configinst.log
If the command generates a return code for starting instance of 0, the DB2 database instance is created, and the message Instance instance name has been configured successfully and started on server name is displayed. If the command generated any return codes other than 0, examine the output of the command to determine the cause of the error. You can capture the output of the script to a file to evaluate the command results. Do not attempt to create the database until the db2configinst command completes successfully. - Create and configure the DB2 database.
- Copy the db2createdb.sh command file from /scripts in the installation media to a temporary directory on the DB2 server.
- Ensure the user ID has execute privileges on the file and write privileges to the current directory.
- From the shell window, run the db2createdb command.
db2createdb.sh name instance territory installDir tririgaUser > outputfilename
The name parameter specifies the name of the database. The instance parameter specifies the instance that is associated with the database. The territory parameter designates the code that is used by the database manager internally to provide region-specific support. The installDir parameter specifies the installation location of DB2. The tririgaUser parameter specifies the TRIRIGA user ID used to access the database. The outputfilename parameter specifies the file that is used to capture output from the command.The following example provides sample syntax for the db2createdb command../db2createdb.sh tririga triinst US /opt/ibm/db2/V11.x tridata > db2createdb.log
If the command generates an exit return code of 0, the DB2 database is created and configured, and the message Database database name has been created successfully on instance name is displayed. If the command generated any return codes other than 0, examine the output of the command to determine the cause of the error. You can capture the output of the script to a file to evaluate the command results. Do not continue with the IBM® TRIRIGA Application Platform installation process until the db2createdb command completes successfully.