• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 932
  • Last Modified:

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
0
ghelaniabhishek
Asked:
ghelaniabhishek
  • 5
  • 4
1 Solution
 
momi_sabagCommented:
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
0
 
momi_sabagCommented:
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
0
 
ghelaniabhishekAuthor Commented:
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ghelaniabhishekAuthor Commented:
also these are Windows servers
0
 
momi_sabagCommented:
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
0
 
ghelaniabhishekAuthor Commented:
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.
0
 
momi_sabagCommented:
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
0
 
ghelaniabhishekAuthor Commented:
can you help me with syntax on how to use it and how to create a DB2 DSN?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now