Pinned topic How to start DB2 on RedHat
Now I no longer start.
On RedHat machine I have the root account, then during the installation of DB2 I was asked to create an administrator account for DB2, and an account of the owner instance. I then three accounts:
-RedHat root account
-Admin DB2 account
-Owner instance DB2 account
Now how do I start DB2, so that the account owner instance can execute the query?
And then how do I put in the DB2 service to start at boot RedHat?
nivanov1 100000H9H7231 Posts
Re: How to start DB2 on RedHat2013-02-12T17:59:41ZThis is the accepted answer. This is the accepted answer.To start the instance manually execute the db2start command as the instance owner. To start it automatically you'd need to add a script performing this task to your init.d directory (or systemd, if that's what you use).
dawinter 270001NU851 Post
Re: How to start DB2 on RedHat2015-04-17T22:04:10ZThis is the accepted answer. This is the accepted answer.
You can enable the autostart for a db2inst with db2iauto -on db2inst1
Additionally the db2 install add an entry for the fault monitor in inittab.
But with Redhat 6 inittab is deprecated and with Redhat 7 upstart is deprecated and are disabled. (see http://www-01.ibm.com/support/docview.wss?uid=swg21209001)
To reenable the autostart for the fault monitor and the db2inst you can activate it via systemd as described here:
Jun Su Lee 27000725GN25 Posts
Re: How to start DB2 on RedHat2015-04-20T22:40:24ZThis is the accepted answer. This is the accepted answer.
Adding to the answers.
This is normal outlook of account configuration.
As root# groupadd db2igrp# useradd db2inst1 -d /home/db2inst1 -g db2igrp -m# groupadd db2fgrp# useradd db2fenc1 -d /home/db2fenc1 -g db2fgrp -m# passwd db2inst1# passwd db2fenc1# cd /opt/ibm/db2/V9.7/instance# ./db2icrt -u db2fenc1 db2inst1
As DB2 instance user# su - db2inst1$ db2start09/15/2009 16:57:21 0 0 SQL1063N DB2START processing was successful.SQL1063N DB2START processing was successful.$ db2 create database mydbDB20000I The CREATE DATABASE command completed successfully.[db2inst1@becker ~]$ db2 connect to mydbDatabase Connection InformationDatabase server = DB2/LINUX 9.1.3SQL authorization ID = db2inst1Local database alias = MYDB
And also, you need to two parameters to allow remote connections.
$ db2set DB2COMM=TCPIP
$ db2 update dbm cfg using svcename <port>
Port number can be referred from /etc/services file.