SQL/MP Installation and Management Guide
Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide—523353-004
10-43
Using BACKUP and RESTORE
RESTORE Program and the SQLCOMPILE Option 
If you restore a program using the SQLCOMPILE option, the RESTORE program 
invokes the recompilation of the program using the SQLCOMP CHECK option 
specified during the last explicit SQL compilation. 
The SQLCOMPILE ON option of RESTORE can restore a program and automatically 
recompile the program. The program is explicitly recompiled with the DEFINEs stored 
in the program description, the same effect as specifying STOREDDEFINES in the 
SQLCOMP command. You would use the SQLCOMPILE ON option in recovery 
operations but not for moving programs from one database to another.
This example uses RESTORE to restore a single SQL program stored in a Guardian 
file. The example then uses the SQLCOMPILE ON option to request automatic 
recompilation of the program:
RESTORE $TAPE, $VOL1.PERSNL.EMPPROG,
 MAP NAMES ($VOL1.PERSNL.EMPPROG to $VOL1.ADMIN.*),
 SQLCOMPILE ON, LISTALL
RESTORE Program and the REGISTERONLY ON Option 
The REGISTERONLY ON option adds a few considerations to the use of RESTORE to 
restore programs. Consider an SQL program explicitly compiled with the 
REGISTERONLY ON option (the initial compilation) and then backed up by using the 
BACKUP program. If you restore this program by using the SQLCOMPILE ON option, 
the RESTORE program invokes the SQL recompilation of the program using the 
SQLCOMP options specified during the explicit SQL compilation (that is, the explicit 
SQL compilation immediately before the compilation using the REGISTERONLY ON 
option).
When using the REGISTERONLY option with the RESTORE program, the SQL 
program is not recompiled, but is restored and registered in the catalog.
RESTORE Program and the NOREGISTER ON Option 
The NOREGISTER ON option causes an SQL program file to appear as an Enscribe 
file to the RESTORE program. Therefore, if you restore a program file using the 
SQLCOMPILE option, the RESTORE program does not invoke the SQL compiler for 
an SQL program file compiled with the NOREGISTER ON option. 










