HPlogo ALLBASE/SQL Database Administration Guide: HP 9000 Computer Systems > Appendix F SQLUtil

SETUPRECOVERY

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Initiates a process of full rollforward recovery.

Scope

SQLUtil Only

SQLUtil Syntax

>> SETUPRECOVERY DBEnvironment Name: DBEnvironmentName Maintenance Word: MaintenanceWord Recover To (mm/dd/y/hh/mm/ss) (opt): RecoverTime New Log Mode (Single/Dual) (opt): NewLogMode Enter New Log File Name(s) Separated By A Blank: NewLogFile1 [NewLogFile2] New Log File Size (opt): NewLogSize Setup Recovery (y/n)? { Y[es] N[o] }

Parameters

DBEnvironmentName

is the name of the DBEnvironment you are recovering. The DBEnvironment name may be entered either as an absolute pathname or as a pathname relative to your current working directory.

MaintenanceWord

is the maintenance word.

RecoverTime

is the time up to which you want to recover the DBEnvironment.

NewLogMode

is either Single or Dual. This applies to the new log, not to the one from which recovery is carried out.

NewLogFile1 and NewLogFile2

are the names you are specifying for the new log. Use both names for dual logging. Files are created in the same directory as the DBECon file unless you specify a complete pathname.

NewLogSize

is the size of the new log in 512-byte pages.

Description

  • This command starts a DBEnvironment session and lets you begin the process of rollforward recovery after a DBEnvironment and its log files have been restored.

  • Rollforward recovery uses four commands:

    • SETUPRECOVERY or SETUPRECOVERY PARTIAL—initiates the process.

    • RESTORELOG—restores one or more log files from a backup.

    • RECOVERLOG—issued by you for each log file being applied to the DBEnvironment.

    • ENDRECOVERY—ends the rollforward recovery process.

  • SETUPRECOVERY should be done from the directory from which the DBEnvironment was originally stored (usually the directory containing the DBECon file and SYSTEM DBEFileSet).

  • You normally apply SETUPRECOVERY or SETUPRECOVERY PARTIAL once. For SETUPRECOVERY you can specify a RecoverTime as the end point for recovery. For SETUPRECOVERY PARTIAL you must recover all the way forward to the point of failure. You then use RESTORELOG to restore each backup log file to the system in sequence number order, and you use RECOVERLOG once for each log file that you have restored, to apply it to the DBEnvironment. ALLBASE/SQL will recover the transactions in the file up to the RecoverTime you specified or up to the end of the file.

  • You use ENDRECOVERY once after recovering all the log files you wish to apply to the DBEnvironment. Normally, you do not use ENDRECOVERY if you specified a RecoverTime in the SETUPRECOVERY command.

  • ENDRECOVERY will result in an error if you have not recovered enough files to make the DBEnvironment consistent. If you used STOREONLINE to do an online backup of the DBEnvironment, you must recover starting from the First Log Sequence Number Needed for Recovery up to and including the file that was active at the time the last STOREONLINE command completed. If you did a static backup of the DBEnvironment, you can recover as little or as much of the log as you desire once you have restored the most recent copy of the DBEnvironment.

Authorization

You must be the superuser, DBECreator or supply the correct maintenance word to use this command.

Example

   >> setuprecovery

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   Recover to: (mm/dd/yy/hh/mm/ss) (opt): Return

   New Log Mode (Single/Dual) (opt): single

   Enter New Log File Name(s) Separated by a Blank: newlg1

   New Log File Size: 250

   Setup Recovery (y/n)? y



   Recovery Has Been Set Up.

   Next Log Sequence Number is      1.





   >> restorelog

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   Input Device: /dev/tape

   Local (y/n) (opt): y

   Rename 'lgn1' Log File To: newlog

   Restore the Log File (y/n)? y

   Log File 'newlog' was Restored.





   >> recoverlog

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   Next Log File To Recover: newlog

   Recover Log File (y/n)? y



   Log File Recovered.

   Next Possible Log Sequence Number is      2.





   >> endrecovery

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   End Recovery (y/n)? y



   Recovery Has Terminated.
Feedback to webmaster