An Overview of DB2 Database Objects

 <  Day Day Up  >  

A DB2 database consists of multiple types of database objects. Each database object is designed for a specific purpose. The first database object is the database itself. A database is basically a collection of DB2 database objects. No disk storage is required to create a DB2 database.

DB2 data resides in a table space . The table space defines the storage and other physical characteristics for the data. Each table space can contain one or more tables . The table defines the actual data elements and constraints for the data. Each table will contain one or more columns .

You can also create virtual tables known as views. A view is basically a SELECT statement that acts as a table. No data is stored when a view is created; instead, when the view is accessed DB2 uses the SELECT statement that defines the view to materialize the virtual table. So a view is a way to turn a SELECT statement into a "table."

graphics/v8_icon.gif

Materialized query tables can be created, too. These are essentially views where the data has been physically stored instead of virtually accessed.


A storage group is a series of disk volumes that can be used by table spaces and indexes for allocating data sets on DASD devices.

A table can have indexes defined on it. A DB2 index is defined on one or more columns to enable more efficient access to DB2 tables.

Finally, DB2 allows users to create aliases and synonyms as alternative names for DB2 tables. An alias is defined to a local DB2 subsystem for either a local or remote table. A synonym is defined as a private name for a table or view; a synonym can be used only by its creator.

 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net