HPlogo ALLBASE/SQL Database Administration Guide: HP 3000 MPE/iX Computer Systems > Appendix F SQLUtil

RESTORELOG

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Restores a log file that had been previously backed up with the STORELOG command.

Scope

SQLUtil Only

SQLUtil Syntax

>> RESTORELOG DBEnvironment Name: DBEnvironmentName Maintenance Word: MaintenanceWord Input Device: DeviceName Local (y/n) (opt): { Y [es] N [o]} Restore the Log File (y/n)? { Y [es] N [o]} Rename LogFileName Log File To: [ NewName [ .NewGroup [ .NewAccount ] ] ]

Parameters

DBEnvironmentName

is the name of the DBEnvironment to which the log files are being restored.

MaintenanceWord

is the Maintenance Word.

DeviceName

is the name of the tape or other backup device from which you are restoring the log file.

Local

specifies whether the log is to be restored to the local group and account or to the group and account from which it was originally stored. Reply Y for the local group and account.

NewName [.NewGroup.[NewAccount]

is a new name you are specifying for a log file after you restore it. The default is the same as the file name specified. If you include the optional NewAccount, it must be the same as the account name of the DBECon file.

It is easier to restore log files in proper order if you specify a new name which contains the log sequence number of the log file as part of the new file name.

Description

  • This command lets you restore one or more previously stored archive log files. If only one log file was stored with a given invocation of STORELOG, one log file will be restored. If multiple log files were stored with a single invocation of STORELOG, all log files stored with that invocation will be restored.

  • ALLBASE/SQL prompts for a new file name for each file before restoring the file. To avoid name conflicts, rename using distinct file names that reflect the log sequence numbers.

  • 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.

  • You normally apply SETUPRECOVERY or SETUPRECOVERY PARTIAL once. When using SETUPRECOVERY you can specify a RecoverTime as the end point for recovery. For SETUPRECOVERY PARTIAL you must recover all the way up to the time of the 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.

  • 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.

  • Normally, this command is used when recovering a DBEnvironment, in which case the DBEnvironment is not in use while the command is executed.

Authorization

Any user may execute this command.

Examples

Recovery of singly stored log file

   >> 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: TAPE

   Local (y/n) (opt): y

   Restore the Log File (y/n)?y

   Log File 'lgn1' was Restored.

   Rename 'lgn1' Log File To: lsn001

   Log File 'lgn1' was Renamed to 'lsn001'.





   >> recoverlog

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   Next Log File To Recover: lsn001

   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.


Recovery of multiple log files stored with single invocation of STORELOG

   >> 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: TAPE

   Local (y/n) (opt): y

   Rename 'lgn1' Log File To: lsn001

   Rename 'lgn2' Log File To: lsn002

   Restore the Log File (y/n)?y

   Log File 'lsn001' was Restored.

   Log File 'lsn002' was Restored.





   >> recoverlog

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   Next Log File To Recover: lsn001

   Recover Log File (y/n)? y



   Log File Recovered.

   Next Possible Log Sequence Number is       2.





   >> recoverlog

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   Next Log File To Recover: lsn002

   Recover Log File (y/n)? y



   Log File Recovered.

   Next Possible Log Sequence Number is       3.



   >> endrecovery

   DBEnvironment Name:  PartsDBE

   Maintenance Word:   Return 

   End Recovery (y/n)? y



   Recovery Has Terminated.


Feedback to webmaster