Thursday, 29 May 2014

How to create an instance on Unix

How to create an instance on Unix

A more detailed explanation over creating an instance on unix systems

How to create an instance

To create an instance you should go to the directory where db2icrt can be found:
On DB2 8 the default path is:
/usr/opt/db2_08_01/instance
Then run the command ./db2icrt –u <instance_name> <instance_name> as root.
Example:
./db2icrt -u instdb2 instdb2
[YOU HAVE NEW MAIL]
DBI1070I Program db2icrt completed successfully.
The next thing you should do is to check and configure the ports used by the  instance on the /etc/services file.
To do that add these lines to the /etc/services files:
<instance_name> + c    <port number>      #connection port
<instance_name> + i     <port number+1>  #interrupt port
Note 1: to edit the /etc/services file use the command:
sudo vi /etc/services
Note 2: make sure you are using available and  that you have permission to use the port you are using with your system admin
Example:
instdb2c      3708/tcp           #connection port
instdb2i       3709/tcp           #interrupt port
After that log on the instance user and configure the DB2COMM variable:
# su - <instance user>$ db2set DB2COMM=tcpip
Now set the AUTHENTICATION and SVCNAME parameters on DBM CFG:
$ db2 update dbm cfg using AUTHENTICATION <auth_type>
$ db2 update dbm cfg using svcename <instance_name> + c
Exemplo:
$ db2 update dbm cfg using AUTHENTICATION SERVER
$ db2 update dbm cfg using svcename instdb2c
And start the instance:
$ db2start
Check your instance with the db2level and db2ilist commands:
Example:
db2level 
DB21085I  Instance "instdb2" uses "32" bits and DB2 
code release "SQL08021" with level identifier"03020106".
Informational tokens are "DB2 v8.1.1.82","OD_14081", 
U803799_14081", and FixPak "8". Product is installed at
"/usr/opt/db2_08_01".

No comments:

Post a Comment