Previous Topic: MULTUSE= KeywordNext Topic: Area level ACCESS


Database ACCESS

Database ACCESS controls all access (User Requirements Table open) to a database in a Multi-User Facility, with the exception of the RESTART process done during the Multi-User Facility enable.

ACCESS STATUS=WRITE

Allows all types of access.

ACCESS STATUS=OFF

Denies all types of access.

ACCESS STATUS=READ

Allows User Requirements Table opens, with UPDATE=NO specified or defaulted.

ACCESS STATUS=UTLTY

Allows all DBUTLTY functions and denies all OPENS that are not DBUTLTY, except the DBUTLTY function DBTEST with PGM=DBTSTPR, as it executes as though it is not part of DBUTLTY.

Database ACCESS is set by 3 processes:

A temporary, internal, parallel form of ACCESS=OFF is done during a CATALOG from CA Datacom/DB.

The database level of ACCESS is usually done to stop, in an orderly fashion, access in a Multi-User Facility because:

Following is an example of database ACCESS used to reorganize an entire database. In the example, the DBUTLTY functions BACKUP, INIT, and LOAD each execute in Single User mode with no knowledge of any Multi-User Facility or its ACCESS status, and therefore do not require them. However, ACCESS ensures correct execution of the utility set because it ensures that no other job, which could either update data that would be lost or cause the INIT to fail with a return code 46, can open the base between the BACKUP and INIT.

  1. Use ACCESS to stop new jobs and wait on current jobs:
    ACCESS STATUS=OFF,DBID=1,USERS=WAIT
    
  2. Use COMM CLOSE to close the database:
    COMM OPTION=CLOSE,DBID=1
    
  3. Use BACKUP to back up the entire database:
    BACKUP DBID=1,...
    
  4. Use INIT to initialize the Index Area (IXX):
    INIT AREA=IXX,DBID=1
    
  5. Use LOAD to load the reorganized data:
    LOAD DBID=1,FORMAT=BACKUP,...
    
  6. Use ACCESS to allow new user jobs:
    ACCESS STATUS=WRITE,DBID=1