/DBRECOVERY command

Use the /DBRECOVERY command to prevent transactions or programs from accessing DL/I databases, DEDBs, or DEDB areas.

Subsections:

Environment

The following table lists the environments (DB/DC, DBCTL, and DCCTL) in which you can use the command and keywords.

Table 1. Valid environments for the /DBRECOVERY command and keywords
Command / Keywords DB/DC DBCTL DCCTL
/DBRECOVERY X X  
AREA X X  
DB X X  
DATAGRP X X  
GLOBAL X X  
LOCAL X X  
NOFEOV X X  
NOPFA X X  

Syntax

Read syntax diagramSkip visual syntax diagram/DBRECOVERY/DBRAREAareanameLOCALGLOBALNOPFAALLLOCALDBdbnameLOCALGLOBALNOPFAALLLOCALDATAGRPdatagroupnameLOCALNOFEOV

Keywords

The following keywords are valid for the /DBRECOVERY command:

AREA
Specifies the DEDB areas (but not DEDBs) to be processed by the /DBRECOVERY command. The /DBRECOVERY AREA command stops the accessing and updating of specified DEDB areas and closes them.

The /START AREA command can be used to reopen and reallocate the areas closed by /DBRECOVERY AREA command.

The /DBRECOVERY command for Fast Path Virtual Storage Option (VSO) areas in a z/OS® data space removes the areas from the data space and forces updates to be written back to DASD.

While the database is being quiesced, this command cannot be processed successfully.

DATAGRP
Specifies a group of DL/I databases and Fast Path DEDBs to be processed by the /DBRECOVERY command. Use the INIT.DBDSGRP command with the GRPNAME and DBGRP keywords to define the data group in the RECON data set.
Recommendation: Although you can use DBDS groups as well as database groups for this command, you should use database groups whenever possible to eliminate the overhead of converting the DBDS group to a database group.
DB
Specifies the DL/I databases and Fast Path DEDBs (and inclusive areas) to be processed by the /DBRECOVERY command. MSDBs cannot be specified with /DBRECOVERY. The /DBRECOVERY DB command allows scheduling of transactions or programs that use the database to continue after successful completion of the command. However, calls to DEDB databases will receive an FH status code. If the application program is prepared to accept status codes regarding data unavailability through the INIT STATUS GROUPA or GROUPB call, calls to DL/I databases will result in either a 3303 pseudoabend, a BA, or BB status code.

When the /DBRECOVERY DB command is entered, the data sets of the databases named in the command are closed. The /DBRECOVERY DB command dynamically deallocates the IMS databases. For DEDBs, the randomizer is unloaded and removed from storage. You can use the UPD DB STOP(ACCESS) OPTION(NORAND) command to prevent the randomizer from being unloaded.

If a DL/I database is in use by a batch message processing region when the /DBRECOVERY command is issued, a DFS0565I message is returned to the master terminal, the command is ignored for the database named in the message, and processing continues for any other databases specified in the command. The master terminal operator must wait until the BMP ends before reissuing the /DBRECOVERY command to close the databases named in any DFS0565I messages. DEDB databases will accept the /DBRECOVERY command while actively being used by a batch message processing region. However, all further calls to the database will receive an FH status code.

The region identified in the DFS0565I message can also be an MPP region. The error message can be issued in order to break a potential deadlock condition between Online Change, a /DBR, or /STA command against a database being used by the MPP, and an application running in the MPP issuing an ICMD or CMD call.

The /START DB command is used to reallocate the databases closed by the /DBRECOVERY DB command except for HALDB partitions. A HALDB partition can be reallocated if the partition has EEQEs, the partition was previously authorized but not allocated, or the OPEN keyword on the /START DB command was used. HALDB partitions are allocated at first reference. For DEDBs, a /START DB command also causes a reload of the randomizer.

For DBCTL, when CCTL schedules a PSB, the DBCTL thread SCHED request defines the thread as LONG or SHORT. If the database is currently scheduled to a LONG thread, the command is rejected; otherwise, the thread is allowed to complete its current commit cycle before the database is acted upon. This results in either a commit point or transaction termination.

While the database is being quiesced, this command cannot be processed successfully.

The /DBRECOVERY DB command is not allowed for a database that is marked bad with the NOTINIT-48-REPOCHGLIST reason code because the IMS change list processing is not complete for the database or the change list processing failed.

GLOBAL
Applies when the database is registered to DBRC and specifies that the command applies to all sharing online subsystems. You can use the /DBRECOVERY GLOBAL command to close the database so that it can be taken offline when this command successfully completes in all online subsystems. If the database is registered in the RECON data set, the prohibit authorization flag will be set (PROHIBIT AUTH = ON), and DBRC will prevent any further authorization of the database. This is equivalent to the CHANGE.DB DBD(xxx) NOAUTH DBRC command.

