We help IT Professionals succeed at work.

db2

n_vishwanatha
n_vishwanatha used Ask the Experts™
on
Hi ,

How to see the syscatalog(SYSCAT) information stored by my database ?
For example if I create a schema by name Test , how to get the information about Test ?


Thanks and regards
Vishwanath
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you just query the tables, for example, to get a list of tables in your schema:

select *
from syscat.tables
where tabschema='TEST'
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
If you are using any tools like Aqua Data Studio(http://www.aquafold.com/) or any other tools like WinSQL, then you can directly view all objects in SYSCAT schema directly..

Else you can view the list of objects here:

http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0001063.htm

Left side menu lists all objects.
You can also use freeware tools ExecuteQuery & DBVisualizer to schema details. Schema is a object by itself in database which is used to group objects of various types under it.

At command line:

db2 list tables for schema <schema_name>
db2 list tables for schema SYSCAT

In command line processor you can drop the first word db2 in above commands.

SYSCAT also has tables called views, indexes etc.

we need to connect to database and then give

"db2 select schemaname from syscat.schemata ".....

this will list all the schema's available corresponding to the database. You can include more columns in SELECT list as well introduce other clauses like WHERE, GROUP By, ORDER BY etc. to this query.

Author

Commented:
Thanks sir