H3–Database Access Problems

Use the following diagnostic steps and references to determine an appropriate course of action for database access problems.

IF THE DATA CAN BE BOTH READ AND WRITTEN, the problem is not a database problem. Refer to section H8.

IF DATA CANNOT BE READ OR WRITTEN, some process is unable to release full ownership of the database critical section. Determine the process identification number (PID) of the process using the DSE command CRITICAL. If the process exists, refer to section H4. If the process is non-existent, use DSE CRITICAL -REMOVE to emulate a release and re-examine the entire situation.

Example:

  S reg=$V("GVNEXT",""),com="dbcheck.com" o     m-*  com:newv u com
  W "$ DEFINE/USER SYS$OUTPUT dbcheck.lis",!,"$ DSE",!
  F  Q:reg=""  D
  . W "FIND /REGION=",reg,!,"DUMP /FILEHEADER",! 
  . S reg(reg)="",reg=$V("GVNEXT",reg)
  W "$ SEARCH dbcheck.lis ""Cache freeze""",!
  ; CAUTION: in the above line, "Cache freeze" 
  ; MUST be mixed-case as shown
  W "$ DELETE dbcheck.lis.",!,"$ EXIT",!
  C com ZSY "@dbcheck" 
  O com C com:delete
  W !,"Attempting first access"
  S g="^%" D:$D(^%)  F  S g=$O(@g) Q:g=""  D
  . S reg=$V("REGION",g) Q:$l(reg(reg))
  . I $D(@g)'[0 S reg(reg)=g
  . E  S reg(reg)=$Q(@g) 
  . W !,"Successful Read in region: ",reg," of ",g
  S reg="" F  S reg=$O(reg(reg)) Q:reg=""  D
  W !,"Write to region: ",reg 
  S @(reg(reg)_"="_reg(reg)) W "–OK"
  Q
   S reg=$V("GVFIRST"),com="dbcheck" o com:newv u com
   W "dse <<yz > dbcheck.lis",!
   F  Q:reg=""  D
   . W "find -region=",reg,!,"dump -fileheader",! 
   . S reg(reg)="",reg=$V("GVNEXT",reg)
   W "yz",!,"cat dbcheck.lis | grep 'Cache freeze'"
   ; CAUTION: in the above line, "Cache freeze" 
   ; MUST be mixed-case as shown
   W "|awk '{print $1, $2, $3}'"
   C com ZSY "/bin/csh -c ""source dbcheck""" 
   O com,dbcheck.lis C com:delete,dbcheck.lis:delete
   W !,"Attempting first access"
   S g="^%" D:$D(^%)  F  S g=$O(@g) Q:g=""  D
   . S reg=$V("REGION",g) Q:$l(reg(reg))
   . I $D(@g)'[0 S reg(reg)=g
   . E  S reg(reg)=$Q(@g) 
   . W !,"Successful Read in region: ",reg," of ",g
   S reg="" F  S reg=$O(reg(reg)) Q:reg=""  D
   . W !,"Write to region: ",reg 
   . S @(reg(reg)_"="_reg(reg)) W "–OK"
   Q

        

This routine provides a generalized approach to automating some of the tasks described in this section. It contains argumentless DO commands primarily for typesetting reasons. The routine issues a report if any region is frozen, but does not report which regions are in that state. It may hang reading or writing a database. However, unless the region(s) holding ^% and the next global after ^% has a problem, it displays the name of the region that it is about to try. If this routine runs to completion, the databases in the current Global Directory are completely accessible. The limitations of this routine can be overcome by writing custom shell scripts and/or M programs that include embedded information about one or more Global Directories.

[Note]

If you have a Global Directory mapping globals to multiple files, you may create an alternative Global Directory using different mappings to those same files. Such mapping prevents the test program(s) from touching the "real" data.

Example:

Mapping      Production region   Test region
-----------------------------------------------
A   to   M   
$DEFAULT            SCRATCH
N   to   Z   SCRATCH            
$DEFAULT