13
Wed, Nov
5 New Articles

Win with Save and Restore Commands

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Just like a goalie is the last line of defense for a hockey team, a robust backup and recovery strategy provides an IT team with the tools to save the game. An action plan for dealing with disasters is essential for any business. Why? Plain and simple: Downtime equals lost money and decreased productivity. This article profiles most of the AS/400’s save and restore commands to give you a basic understanding of when and where to use each command.

Because the AS/400 is an extremely versatile computing system, it provides a vast array of choices for saving and restoring your data. Although the choices seem confusing, I hope this article makes the picture clearer. Also, check out the handy table of these commands (suitable for framing—or at least attaching to your computer screen) at www.midrangecomputing.com/mc/99/07. If you need further information on the commands profiled here, visit publib.boulder.ibm.com/pubs/ html/as400/online/v4r1eng.htm and view Backup and Recovery online.

The Key to Making a Save: A Strong Defense

In the IT game, save commands can serve as your best defense, and the AS/400 has a variety of save commands from which to choose.

Save Library (SAVLIB) saves all objects in the library as well as the library description itself and is probably the most widely used AS/400 save command. SAVLIB has the following key parameters:

• LIB—Use this parameter for the name(s) of the libraries to be saved. Three special values are also available, *NONSYS, *IBM, and *ALLUSR. If you specify *NONSYS, all user-created libraries, licensed program libraries, QGPL, and QUSRSYS are saved. *IBM saves IBM libraries like QHTTP, QJAVA, etc. IBM libraries are defined as any library that contains objects that IBM provides exclusively. QGPL, for example, is not considered an IBM library because objects created locally are sometimes stored there. *ALLUSR saves all libraries except those beginning with a “Q” or a “#.”

• DEV—Use this parameter to specify the name of the device that will perform the save operation, which may be either a storage unit, such as a tape drive, or a save file.

• TGTRLS—Use this parameter to specify the release level at which you want to save the objects. If you plan to restore the objects on a system that is running on a different release, save the objects at the level of the system on which you will restore them.

• SAVACT—If you specify *NO, the object you are saving must not be in use. The following three values allow for the saving of objects while they are in use and determine in which state the objects will be saved. If you specify *LIB, all of the objects in a library reach a checkpoint together and are saved in a consistent state. *SYNCLIB does the same across multiple libraries. Don’t use *LIB or *SYNCLIB on libraries that contain thousands of objects. The operation may fail under these conditions. Also, note that *SYNCLIB and *LIB lock all data areas in the libraries that are being saved, which may cause programs that access them to fail. The final option is *SYSDFN. If you use *SYSDFN, objects may not be saved in a consistent state to one another because they may reach checkpoints at different times.

• OMITLIB/OMITOBJ—Use these parameters to omit specific files or libraries from the save operation.

Save Object (SAVOBJ) saves one or more objects on your system. Basically, the same rules apply from the SAVLIB command. The difference between the two commands is that you can use SAVOBJ to save all objects of a specific type. If, for example, you wanted to save all job descriptions on your system, you would use the SAVOBJ command specifying OBJ(*ALL), OBJTYPE(*JOBD).

Save Changed Objects (SAVCHGOBJ) saves only those objects that have changed since the date and time specified on the input parameters. Use the Display Object Description (DSPOBJD) command to find the last save date of an object. (SAVCHGOBJ does not update this timestamp.) This command has its pros and cons. While SAVCHGOBJ can greatly speed up your backup, it can also slow a recovery effort. If, for example, you have to restore an entire library, you may have to use multiple tapes (the last SAVLIB tape and the most recent SAVCHGOBJ tape) in the recovery effort. A key parameter for SAVCHOBJ is REFDATE. The valid values are a date or *SAVLIB. If you enter a date, all objects that have changed after that point are saved. *SAVLIB causes all objects to be saved that have changed since the last time the library they reside in has been saved.

Save File Data (SAVFDTA) saves the contents of a save file to storage media and not the save file itself. An AS/400 save file is similar to a PC zip file. Save files store compressed versions of AS/400 objects and can be restored (unzipped) by using the AS/400 restore commands I discuss later in this article.

Save License Program (SAVLICPGM) distributes licensed programs across multiple systems. You can achieve the same results by using the SAVLIB LIB (*IBM) but with one minor difference. SAVLICPGM allows you to save the code to a save file, which is easier to distribute quickly over a network.

Save Document Library Objects (SAVDLO) saves document library objects stored in the AS/400 Integrated File System (IFS). The IFS stores objects such as email messages, PC files, and the online help text of InfoSeeker. DLO is a key parameter that specifies which document library objects to save. *ALL saves all DLO objects and can be further qualified by using the FLR parameter. *CHG causes all DLO objects that have been changed or created since the last save operation to be saved. Entering a value of *MAIL saves email documents and logs.

