In a disaster recovery scenario or at a time when we need to reload the system from scratch, it's critical we have all the pieces of the system backed up.
We typically have a pretty good handle on when we last backed up our QSYS-based user libraries, our Document Library objects, and the root '/' file system. But what about the last save of our operating system? And what about our user profiles and security data and our system configuration objects? When was that data last backed up? And what tape or optical volume contains the last backup?
When we save a library using the SAVLIB command, objects are marked with the save date and save device information, as long as we specify UPDHST(*YES). But when we save the operating system, the objects that are saved are not marked with the save information. The same is true when we save user profiles and configuration data. The saved objects are not updated with the last save date.
IBM has supplied some special purpose data areas in the QSYS library that are updated with the save date and save device information when we perform certain save operations.
When we save our security data (including user profiles) using the command Save Security Data (SAVSECDTA), the special data area QSAVUSRPRF in QSYS is updated to reflect the save date and time and save device information.
Below is a list of various SAVE commands and the associated QSYS data area. Upon execution of the command, the data area is updated.
Save Command Data Area Used
SAVCFG QSAVCFG
SAVLIB *ALLUSR QSAVALLUSR
SAVLIB *IBM QSAVIBM
SAVLIB *NONSYS QSAVLIBALL
SAVSECDTA QSAVUSRPRF
SAVSTG QSAVSTG
SAVSYS QSAVSYS, QSAVUSRPRF, QSAVCFG
SAVSYSINF QSYSINF
Viewing the Last Save Date and Device
To view the last save information, you display the object description (DSPOBJD), you don't display the content of the data area. You can start with the command Work with Objects (WRKOBJ), as shown here:
WRKOBJ OBJ(QSYS/QSAV*) OBJTYPE(*DTAARA)
This command allows you to work with all the data areas in the QSYS library that start with the characters QSAV. This results in the following display:
Work with Objects
Type options, press Enter.
2=Edit authority 3=Copy 4=Delete 5=Display authority 7=Rename
8=Display description 13=Change description
Opt Object Type Library Attribute Text
QSAVALLUSR *DTAARA QSYS S/R DIRECTORY INFO FOR SAVE
QSAVCFG *DTAARA QSYS S/R DIRECTORY INFO FOR SAVE
QSAVIBM *DTAARA QSYS S/R DIRECTORY INFO FOR SAVE
QSAVLIBALL *DTAARA QSYS S/R DIRECTORY INFO FOR SAVE
QSAVSTG *DTAARA QSYS S/R DIRECTORY INFO FOR SAVE
QSAVSYS *DTAARA QSYS S/R DIRECTORY INFO FOR SAVE
8 QSAVUSRPRF *DTAARA QSYS S/R DIRECTORY INFO FOR REST
Place option 8 next to one of the data areas. In the example, we chose QSAVUSRPRF to see when we last saved our security data (including user profiles).
Page down to the final page of the display, where the last save information is shown. You can see I last did a SAVSECDTA command on 5/30/11 at 21:20:23. The data from the SAVE operation resides on tape volume W23BK.
Display Object Description - Full
Library 1 of 1
Object . . . . . . . : QSAVUSRPRF Attribute . . . . . :
Library . . . . . : QSYS Owner . . . . . . . : QSYS
Library ASP device . : *SYSBAS Library ASP group . : *SYSBAS
Type . . . . . . . . : *DTAARA Primary group . . . : *NONE
Journaling information:
Currently journaled . . . . . . . . : NO
Save/Restore information:
Save date/time . . . . . . . . . . . : 05/30/11 21:20:23
Restore date/time . . . . . . . . . :
Save command . . . . . . . . . . . . : SAVSECDTA
Device type . . . . . . . . . . . . : TAPE
Tape Volume . . . . . . . . . . . . : W23BK
Sequence Number . . . . . . . . . . : 13
If you simply want to examine one of the special SAVE data areas, you can use the command DSPOBJD. Here's an example that can be used to display the last time we did a SAVSECDTA:
DSPOBJD OBJ(QSAVUSRPRF) OBJTYPE(*DTAARA)
While We're Here: Where's Your SAVSYS?
While we're here discussing saving the system and its different pieces, check to make sure you're routinely saving your user profiles and system configuration data. Also check to make sure you have a good SAVSYS backup handy if needed. You probably did a SAVSYS operation the last time you made a major change to the operating system, like an OS upgrade, or after applying a cumulative PTF package.
If you don't have these backups (SAVSYS, SAVSECDTA, SAVCFG), plan to get them as soon as you can. You don't want to be stuck in a recovery scenario needing to go back to the original IBM distribution media. That would be a disaster on top of a disaster.