Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting database, instance, tablespace info using CLI

Status
Not open for further replies.

billhoves

Programmer
Aug 28, 2001
5
US
Are there commands, either CLI or API to list:
o Instances on the server
o Databases for each instance
o Tablespaces for each databases

??

Basically, I'm trying to re-create the tree that comes
up in the left side of the control center and need to
extract all this information from within a 'C' program.

TIA, Bill

 
Try using some of the sample C programs that call DB2's API's
 
The CLI's that you can use are:
Get Instance
List Active Databases
List Database Directory
List Tablespaces ( show detail)
List Tablespace Containers

There are many more just type db2 ? on a command window.

Hope this helps alittle more
 
I've checked the sample programs, no luck. Also, I can't call the CLP
commands from a processor window. I need to execute them from a
'C' program. Thanks for the replies, Bill
 
Hi Bill
I know that there is a sample C Program for Tablespaces because i have used and adapted it make it do what i want it to do. I can post it if you are interested but the sample c program i used is called tabspace.sqc . But these programs are only a sample of the API's avaliable to you. but to use the API's you have to have a reasonable understanding on how they work. If you look up in the help under -> Application Programming -> Administrative API Reference -> DB2 API's, you can find a whole list of API's and there structures. You can do anything you can do with CLP!

I hope this helps.
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top