If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how to list all the database names in a connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-01-06, 00:15
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
Question how to list all the database names in a connection

Hi all,

I wish to see the list of database names that exists in a connection..
is there any inbuilt function or system tables defining this..

cheers
Sn
Reply With Quote
  #2 (permalink)  
Old 02-01-06, 00:35
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You can list all the database names in an instance:

db2 list db directory

This will include all local databases, plus any remote databases that are catalogued.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 02-01-06, 08:18
juliane26 juliane26 is offline
Registered User
 
Join Date: Oct 2005
Posts: 109
Shefu,

which platform are you on or connecting to ??

in z/OS you are actually connecting to a subsystem, so the information you are looking for could be selected using

select name from sysibm.sysdatabase
__________________
Juliane
Reply With Quote
  #4 (permalink)  
Old 02-01-06, 09:47
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
Thanks for the info juliane and marcus,

but mine is loaded in to a Windows 2000.

regards
Sn
Reply With Quote
  #5 (permalink)  
Old 02-02-06, 02:21
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
Quote:
Originally Posted by Shefu
Hi all,

I wish to see the list of database names that exists in a connection..
is there any inbuilt function or system tables defining this..

cheers
Sn
db2 "list active databases"

thx,
Jayanta Datta
Delhi NCR
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On