The /DBRECOVERY GLOBAL command is processed by the IMS system where the command was initiated. This system will process the command locally and then request IRLM NOTIFY to route and process the command on sharing IMS systems.

If global DB or AREA status is maintained, the global status maintained in RM is also updated. The global status is set to STOACC.

If the command is entered from OM API, the global status is updated by the command master IMS. If the command is not entered from OM API, the IMS that initiated the GLOBAL command updates the global status in RM.

If global status in RM is successfully updated, message DFS0988I for RSRCTYPE=DB is issued. If global status is not successfully updated, message DFS3308I is issued, indicating RM failure, and no command response lines are generated. Any RM error is traced to the OCMD trace table. Users can issue a QRY DB STATUS(GLOBAL) or QUERY AREA STATUS(GLOBAL) to obtain the global status of the resources in RM.

The X'4C' log record for databases is updated to include both global status and global command time stamp. A new log record for DEDB areas, X'594C', includes both global status and global command time stamp.

The GLOBAL keyword and the ALL parameter are mutually exclusive. The /DBRECOVERY command will be rejected if both GLOBAL and ALL are specified. The IRLM must be active when the GLOBAL keyword is used. If IRLM is not active, the command is rejected.

If the command with GLOBAL is entered from OM API, the command master IMS becomes the initiating system. The command IMS will process the command locally first and then make DBRC calls to update the RECON with GLOBAL status. It will also request IRLM NOTIFY to route and process the command on sharing IMS systems.

Messages produced on the NOTIFIED systems will appear only on the system console and will not be routed back to the OM API that originally entered the command.

If the command is routed to multiple IMS systems, the non-master IMS systems to which OM routes the command, will reject the command with the return and reason codes shown in the following table.

Table 2. Return and reason code for GLOBAL keyword issued from the OM API
Return code Reason code Meaning
X'00000004' X'00001000' The command contained the GLOBAL keyword and was routed to more than one IMS system in the IMSplex. The non-master IMS systems will reject this command when OM routes the command to them. The master IMS system will process this command and use IRLM NOTIFY to route and process the command on the non-master IMS systems. See the discussion under the GLOBAL keyword.
Restriction: When the GLOBAL keyword is specified, the command is performed for the named database only. If the command is to be performed for a HIDAM database and its index, both must be named.

The GLOBAL keyword cannot be combined with the DATAGRP keyword.

LOCAL
Specifies that the command applies only to the subsystem in which the command is entered. This command does not affect any other subsystem sharing the database or area. Use the LOCAL keyword to increase usability for the other system sharing the database or area. LOCAL is the default.
NOFEOV
Specifies that there is no forced end of volume, so that the log does not switch to the next OLDS and simple checkpoint is not taken.
NOPFA
Specifies to skip the call to DBRC that sets the Prohibit Authorization flag in the RECON data set for the database or area. You can use this keyword when you need to authorize the database for use after it is offline, for example, for offline utilities. By using this keyword, DBRC does not prevent further authorizations for the database or area.

NOPFA can be specified only with the GLOBAL keyword.

Usage notes

The /DBRECOVERY command can be used on HALDB databases.

Use of the ALL parameter indicates that the command applies to all databases, even those not opened.

The /DBRECOVERY command closes and deallocates the databases, and deauthorizes them with DBRC. Once the database or area referenced by /DBRECOVERY is closed, the IMS log switches to the next OLDS (unless you specify the NOFEOV keyword). This switch to the next OLDS is marked as a recovery point for log archiving purposes. IMS issues a simple checkpoint.

The /DBRECOVERY command deletes the randomizer routine from memory.

IMS databases, DEDBs, and DEDB areas closed by the master terminal operator with the /DBRECOVERY command can be used as input to the offline IMS Database Recovery utility. The Database Recovery utility runs in a batch region.

If the /DBRECOVERY command does not deallocate a data set because a VSAM data set hardware error occurred, use the VARY nnn,OFFLINE,FORCE command to deallocate the data set (where nnn is the number of the device).

