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 > Simple table question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-03, 23:33
miemcos miemcos is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Simple table question

1. How to describe the definition of table from DB2 database?
ie. equal to "desc <table_name>" in Oracle env.

2. How can i found the owner information of a table?

3. Any good reference for studying "sysibm" and "syscat" schemas?
The two schemas contain many database internal information, such as the name of tablspaces, auit setting, schema setting, etc. How can we check it and What actually information can be found by using sysibm and syscat schemas?


Thanks
Reply With Quote
  #2 (permalink)  
Old 12-09-03, 01:30
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

1. describe table schema.table_name

2. db2 list tables for all - list all tables

3. At DB2 support site there is book Administration Guide.

Hope this helps,
Grofaty
Reply With Quote
  #3 (permalink)  
Old 12-09-03, 02:56
miemcos miemcos is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks, just a little bit followup of the second question.

do you mean, schema name = owner of the tables?
If yes, I would like to clarify that who will be the owner of tables if the table is under a schema which is not the same as the username.
(eg. a "schema.tablename" table was create by db2_inst1 user while there is no user which is called "schema".)

Then how can we check the owner of the table if we dont know such table was created by db2_inst1 user.

Thanks a lot
Reply With Quote
  #4 (permalink)  
Old 12-09-03, 04:18
nitingm nitingm is offline
Registered User
 
Join Date: Jul 2003
Location: Austin, TX, USA
Posts: 278
Schema

Hi ,

A schema is nothing but a logical name for a group of tables owned by a user.

Let's say if db2inst1 is the user then all the tables that are created by db2inst1 are said to be db2inst1's schema.

So now I can say db2 describe table db2inst1.test

Here db2inst1 = schema so for any user authorised to create a table schema would = username


Hope that explains.


nitin.
Reply With Quote
  #5 (permalink)  
Old 12-09-03, 22:05
udb_dba udb_dba is offline
Registered User
 
Join Date: Oct 2003
Posts: 29
Db2 list tables for schema <schema name>

Will list all the tables under this schema.

To find out the owner for a table

db2 select tabname, tabschema, tabowner / owner from syscat.tables where tabname='<tabname>'

This will help to identify the owner

CHeerS
Racha
Reply With Quote
  #6 (permalink)  
Old 12-10-03, 10:05
miemcos miemcos is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks for all.
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