Relational database

A relational database is a database that can be perceived as a set of tables and can be manipulated in accordance with the relational model of data. The relational database contains a set of objects used to store, access, and manage data. The set of objects includes tables, views, indexes, aliases, user defined types, functions, procedures, sequences, variables, and packages.

There are three types of relational databases a user can access from an IBM® i.

system relational database
There is one default relational database on an IBM i. The system relational database is always local to that IBM i. It consists of all the database objects that exist on disk attached to the IBM i that are not stored on independent auxiliary storage pools. For more information on independent auxiliary storage pools, see the System Management category of the IBM i Information Center.

The name of the system relational database is, by default, the same as the IBM i system name. However, a different name can be assigned through the use of the ADDRDBDIRE (Add RDB Directory Entry) command or System i® Navigator.

user relational database
The user may create additional relational databases on an IBM i by configuring independent auxiliary storage pools on the system. Each primary independent auxiliary storage pool is a relational database. It consists of all the database objects that exist on the independent auxiliary storage pool disks. Additionally, all database objects in the system relational database of the IBM i product to which the independent auxiliary storage pool is connected are logically included in a user relational database. Thus, the name of any schema created in a user relational database must not already exist in that user relational database or in the associated system relational database.

Although the objects in the system relational database are logically included in a user relational database, certain dependencies between the objects in the system relational database and the user relational database are not allowed:

  • A view must be created into a schema that exists in the same relational database as its referenced tables and views, except that a view created into QTEMP can reference tables and views in the user relational database.
  • An index must be created into a schema that exists in the same relational database as its referenced table.
  • A trigger or constraint must be created into a schema that exists in the same relational database as its base table.
  • The parent table and dependent table in a referential constraint must both exist in the same relational database.
  • Any object in the system relational database can only reference functions, procedures, and types in the same system relational database. However, objects in the user relational database may reference functions, procedures, and types in the system relational database or the same user relational database. However, operations on such an object may fail if the other relational database is not available. For example, if a user relational database is varied off and then varied on to another system.

A user relational database is local to an IBM i while the independent auxiliary storage pool is varied on. Independent auxiliary storage pools can be varied off on one IBM i and then varied on to another IBM i. Hence, a user relational databases may be local to a given IBM i at one point in time and remote at a different point in time. For more information on independent auxiliary storage pools, see the System Management category of the IBM i Information Center.

The name of the user relational database is, by default, the same as the independent auxiliary storage pool name. However, a different name can be assigned through the use of the ADDRDBDIRE (Add RDB Directory Entry) command or System i Navigator.

remote relational database
Relational databases on other IBM i and non-IBM i products can be accessed remotely. These relational databases must be registered through the use of the ADDRDBDIRE (Add RDB Directory Entry) command or System i Navigator.

The database manager is the name used generically to identify the IBM iLicensed Internal Code and the Db2® for i portion of the code that manages the relational database.