If you are looking for a way to speed up your nightly backup chores, try using the save file solution. Backing up your system to a save file can be a real time-saver and, best of all, it's simple.
Why save files reduce save times
A save file is a special type of file that can store the results of a save operation. A save file works just like a tape device, but it's a file stored on you system's DASD. And that is precisely why it is faster.
Since you are saving the objects to a file, the save operation is much faster. Writing data to DASD is thousands of times faster than writing data to tape. This translates into less downtime while you save your system.
And, of course, you can also restore the objects that are saved in a save file.
Use the SAVSAVFDTA command to save the contents of a save file
After you have finished saving your system, you can bring it back online. Then later -- perhaps during the next day -- you can save the contents of the save file to a tape for off-system storage. That can be done while the system is up and while users are working.
You use the Save Save File Data (SAVSAVFDTA) command to save the contents of a save file to tape in a format that allows you to do a direct restore from tape. That is, after using the SAVSAVFDTA command, the contents of the tape will be as if you had saved the library/objects directly to the tape. So, you can do a RSTLIB of RSTOBJ command, for example, directly from the tape instead of having to go back through a save file (which you can also do if you want/can).
Restriction: Only one library can be saved at a time
The only real restriction when using save files is that you can save only one library to a save file. That isn't too bad if you need to save only a few production libraries. But for installations that have many libraries to save or want to save all libraries, it can be a hassle. In those instances, you will definitely want to automate the process.
I have put together a utility you can use to save all your user libraries to save files. (You can easily modify the utility to save other libraries or objects). Then the utility spawns off another program to save the save files to tape. (You can use the SCDDATE and SCDTIME parameters on the SBMJOB command to schedule the job for some other time. Remember, it will be saving the save files so it can be done at anytime.)
The two programs I've written are SAVELIBS1 and SAVELIBS2. SAVELIBS1 saves each user library to its own save file in library SAVLIB, which it creates if needed. The only parameter to this program is the name of the tape device to which the save files will ultimately be saved. SAVELIBS2 saves the contents of all the save files in library SAVLIB to the device name you passed to the first program.
How the utility works
The utility starts off by creating a library called SAVLIB. This is its work library and where the save files will be stored. Then it lists the names of all the libraries on your system to an outfile. After putting the system in a restricted state, the program loops through the list of libraries, and for each of the user libraries (except SAVLIB and QTEMP) it does the following:
- Creates a save file with the same name as the library (if necessary)
- Saves the library to the save file.
The program wraps up by restarting the system and then it submits the other program, which will save the save files (or, more precisely, will save the data in the save files) to tape.
Make sure you have enough DASD
Remember, you are saving the libraries to DASD, so you will need -- at least temporarily -- enough DASD to store the saved data. To help alleviate the DASD requirements, the utility described above takes advantage of the data compression option on the SAVLIB command. The compression algorithm used is a repeating character algorithm where repeating characters -- such as a bunch of blanks at the end of a name field in a file -- are replaced by the number of times the character repeats.
This compression algorithm is not the best by a long shot, but it is very fast. Plus, for a typical iSeries, where the database is a large part of the system, this compression algorithm is fairly effective. Look for compressed sizes in the range of 50% to 65% of the original size.
Remember your occasional total system save
The Save System (SAVSYS) command is the only way to save the Licensed Internal Code (LIC) and the QSYS library in a format compatible with the installation of the AS/400-iSeries system. However, the SAVSYS command does not support save files. So, remember to run it every week or so to ensure you have the proper backup.
The SAVSYS command also saves configuration objects (e.g., device descriptions) and security data (e.g., user profiles), which can also be done independently using the Save Configuration (SAVCFG) command and the Save Security Data (SAVSECDTA) command, respectively. Note, the SAVCFG and SAVSECDTA commands both support save files.
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.
- I just read the Administrator tip "Want to speed up your nightly backups? Use save files" by Ron Turull and thought that it might have been written five years ago. Current tape drive and I/O speeds are much faster than they used to be. It is my understanding that after disk arm contention is taken into consideration that a save to SAVF can now actually be slower than a save to tape in many cases. If you really want to cut your backup window, Save-While-Active has got to be the best trick out there.
-- Scott Ingvaldson AS/400 system administrator, GuideOne Insurance Group
The author responds:
I agree with the reader that tape drive speeds have increased and the save-while-active option is a very good option; however, it doesn't work for everyone and not everyone has the newer tape drives.
-- Ron Turull