In an IMSplex, the output of the /DBR command is different when the command is entered through the OM API. In this case, the DFS058I message is not returned to OM. The command response returned to OM contains one or more of the following messages as appropriate to the database type and the command completion.
  • For /DBR AREA commands that specify GLOBAL, only the command master returns the asynchronous messages to OM. When a command is processed with the LOCAL keyword, all IMS systems are able to return the asynchronous messages to OM.
  • Full-function database messages for /DBR DB: DFS132, DFS160, DFS216, DFS0488I, DFS0565I, DFS1407, DFS2026, DFS3318I, DFS3320I, DFS3321I, DFS3464I, DFS3466I.
  • Fast Path database messages for /DBR DB: DFS140I, DFS0666I, DFS3062I, DFS3320I.
  • Fast Path database messages for /DBR AREA: DFS140I, DFS0488I, DFS0666I, DFS1407I, DFS3060I, DFS3062I, DFS3320I, DFS3325I, DFS3342I, DFS3720I.

This command can be issued to an IMSplex using the Batch SPOC utility.

When you enter this command, the database name can be an existing non-HALDB, a HALDB master, or a HALDB partition. A command against a HALDB partition operates exactly like a command against a non-HALDB except for the /START DB and the UPDATE DB START(ACCESS) commands. A HALDB partition is not allocated during the command unless it was previously authorized but not allocated, the OPEN keyword was specified, or the partition has EEQEs. The partition is allocated at first reference.

For HALDB databases, IMS tracks partition statuses and master database statuses separately. For example, a partition can be stopped, but its master database can be started. Alternatively, the partition can be started, but its master database can be stopped. Before opening, authorizing, or scheduling a partition, IMS always examines the status of the partition and the master database. If either the partition or the master database has a status that prevents the action, IMS does not perform the action.

Each partition has the access limitations of both itself and its master database. For example, if the master database has an access intent of read (READ) and one of its partitions has an access intent of update (UPD), the partition cannot be updated. Alternatively, if the master database has an access intent of update (UPD) and one of its partitions has an access intent of read (READ), the partition cannot be updated. Similar considerations apply to other statuses that affect access limitations, such as being stopped or locked.
Exception: If the HALDB master database has update access (UPD), the partitions can have an access intent of exclusive (EXCL), exceeding the access of the master.

Commands that are issued with a partition name affect only the status of the partition. Commands that are issued against the master database affect only the status of the master database. Therefore, a start of a master database does not update the status of its partitions. If the partitions are stopped, they remain stopped. When a HALDB partition is explicitly stopped, it must be explicitly started again. The type-1 commands with the keyword ALL, type-2 commands with NAME(*), and commands against a HALDB master do not change the STOPPED (shown as STOACC, STOSCHD, or STOUPDS on QUERY DB) and LOCKED indicators in each HALDB partition.

When the command target is a HALDB master, processing acts on all HALDB partitions. For example, if the IMS command is UPDATE DB STOP(ACCESS) on the HALDB master, all of the HALDB partitions are closed, deallocated, and deauthorized. However, the stopped status is only set in the master database. If a QUERY DB command is issued, only the HALDB master displays a status of STOACC (each HALDB partition does not display STOACC unless it was itself stopped). If a UPDATE DB STOP(ACCESS) command was issued against a HALDB master, the display output of a /DISPLAY DB command shows the HALDB master (as STOPPED), but does not display the status of the partitions.

Restrictions:
  • The /DBRECOVERY DB command cannot be processed against a HALDB partition on an IMS system while HALDB Online Reorganization (OLR) is running against that partition on the same IMS system.
  • The /DBRECOVERY DB command cannot be issued against a HALDB master while OLR is reorganizing any of its partitions.
  • If the /DBRECOVERY DB or UPDATE DB STOP(ACCESS) commands are issued for a DEDB database that has newly added areas using the DEDB Alter utility, you might need to start the DEDB database using the ACCESS option if your PSB has a PCB that is not accessing the newly added areas by their DEDB name. In this situation, issue one of the following commands:
    • /STA DB ACCESS=UP
    • UPDATE DB START(ACCESS) SET(ACCTYPE(UPD))

The NODBR keyword can be specified in the DFSVSMxx member of the IMS PROCLIB data set to prevent a /DBRECOVERY command from processing against a database that has in-doubt EEQEs. NODBR does not apply to Fast Path databases.

Equivalent IMS type-2 commands

The following table shows variations of the /DBRECOVERY command and the IMS type-2 commands that perform similar functions.

Table 3. Type-2 equivalents for the /DBRECOVERY command
Task /DBRECOVERY command Similar IMS type-2 command
Stops the accessing and updating of an area. /DBRECOVERY AREA areaname UPDATE AREA NAME(areaname) STOP(ACCESS)
Stops the accessing and updating of all areas and databases of the data group. /DBRECOVERY DATAGRP datagrpname UPDATE DATAGRP NAME(datagrpname) STOP(ACCESS)
Stops access to the database and take it offline. /DBRECOVERY DB dbname UPDATE DB NAME(dbname) STOP(ACCESS) OPTION(FEOV)1
1 This command does not automatically issue checkpoints unless OPTION(FEOV) is specified.