Save (SAV) saves a specific object, a directory or subdirectory, an entire file system, or objects that match a specific search criteria. You can use SAV to save objects in the QLANSVR, QNETWARE, and QOPENSYS file systems. If you are using Client Access, SAV needs to be part of your save strategy. Some objects used by Client Access and other client/server applications can be saved only by using the SAV command and therefore would be unrecoverable in the event of a disaster.

Save Storage (SAVSTG) copies all data on your AS/400, including licensed internal code, to storage media and is the fastest way of backing up and restoring an entire

system. You can’t restore individual objects with SAVSTG, so use it for disaster recovery only.

Save System (SAVSYS) saves the contents of QSYS as well as the licensed internal code. Use SAVSYS before performing any type of system upgrade.

Save APAR Data (SAVAPARDTA) saves the information required for submitting an Authorized Problem Analysis Report. You can save existing problem information or open a new problem log by specifying PRBID(*NEW). After you enter the problem identifier, a menu appears from which you can select more specific problem information. You can save information such as history logs, system values, and PTF information. SAVAPARDTA also builds an APAR library from the information you select that you can then send to IBM for analysis.

Save Calendar (SAVCAL) allows you to save one or more OfficeVision/400 calendars to a storage medium for backup or migration purposes.

Save Bookshelf (SAVSHF) saves the online documentation for the AS/400 stored in the IFS.

The following six commands are part of AS/400’s Object Connect/400 function. They speed up the process of saving objects on one system, transferring them to another, and then restoring them. When provided with the name of a target system and what objects to save/restore, ObjectConnect/400 handles the rest of the process. Each command is closely tied to one of the commands previously outlined.

Save/Restore (SAVRST) saves directory objects on one system, sends them to another, and finally restores them on the target system (correlates to the SAV/RST commands).

Save/Restore Object (SAVRSTOBJ) is the same as SAVRST except you use it for nondirectory objects (correlates with SAVOBJ/RSTOBJ).

Save/Restore Change (SAVRSTCHG) is the same as SAVRST except that it saves changed objects only (correlates with SAVCHOBJ/RSTOBJ).

Save/Restore Library (SAVRSTLIB) supports the same features of the SAVLIB command and works the same way as SAVRST (correlates with SAVLIB/RSTLIB).

Save/Restore Document Library Objects (SAVRSTDLO) processes document library objects (correlates with SAVDLO/RSTDLO).

Save/Restore Configuration (SAVRSTCFG) saves and restores configuration data. It saves objects such as *CFGL, *CNNL, *COSD, *MODD, *NTBD, and *TRA.

Restore: Your Offense

So far, I’ve covered only half the story. While a good goalie provides defense, a sound offense is just as important. The way a hockey team scores is by putting the puck in the net, and an IT team scores by providing reliable software and systems. The restore commands provide the means to balance the attack.

Restore (RST) restores objects saved with the SAV command. Restore Authority (RSTAUT) restores object authorities for user profiles. You can run this command on a profile-by-profile basis or for all users.

Restore Calendar (RSTCAL) restores OfficeVision objects saved with the SAVCAL command.

Restore Configuration (RSTCFG) restores configuration objects. You can restore all configuration objects, groups of objects by generic name, or specific types of objects, such as controller descriptions.

Restore Document Library Object (RSTDLO) restores documents, folders, and Restore Libraries (RSTLIB) restores libraries saved with SAVLIB. Restore Licensed Program (RSTLICPGM) restores licensed program information saved via SAVLICPGM.

Restore System Object (RSTOBJ) restores system objects saved with SAVOBJ.

mail.

Restore Bookshelf (RSTSHF) restores objects saved with SAVSHF. Restore User Profiles (RSTUSRPRF) restores user profiles saved with either SAVSYS or SAVSECDTA.

The AS/400 also provides menus for accessing the save and restore commands. By entering GO SAVE on a command line, a menu is produced through which you can access all of the AS/400 save commands. GO RESTORE does the same for the restore commands. The save and restore menus provide a quick and easy way to access the commands in this article.

The 28 commands presented here can be viewed as a team. Some play offense, some play defense, some play special teams, and you are the head coach, responsible for employing your assets in the best way possible to win the game. By combining the various save commands into an effective backup strategy, you can simplify recovery efforts.

Back up all aspects of your system all the time. These commands allow you to back up in the most efficient way possible. For example, unless you upgrade your system on a daily basis, you don’t need to back up the licensed internal code every day. For files and objects that do change daily, however, you need to back up often. You need to strike a balance between offense and defense. These commands provide the means to one day hear the words, “He shoots; he scores. The IT department wins the game in overtime!”

Team Up

DAVID MAYLE
Dave Mayle is a senior developer for Eaton Corporation, a global leader in electrical systems and components for power quality, distribution, and control. Dave has worked on the iSeries/System i since 1993 and is currently focused on developing Java, Web, and ILE applications. Dave has written numerous technical articles on the iSeries and is a three-time Speaker of Merit award winner at COMMON. Dave is a graduate of Bucknell University and can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it.
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: