06.11.2014 Views

HP Archive Backup System for OpenVMS Guide to Operations

HP Archive Backup System for OpenVMS Guide to Operations

HP Archive Backup System for OpenVMS Guide to Operations

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.2 Prolog and Epilog Procedure<br />

Preparing For Disaster Recovery<br />

7.2 Prolog and Epilog Procedure<br />

To use ABS$SYSTEM:ABS$DISASTER_RECOVERY.TEMPLATE, you should rename it <strong>to</strong><br />

ABS$SYSTEM:ABS$DISASTER_RECOVERY.COM and use it as a prolog and epilogue <strong>for</strong><br />

the save(s).To au<strong>to</strong>matically prepare the system <strong>for</strong> a save operation you can use the prolog and<br />

epilog feature in the environment object being used. The following example shows you how <strong>to</strong><br />

use one procedure <strong>for</strong> both purposes.<br />

Example 7–4 ABS$SYSTEM:ABS$DISASTER_RECOVERY.TEMPLATE.<br />

$ !<br />

$ ! Abstract:<br />

$ ! This command file is used <strong>for</strong> saving ABS and MDMS in<strong>for</strong>mation<br />

$ ! <strong>for</strong> later disaster recovery. The procedure is used <strong>for</strong> prolog<br />

$ ! as well as epilog procedures in a SAVE operation.<br />

$ !<br />

$ !<br />

$ ! INPUT:<br />

$ !<br />

$ ! P1 = "" - no operation<br />

$ ! = "PROLOG" - prepares a disaster recovery save operation<br />

$ ! by making online copies of MDMS database files<br />

$ ! = "EPILOG" - does cleanup of save operation by deleting<br />

$ ! copies of files created during prolog<br />

$ ! - lists in<strong>for</strong>mation about res<strong>to</strong>ring the data<br />

$ !<br />

$ !----------------------------------------------------------------<br />

$ !<br />

$!<br />

$ Start:<br />

$!<br />

$ SET NOON<br />

$ IF P1.EQS."PROLOG" THEN GOTO Prolog<br />

$ IF P1.EQS."EPILOG" THEN GOTO Epilog<br />

$ EXIT<br />

$!<br />

$ Prolog:<br />

$!<br />

$ WRITE SYS$OUTPUT "Disaster Recovery Prolog"<br />

$ WRITE SYS$OUTPUT "."<br />

$ IF F$SEARCH("MDMS$DATABASE_LOCATION:MDMS$DOMAIN_DB.DAT").NES.""<br />

$ THEN<br />

$ WRITE SYS$OUTPUT "Creating online copies of MDMS database<br />

files..."<br />

$ WRITE SYS$OUTPUT "."<br />

$ @MDMS$SYSTEM:MDMS$COPY_DB_FILES<br />

$ ENDIF<br />

$ EXIT<br />

$!<br />

$ Epilog:<br />

$!<br />

$ WRITE SYS$OUTPUT "."<br />

$ IF<br />

F$SEARCH("MDMS$DATABASE_LOCATION:MDMS$DOMAIN_DB.DAT_COPY").NES.""<br />

$ THEN<br />

$ WRITE SYS$OUTPUT "Deleting copies of MDMS database files..."<br />

$ WRITE SYS$OUTPUT "."<br />

$ DELETE/NOLOG MDMS$DATABASE_LOCATION:MDMS$*_DB.DAT_COPY;*<br />

$ ENDIF<br />

$ WRITE SYS$OUTPUT "BACKUP res<strong>to</strong>re commands:<br />

$ WRITE SYS$OUTPUT "."<br />

$ nmax = 'F$TRNLNM("ABS_OS_OBJECT_NUMBER")'<br />

$ n = 1<br />

Preparing For Disaster Recovery 7–5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!