DB2 or Database 2 is a Relational Database Management System offered by IBM that runs on IBM Mainframe, AS/400 and on PC. A DB2 database can grow from a small single-user application to a large multi-user system.
DB2 is designed to store, analyze and retrieve the data efficiently. DB2 product is extended with the support of Object-Oriented features and non-relational structures with XML.
Is easy to understand. Data from Db2 databases is presented to users in table-like format. This is one of the more familiar ways of displaying data, such as telephone books, and public transport timetables.
Allows design flexibility. As you can imagine, a table of data is relatively easy to design. All you need to know are the key components of your database, such as Name, Address and Telephone number.
Provides ease of access. The user is shielded from the internal workings of Db2. Therefore, the user does not need to know the physical relationships of the database they are accessing.
A database is a collection of data stored in some organized fashion. The simplest way to think of it is to imagine a database as a filing cabinet. The filing cabinet is simply a physical location to store data, regardless of what that data is or how it is organized.
DATBASE- A container (usually a file or set of files) to store organized data.
Any database for which the logical organization is based on relational data model (Relation - Mathematical term for Table).
Db2 itself is a relational database, which is basically a collection of related data that is stored in multiple tables that can be reassembled to form meaningful user data.
Every table is broken up into smaller entities called fields. A field is a column in a table that is designed to maintain specific information about every record in the table.
A record, also called a row, is each individual entry that exists in a table. A column is a vertical entity in a table that contains all information associated with a specific field in a table.
A DB2 storage group (STOGROUP) is a set of volumes on direct access storage devices (DASD). The volumes hold the VSAM data sets in which tables and indexes are actually stored.
Max no of volumes per Storage group is 133 (Ideally 3 or 4). All volumes of a given storage group must have the same device type (3380, 3390, and so no.). But, parts of a single database can be stored in different storage groups. If the volumes in a storage group are different types or if any volume is not mounted or is otherwise invalid, then an error will occur when you try to create a table space or index. Try to assign frequently accessed objects (indexes, for instance) to fast devices and seldom-used tables to slower devices; that choice of storage groups improves performance.
After you define a storage group, DB2 stores information about it in the DB2 catalog. (This catalog is not the same as the integrated catalog facility catalog that describes DB2 VSAM data sets). The catalog table SYSIBM.SYSSTOGROUP has a row for each storage group and SYSIBM.SYSVOLUMES has a row for each volume.
At installation, the system default storage group is defined. This storage group is named SYSDEFLT. If you do not explicitly manage your storage, then DB2 uses the default storage group to allocate space.
Following figure represents the hierarchy of DB2 objects:
We will see each DB2 object in next chapter...
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!