Link to home
Start Free TrialLog in
Avatar of ghelaniabhishek
ghelaniabhishek

asked on

create DB2 DSN via command line of a script

Hi All

We have 100+ servers were at times we need to create DB2 DSN manually on each server individually.
Can somebody help me with a tool or script where I will provide with all the parameters/options for creating the DSN and it should create the DSN on all the servers

let me konw if you need more details

Thanks in advance
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

you have two options
1) create a script that just run db2 clp commands:
db2 catalog database....
2) create all the entries you want on one server and then use db2cfexp to export those definitions to a file
 then you use db2cfimp to import those definitions on all the other servers
also
you can also use the db2cfexp to get a script file with all the commands that needs to be run
it might require some modifications if you want to add parameters but it will give you the general idea of how it should look like
Avatar of ghelaniabhishek
ghelaniabhishek

ASKER

Thank you for the response.
Could you help me with your option 1?
Do you have any script with the commands that would help me create DB2 DSN on all 100+ servers without me logging into server individually?
also these are Windows servers
run this
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0002442.html
on an already configured server to get an impression on how the script would look like

about running it on 100 windows servers, i'm not sure how it can be done without login into them, but i'm sure it's possible
basically you would need to run

db2cmd
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0002036.html
in order to initialize the clp environment and then run a script which will be very similar to the output from db2cfexp
but what will be the command to create the new DSN. I am unaware of the command parameters to be provided to create a new DB2 system DSN.
create one through the configuration assistant
then use db2fcexp to export to file
the file will have the commands that can be used to create that same dsn from the command line
can you help me with syntax on how to use it and how to create a DB2 DSN?
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial