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 > database in catalog table.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-08-11, 14:45
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 282
database in catalog table.

Hi Colleagues,

Somebody can say me in what system catalog table is save the database name in a instance db2 9.5.

Thank you for you help.
Reply With Quote
  #2 (permalink)  
Old 03-08-11, 15:23
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
afaik, the db name is not in any system table/view.

you may use db snapshot table function/view to get db name

hth

sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 03-08-11, 15:28
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You can get the name of the (connected) database through SQL.

Code:
select CURRENT SERVER from sysibm.sysdummy1
Andy
Reply With Quote
  #4 (permalink)  
Old 03-08-11, 15:47
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 282
it seems to me very strange that not this in tables of the catalogue of the system db2 not this keeping nowhere.
Greetings.
Reply With Quote
  #5 (permalink)  
Old 03-08-11, 15:52
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
DB2 does know what databases are in its catalog. If you enter "DB2 LIST DB DIRECTORY" or "DB2 LIST DATABASE DIRECTORY", you will see all the databases catalogged on the server both local and remote.

Andy
Reply With Quote
  #6 (permalink)  
Old 03-08-11, 16:20
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 282
I make this question because I want to know the size of the database, I know that this information could be are in the catalogue tables.
Greetings.
Reply With Quote
  #7 (permalink)  
Old 03-08-11, 16:24
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Your original post only wanted to get the database name from the catalog tables. It does not exist there. If you want the size of the database, if your runstats are current, i recently posted a query that would give you the information.

Andy
Reply With Quote
  #8 (permalink)  
Old 03-08-11, 18:48
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
get_dbsize_info procedure will help to get size
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #9 (permalink)  
Old 03-09-11, 03:04
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The thing is that each database has its own catalog (in DB2 LUW). So it doesn't make much sense to store the database name in the catalog; it would just be a single value to begin with. The special register CURRENT SERVER - as mentioned by Andy - serves this purpose very well. So why would you want to have it "in a catalog table"?

p.s: LIST DB DIRECTORY shows the database directory known to the instance. That is a level above databases.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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