Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

schema

Status
Not open for further replies.

learningDBA

Programmer
May 9, 2002
6
IN
tablespace is a logical area where all the tables are stored.
What is schema?

I am getting confused between tablesspaces and schema?

can any one explain

Cheers
monzy
 
Hello Monzy,

In DB2 schema can be seen (more or less)as the 'owner' of a table. If you create a table in DB2 it is often handy to be able to give privileges to a group of tables instead of having to do that for each table individually. The default schemaname is copied from the user that connects to the database to create the table. You can however select a different schemaname for a table.
Schema have to be explicitly created as an object with the 'create schema' statement (or using control center GUI).
User-ID that holds SYSADM or DBADM authority can create any valid schemaname, other users can only create schema that is identical to their user ID.

This means that if you connect to a database using just your ID , a select statement on a table will run on that table using the matching schema.
You can change schema with:

set current schema = 'new_schema'

T. Blom
Information analist
Shimano Europe
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top