The Save Data Base Dependent LFs and Restore Data Base Dependent LFs
commands provide a solution for the case where a logical file is
built over a physical file in another library and a system restore is
needed. SAVDBDLF must be run prior to the save of the system.
RSTDBDLF is run after the restore of the system to restore the
logical files. Access paths may be rebuilt.
Only a user with *SAVSYS special authority can use SAV/RSTDBDLF.
Physical/Logical File structure with Save/Restore
-------------------------------------------------
A physical file contains actual data and may contain an access path.
A logical file is dependent on one or more physical files and may
contain the data for an access path.
A logical file may share an access path with a physical or logical
file. For example, assume a file specifies an access path using key
fields of FLDA, FLDB, and FLDC. If another logical file is built
over the same physical file and specifies the same key fields or just
FLDA, or FLDA and FLDB, the system will share the first access path.
The first file to define an access path becomes the owner of the
access path. The other files share the access path.
You can see whether an access path is shared by TAA command DSPLFMD
and the 'Access path shared' information. If it is *YES, the 'Access
path owner file/lib/mbr' information will describe the file that owns
the access path.
When a physical file is saved, any associated access paths are saved
with the physical file (assuming you request the save of the access
paths).
The best solution is to have any dependent logical files in the same
library as their physical file(s). If the library is saved and
restored, the system properly restores the objects and links them
together correctly. If access paths were saved, they would not have
to be rebuilt on a restore.
It is not an error to have a logical file dependent on a physical
file in a different library. However, when the entire system must be
restored (such as after a disaster or at a hot site), only one
library can be restored at a time. If the library containing the
logical file is restored first, the system does not know about the
based-on physical file and prevents the logical from being restored.
A recovery solution is to restore the entire system again specifying
OPTION(*NEW). Since the physical file would be on the system, the
logical file would be restored properly. Rebuilding of the access
path would occur if the logical file was the owner of an access path.
Some users cannot afford to mount all the media required and attempt
to manually handle the situation.
If the physical file is in LIBA and the dependent logical file is in
LIBB, the system would ignore the access path for the logical file
when LIBA is restored, because the logical file is not on the system.
When LIBB is restored, the system may rebuild the access path.
The CHKALLDBD command will describe the situations where a logical is
dependent on a physical in a different library. You should try to
avoid this situation as it increases the complexity of a full restore
and will lengthen the restore time by rebuilding access paths when
time is critical.
If you cannot or do not want everything in the same library, the
SAVDBDLF command can help.
SAVDBDLF concept
----------------
The concept of SAVDBDLF is to avoid the manual recovery or a second
massive restore when logical files exist in a different library than
the based-on physical.
SAVDBDLF determines all of these conditions and saves the logical
files to save files in a unique library devoted to SAVDBDLF (no other
objects should exist in the library). SAVDBDLF begins by clearing
the library if only save files exist that were created by a previous
use of SAVDBDLF. There would be a unique save file for each library
that contained a logical that was dependent on a physical in a
different library.
When you backup the entire system, the unique SAVDBDLF library would
also be saved. When you restore the entire system (such as after a
disaster or at a hot site), all libraries should be restored
including the unique SAVDBDLF library.
The RSTDBDLF command may then be used. It finds the save files and
determines if the saved LF is already on the system. If so it
bypasses the logical file.
If the logical file is not on the system, RSTOBJ is used to restore
the logical file. If the logical file owns an access path, the
access path will be rebuilt.
If no logical files exist that are dependent on physical files in
different libraries, the library used by SAVDBDLF will be empty and
the command will complete normally with an appropriate message.
If RSTDBDLF is used on an empty library, the command will complete
normally with an appropriate message.
Thus there is no harm in using SAVDBDLF/RSTDBDLF on a regular basis
even if they find no actions to be performed.
Getting started
---------------
** To use SAVDBDLF, an *ALLOBJ user must prompt for:
CRTDBDLF
Assuming the default library name and text are acceptable,
pressing Enter will:
-- Create the SAVDBDLF library with *PUBLIC AUT(*EXCLUDE).
This prevents unauthorized users from adding objects to
the library. Only the TAA objects created by SAVDBDLF
should exist in the library. SAVDBDLF adopts authority
when it runs so that objects can be deleted and created
in the library.
-- The Application Value SAVDBDLF in TAASECURE is updated
with the library name. This allows the use of SAVDBDLF
and RSTDBDLF to operate without any parameters as they
extract the library name from the Application Value.
** You may now enter the SAVDBDLF command, but before you do, you
may want to test the concept.
** To test the concept, create one or more logical files in a
separate library than the based-on physical. A better test
would be to have several logicals in different libraries.
Then run SAVDBDLF (any user with *SAVSYS authority can run
SAVDBDLF). The command has no parameters and adopts the
QSECOFR user profile during execution.
SAVDBDLF finds the library name by extracting it from the
TAASECURE/SAVDBDLF Application Value. Save files are created
for each library that contains a logical file based-on a
physical in a different library. IBM libraries including
QSYS, QSYS2, and SYSIBM are bypassed. The name of the save
file will be the name of the library containing the logical
files. All logical files in the same library where the
based-on physical is in a different library are saved to the
same save file. You can have a maximum of 1009 logical files
in this condition for each library.
After SAVDBDLF completes, you could use DSPLIB to display the
contents of the library.
Delete one or more of the logicals that you created.
Then run RSTDBDLF (any user with *SAVSYS authority may use the
command). The command has no parameters and adopts the
QSECOFR user profile during execution.
RSTDBDLF determines the library name where the save files
exist. It converts the save file information to an outfile in
QTEMP with one record for each logical file that was saved.
If the logical file is already on the system, it is bypassed.
If the logical does not exist, it is restored. A spooled file
is created.
Review the spooled file to see if you are satisfied with the
test.
** A DLTDBDLF command exists to allow you to delete the library
and reset the Application Value to *NONE.
SAVDBDLF Library
----------------
Any name may be used, but no other objects should exist in the
library other than the save files created by SAVDBDLF. If other
objects exist, SAVDBDLF fails with an escape message. For this
reason you should create the library with AUT(*EXCLUDE) to prevent
the *PUBLIC user from placing objects in the library.
Since the SAVDBDLF command runs under QSECOFR adopted authority, no
authorization exceptions will exist.
When to run SAVDBDLF
--------------------
The ideal solution for SAVDBDLF would be to enter the command prior
to backing up your entire system when the system is in the restricted
state. For example, it could be part of your exit program for GO
SAVE2 (see option 80). If you are using this approach, you should
monitor for error conditions, inform someone of the failure, and end
the exit program normally.
While running in the restricted state is ideal, SAVDBDLF can be run
at any time. In many cases, a save can still occur if a logical file
is open. If a logical file cannot be saved, SAVDBDLF will send an
escape message after all files have been processed. The CHKSAVRST
command is run if errors exist to help you identify the problem.
SAVDBDLF escape messages you can monitor for
--------------------------------------------
TAA9891 Other objects exist in the SAVxxx library.
TAA9892 Not all logical files saved.
Escape messages from based on functions will be re-sent.
RSTDBDLF escape messages you can monitor for
--------------------------------------------
TAA9891 Not all LFs could be restored
Escape messages from based on functions will be re-sent.
SAVDBDLF Command parameters *CMD
---------------------------
None.
RSTDBDLF Command parameters *CMD
---------------------------
None.
CRTDBDLF Command parameters *CMD
---------------------------
LIB The library name to be used. SAVDBDLF is the
default. The library must not exist and will be
created with *PUBLIC AUT(*EXCLUDE) to help prevent
non-TAA objects from existing in the library.
TEXT The text description for the library. The default
identifies the library as used by the TAA SAVDBDLF
tool.
DLTDBDLF Command parameters *CMD
---------------------------
None.
Restrictions
------------
Up to 300 files in any one library may exist that are dependent on
physical files in different libraries.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHGAPPVAL Change application value
CHGOBJD2 Change object description 2
CHKALLOBJ Check *ALLOBJ special authority
CHKSAVRST Check save/restore
CVTALLDBD Convert all data base dependencies
CVTSAVFD Convert save file description
EDTVAR Edit variable
RTVAPPVAL Retrieve application value
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDDIAGMSG Send diagnostic message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDJLGMSG Send job log message
SNDSTSMSG Send status message
SORTDBF Sort data base file
Implementation
--------------
A library name must be entered into the Application Value SAVDBDLF in
TAASECURE using EDTAPPVAL.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SAVDBDLF *CMD TAASAWC QATTCMD
RSTDBDLF *CMD TAASAWC2 QATTCMD
CRTDBDLF *CMD TAASAWC3 QATTCMD
DLTDBDLF *CMD TAASAWC4 QATTCMD
TAASAWCC *PGM CLP TAASAWCC QATTCL
TAASAWCC2 *PGM CLP TAASAWCC2 QATTCL
TAASAWCC3 *PGM CLP TAASAWCC3 QATTCL
TAASAWCC4 *PGM CLP TAASAWCC4 QATTCL
TAASAWCC11 *PGM CLP TAASAWCC11 QATTCL
TAASAWCC12 *PGM CLP TAASAWCC12 QATTCL
TAASAWCR2 *PGM RPG TAASAWCR2 QATTRPG
TAASAWCP *FILE PF
The Application Value SAVDBDLF (*USRSPC) exists in TAASECURE.
The TAASAWCP file is created with RCDLEN(80) and holds the TAADBHUL
source for CVTALLDBD. The file is not created by CRTTAATOOL.
Structure
---------
SAVDBDLF Cmd
TAASAWCC CL pgm
TAASAWCC11 CL pgm
RSTDBDLF Cmd
TAASAWCC2 CL pgm
TAASAWCC12 CL pgm
TAASAWCR2 RPG pgm
CRTDBDLF Cmd
TAASAWCC3 CL pgm
DLTDBDLF Cmd
TAASAWCC4 CL pgm
|