The specified service name and port number conflicts with
existing values in the TCP/IP services file. Do you wish to
overwrite the existing values in the services file?
Explanation:
The service name and port number entered by the user conflicts
with existing values in the TCP/IP services file. The service
name may already be used with a different port number, the port
number may already be used with a different service name or
both.
You don't give too many details about what you're trying to do, but
it's pretty simple. Here's a listing of commands from a DB2 command
window:
1) List existing instance(s):
D:\Program Files\IBM\SQLLIB>db2ilist
DB2
2) Create a directory for the instance profile path
D:\Program Files\IBM\SQLLIB>mkdir DB2INST2
3) Create the new instance (db2inst2)
D:\Program Files\IBM\SQLLIB>db2icrt db2inst2 -s wse -p
"D:\Program Files\IBM\SQLLIB\DB2INST2"
-u db2admin,password
DB20000I The DB2ICRT command completed successfully.
Note, the '-r' option specifies port numbers for the database
partitioning feature (DPF) -- not the TCP/IP listener port that
clients use to connect to. If you aren't using DPF, you don't
need '-r' in db2icrt.
4) Validate that the new instance exists
D:\Program Files\IBM\SQLLIB>db2ilist
DB2INST2
DB2
5) Terminate any existing DB2 backend process (db2bp.exe) and
set the DB2INSTANCE variable to the new instance:
D:\Program Files\IBM\SQLLIB>db2 terminate
DB20000I The TERMINATE command completed successfully.
D:\Program Files\IBM\SQLLIB>set DB2INSTANCE=db2inst2
6) Set up TCPIP communication for the new instance:
D:\Program Files\IBM\SQLLIB>db2set
DB2INSTPROF=D:\Program Files\IBM\SQLLIB\DB2INST2
D:\Program Files\IBM\SQLLIB>db2set DB2COMM=TCPIP
D:\Program Files\IBM\SQLLIB>db2set
DB2INSTPROF=D:\Program Files\IBM\SQLLIB\DB2INST2
DB2COMM=TCPIP
D:\Program Files\IBM\SQLLIB>db2 get dbm cfg | findstr /i svce
TCP/IP Service name (SVCENAME) =
D:\Program Files\IBM\SQLLIB>db2 update dbm cfg using svcename 50010
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
D:\Program Files\IBM\SQLLIB>db2start
SQL1063N DB2START processing was successful.
Now, once you create a new database, clients should be able to
connect to the it using port 50010 (or whatever you specify). You
can use a name instead of a direct port number if you update the
services file first.
Remember that the DB2INSTANCE environment variable controls which
instance and DB2 commands will execute against.
Good luck,
First check your services file for an already existing entry for port 50001.
(IIRC for Windows it resides in C:\WINDOWS\system32\drivers\etc\services)
Also check the db2 registry variables for both instances with:
db2set -i <inst1> -all
db2set -i <inst2> -all
For both instances variable DB2COMM should be set to tcpip.
Setting for variable DB2PORTRANGE should match corresponding settings in the
services file.
Thirdly check the SVCENAME in the database manager configuration file (for
both instances).
HTH.
--
Jeroen
> Now, once you create a new database, clients should be able to
> connect to the it using port 50010 (or whatever you specify). You
> can use a name instead of a direct port number if you update the
> services file first.
>
> Remember that the DB2INSTANCE environment variable controls which
> instance and DB2 commands will execute against.
Thanks for the info. I beleive I am okay up until the step listed
above where you are updating the svcename variable, and this is where
my confusion lies with creating a second instance. According to my
dbm cfg, the svcename is current defined as "db2c_DB2" (note that this
is a windows platform) and if I look at the C:\WINDOWS\system32\drivers
\etc\services file, there is the following entry which reflects our
default DB2 instance:
db2c_DB2 50000/tcp
So my question is, if I run the command you specifiy (db2 update dbm
cfg using svcename 50010), will this simple updtate the entry above,
or will it create a new one? Can I have two entries for the same
service? What I want is to be able run both instances at the same
time on different ports; is this possible?
The SVCENAME parameter can either use a name (in which case DB2 will
resolve the port number by looking at the services file) or a port
number. The UPDATE DB CFG command will not affect the services file.
On Linux/UNIX, it is standard practice to add an entry to the services
file (/etc/services) for any application that is going to use a
particular port, but my experience is that most Windows programs don't
do this.
So, if you want to use a name instead of port number, you'll have to
edit the file manually and add a new entry.
Following convention, you would add:
db2c_DB2INST2 50010/tcp # Client connect port for DB2INST2
Then, you can execute the command,
db2 update dbm cfg using svcename db2c_DB2INST2
If you specify a port name but don't add it to the services file, the
DB2 instance will start, but will give an error about not being able to
start a listener for all protocols (and no TCP/IP communication will be
possible).
Good luck,
> Can I have two entries for the same service? What I want is to be
> able run both instances at the same time on different ports; is this
> possible?
>
Oh, and to answer your other questions: You need a separate listener
port for each DB2 instance. So (if you choose to follow convention)
you would need at multiple entries in the services file. And yes, you
can run multiple instances simultaneously listening on different ports.
Thanks for the added info, I think I am almost there. I am following
you, but here is another quesiton which I hope is not too dumb; the
entries in the C:\WINDOWS\system32\drivers \etc\services file are
windows services are they not? In your example above, how does the
db2c_DB2INST2 service get created?? Does the db2 update dbm cfg
command do this behind the scenes? I guess this goes back to my
original post, where I asked if another service had to be created for
each new instance (and if so, how).
The entries in this file are *not* Windows services. This file serves
only to map port names to port numbers. This allows programs to open
a port called "my_port", yet the system administrator can change what
port "my_port" actually refers to.
As I said before, the UPDATE DBM CFG command does not touch the
services file -- you have to edit it manually to add the entry.
When you installed DB2 on your machine, the DB2 installer (setup.exe)
added the other entry (db2c_DB2) that you saw when it created the
default instance ("DB2").
I might be wrong, but I get the impression you don't realise that each
instance has its own DBM CFG.
Your first instance has SVCENAME=db2c_DB2 which corresponds with the
services entry above.
Your second instance should have something like SVCENAME=db2c_DB2INST2 and
you should add following entry to your services file:
db2c_DB2INST2 50001/tcp
(or 50010 or whatever portnumber you intended to use).
Note: when updating the DBM CFG, make sure the DB2INSTANCE registry variable
is set to the correct instance name.
--
Jeroen
You are correct, I did not realize this until yesterday from reading
the previous post(s). I finally got things working, only is was not
quite the way described here.
First of all, the "db2 update dbm cfg" command would not run from a
standard windows command prompt window, I received an error about
something not being initialized. After googling the error, the
solution was to run it under the CLP, which I did. It ran, but I
could only get it to update the default DB2 instance, not the new one
I created. Obviously there must be some way under the CLP to say
which instance you are updating, but I did not know what that was and
it was getting late. You mention setting the DB2INSTANCE registry
variable above; how is this done via the CLP window? I tried setting
this variable via the regular windows command window using the 'set'
command (as described in the first response to my post), and it
worked, but the CLP would always update the default DB2 instance.
My solution was to go into control center, right-click on the new
instance, select 'setup communcations' and then define the host,
service name, and port in the fields provided. Once I did that and
restarted the instance, everything worked great.
>> Note: when updating the DBM CFG, make sure the DB2INSTANCE registry variable
>> is set to the correct instance name.
DB2INSTANCE should be set in the environment, not via the `db2set'
command (i.e. in the DB2 registry -- not to be confused with the
Windows registry).
> First of all, the "db2 update dbm cfg" command would not run from a
> standard windows command prompt window, I received an error about
> something not being initialized. After googling the error, the
> solution was to run it under the CLP, which I did. It ran, but I
> could only get it to update the default DB2 instance, not the new one
> I created. Obviously there must be some way under the CLP to say
> which instance you are updating, but I did not know what that was and
> it was getting late. You mention setting the DB2INSTANCE registry
> variable above; how is this done via the CLP window? I tried setting
> this variable via the regular windows command window using the 'set'
> command (as described in the first response to my post), and it
> worked, but the CLP would always update the default DB2 instance.
On Windows, DB2 sets a *system* environment variable DB2INSTANCE to the
default instance that was created during install. So, it's set to "DB2"
by default.
If you always want DB2INSTANCE to be set to DB2INST2 (or whatever) when
you open the DB2 command prompt, you can change the value of
DB2INSTANCE.
* Right click on My Computer, select "Properties"
* Choose the "Advanced" tab
* Click on the "Environment Variables" button
* In System Variables, find DB2INSTANCE and change it from "DB2" to
the name of your other instance.
If you need to be more flexible, you just have to remember to change the
DB2INSTANCE environment variable. I am sure there is probably a way to
set your command prompt to show the value of DB2INSTNANCE, but I'm not
really a Windows guy anymore. Something like:
PROMPT $C%DB2INSTANCE%$F $P$G
This shows the value of DB2INSTANCE when the PROMPT command is set, but
it is not dynamic.
Good luck,