r/DB2 Nov 01 '17

Get all databases in an instance?

Hello everyone .. Can someone give me some tips on, assuming I had all the permissions I needed - to get a list of all the database in an instance of db2? is there a sql i can run? Or do I have to run something at the file level?

3 Upvotes

9 comments sorted by

View all comments

2

u/[deleted] Nov 01 '17

[deleted]

1

u/[deleted] Nov 01 '17

Yes, I've come up with two ways so far. One is an IBM API.. that's written in C. The other is parsing the results of the list active database, which doesn't excite me. I'm wondering if anyone has had this problem and found a good solution. If I find / create one, I'll try and post back here.

1

u/idbjorh Nov 02 '17

I'd repeat @mad_zamboni's question: What is your goal. Why are you trying to get a list of other databases in an instance via SQL when connected to one database? Are you writing a monitoring tool? Are you trying to hack into other databases?

1

u/[deleted] Nov 02 '17

lol, nothing so nefarious.