Examples

The following are examples of the /DBRECOVERY command:

Example 1 for /DBRECOVERY command

Entry ET:
  /DBRECOVERY AREA ALL
Response ET:
  DFS058I   DBRECOVERY COMMAND IN PROGRESS
  DFS0488I  DBRECOVERY COMMAND COMPLETED. AREA=DBAREA0
  DFS0488I  DBRECOVERY COMMAND COMPLETED. AREA=DBAREA1

Explanation: DEDB areas are being stopped for inquiry and update, closed, and deallocated; the output log is switched to the next OLDS.

Example 2 for /DBRECOVERY command

Entry ET:
  /DBRECOVERY DATABASE SKILL
Response ET:
  DFS058I  DBRECOVERY COMMAND IN PROGRESS
  DFS2500I DATABASE SKILL SUCCESSFULLY DEALLOCATED
  DFS0488I DBRECOVERY COMMAND COMPLETED. DBN=SKILL RC=0
  DFS3257I ONLINE LOG NOW SWITCHED FROM DFSOLP( ) TO DFSOLP( )
  DFS944I *CHKPT 82123/121314**SIMPLE**

Explanation: The new OLDS is used to record a simple checkpoint at 121314 (time) on 82123 (Julian date). The checkpoint number is 82123/121314. All /DBRECOVERY command functions are complete. The Database Recovery utility can be executed after archiving. Currently executing application programs are being terminated. When the termination completes, the SKILL database is stopped for inquiry and update, closed, and deallocated; the output log is switched to the next OLDS. The /START DATABASE command must be used to start the database after the recovery job completes.

Example 3 for /DBRECOVERY command

This example shows how the /DBRECOVERY command might look when entered from the SPOC.

TSO SPOC input:
DBR DB BANKATMS BANKTERM BANKLDGR BE3ORDER
TSO SPOC output:
SYS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BANKATMS RC=04
SYS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BANKTERM RC=04
SYS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BANKLDGR RC=04
SYS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BE3ORDER RC= 0
IMS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BANKATMS RC=04
IMS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BANKTERM RC=04
IMS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BANKLDGR RC=04
IMS3     DFS0488I  DBR COMMAND COMPLETED. DBN= BE3ORDER RC= 0
OM API input:
CMD (DBR DB BANKATMS BANKTERM BANKLDGR BE3ORDER)
OM API output:
<?xml version="1.0"?> 
<!DOCTYPE imsout SYSTEM "imsout.dtd"> 
<imsout>
<ctl> 
<omname>OM1OM   </omname>
<omvsn>1.1.0</omvsn>
<xmlvsn>1   </xmlvsn>
<statime>2002.197 21:52:02.730359</statime>
<stotime>2002.197 21:52:03.383199</stotime>
<staseq>B7EFBE716A9770A4</staseq>
<stoseq>B7EFBE7209F9FD2F</stoseq>
<rqsttkn1>USRT005 10145202</rqsttkn1>
<rc>0200000C</rc>
<rsn>00003008</rsn>
</ctl>
<cmderr> 
<mbr name="SYS3    ">
<typ>IMS     </typ>
<styp>DBDC    </styp> 
<rc>00000014</rc>
<rsn>00005050</rsn>
<rsntext>Command processing error</rsntext>
</mbr>
<mbr name="IMS3    ">
<typ>IMS     </typ>
<styp>DBDC    </styp>
<rc>00000014</rc>
<rsn>00005050</rsn>
<rsntext>Command processing error</rsntext>
</mbr>
</cmderr> 
<cmd>
<master>SYS3    </master>
<userid>USRT005 </userid>
<verb>DBR </verb>  
<kwd>DB     </kwd>
<input>/DBR DB BANKATMS BANKTERM BANKLDGR BE3ORDER  </input>
</cmd>
<msgdata> 
<mbr name="SYS3    ">
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BANKATMS RC=04</msg>
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BANKTERM RC=04</msg>
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BANKLDGR RC=04</msg>
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BE3ORDER RC= 0</msg>
</mbr>
<mbr name="IMS3    ">
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BANKATMS RC=04</msg>
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BANKTERM RC=04</msg>
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BANKLDGR RC=04</msg>
<msg>DFS0488I  DBR COMMAND COMPLETED. DBN= BE3ORDER RC= 0</msg>
</mbr>
</msgdata>
</imsout>

Explanation: The DBR command is routed from OM to the two active IMS systems -- SYS3 and IMS3. The response from both IMS systems is returned to OM. The databases BANKATMS, BANKTERM, BANKLDGR, and BE3ORDER are taken offline at both IMS systems.