DBRC authorization request (AUTH)

You can use the DBRC authorization request to ensure that an invalid data sharing environment is not created. Database authorization is the process of requesting permission to access and use a database. In this context, the database is either a DL/I database or a Fast Path DEDB area.

The type of access requested can be:

  • Exclusive (EX) control of the resource. Exclusive access is granted if the database is not currently authorized. After access is granted, any and all other authorization requests are not allowed. This type of authorization is used typically by a recovery utility.
  • Read (RD) access to the database (also called read with integrity). Read access is granted if the database is not currently authorized as exclusive or update. After this access is granted, other authorization request for exclusive or update fails. This type of authorization is typically used by utilities that take non-concurrent (clean) image copies.
  • Read-only (RO) access to the database (also called dirty read). Read-only access is granted unless the database is currently authorized as exclusive. Once granted, other authorization request for exclusive fail. Read-only access does not prevent the database from being updated while the application is reading it. This type of access is typically used by utilities that take concurrent image copies.

An application must register with DBRC when it initializes in order to use this function. The requested database must be registered with DBRC.

The database is unauthorized explicitly by the DSPAPI FUNC=UNAUTH macro, or implicitly by the DSPAPI FUNC=STOPDBRC macro.

You can specify one or more database names for the authorization and unauthorization functions. Databases do not have to be unauthorized in the same order that they are authorized. For instance, if multiple databases in a list are authorized, they can be unauthorized one at a time in any order. To change the type of access, unauthorize the database and then authorize the database again.

There are some situations in which standard database authorization is denied, such as when the "Prohibit Authorization" flag is on for a database, or if one or more of its DBDSs require an image copy. If the intent of the application is database image copy, recovery or reorganization, you can grant the authorization by using the UTILITY keyword on the FUNC=AUTH request.