Newsletters   Subscriptions  Forums  Store   Career  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 5, Number 10 -- March 9, 2005

Admin Alert: Creating a Save Changed Objects
Backup Tape


by Joe Hertvik


Like most operating systems, OS/400 provides a save changed objects function, allowing you to selectively backup only those objects that have changed since the last full system backup. This week, I'll examine the save changed objects procedure and give you some simple CL code for creating a saved objects backup tape. A save changed object backup works in conjunction with a full system backup to minimize weekly backup times and to enable administrators to restore objects from several different tapes in a backup cycle.

The two backups work together in the following way:

  • The full system or Save While Active backup creates a baseline portrait of your system that contains all user and system objects. It takes longer to backup a system this way, so this backup is generally run once a week when system usage is at its lowest.
  • The save changed objects backup can be run on a regular basis to save only those objects that have been changed since the last full system backup. This type of backup runs faster--since there are far fewer files--and that means you can run it nightly and you can save changed objects while they are active.

When you need to restore objects to the system, you can restore them from either the full system backup tape or the save changed object tape or both, depending on which tape contains the version of the objects you want to restore. For libraries, you could restore the library from both tapes, overlaying the full backup with any newer objects from the save changed object tape. The result is that you have up-to-date backup coverage of all your user objects, without extending the time and resources it would take to back up every object every night.

Save changed object backups are also valuable when you're migrating data from one AS/400, iSeries, or i5 partition to another. In a migration scenario, you may be staging and testing a new partition while you are still doing production work on an older partition on another machine. Using a save changed object tape in conjunction with a full backup, you can restore the entire system from the full backup tape, and then make the new box current at any time by only restoring those objects that have changed since the last full backup. A save changed object tape is also helpful in maintaining an independent test environment, where you periodically need to refresh your data with new information without having to reload the entire system.

To create a save changed objects tape that can be used to restore most user objects on an OS/400 system, I created the following code. With this code, you can create a tape that saves every user-based changed object that you might want to restore to a target system:

SAVSECDTA  DEV(tape_drive_name) ENDOPT(*LEAVE)    
MONMSG     MSGID(CPF0000)         
SAVCHGOBJ  OBJ(*ALL) LIB(*ALLUSR) DEV(tape_drive_name) +
             OBJJRN(*YES) REFDATE(*SAVLIB) +    
             ACCPTH(*YES) OUTPUT(*PRINT)        
MONMSG     MSGID(CPF0000)
SAVDLO     DLO(*SEARCH) DEV(tape_drive_name) SRCHTYPE(*ALL) +
             OWNER(*ALL) REFCHGDATE(*SAVDLOALL)      
MONMSG     MSGID(CPF0000)         
SAV        DEV(/QSYS.LIB/tape_drive_name.DEVD) OBJ(('/*' *INCLUDE) +     
             ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT)) +  
             OUTPUT(*PRINT) ENDOPT(*LEAVE) +         
             CHGPERIOD(*LASTSAVE)                                 

Except for the Save Security Data (SAVSECDTA) command, all these commands can also be run in Save While Active mode. Here's how it all fits together.

The SAVSECDATA command saves all user profiles that you may need to restore to your target system. There is nothing different about this command that you wouldn't see in a regular full system or Save While Active backup, but you can use this function to keep your security data current.

As shown here, the Save Changed Objects command (SAVCHGOBJ) saves all the changed objects in your machine's user libraries (all libraries whose names do not begin with the letter 'Q') as designated by *ALLUSR literal in the Library parameter (LIB). By designating *SAVLIB in the Reference Date parameter (REFDATE), OS/400 only saves those objects that have changed in your libraries since the last time a SAVLIB command was run over each library.

If you want to modify this SAVCHGOBJ command to only backup objects that have changed since a certain date and time, you could change the command to look like this:

SAVCHGOBJ  OBJ(*ALL) LIB(*ALLUSR) DEV(tape_drive_name) +   
              OBJJRN(*YES) REFDATE('mm/dd/yy') +    
              REFTIME('hh:mm:ss') ACCPTH(*YES) +    
              OUTPUT(*PRINT)

Running the command this way only saves those objects that were changed after the date and time specified in the Reference Date and Reference Time parameters (REFDATE and REFTIME, respectively). This variation is handy when you are trying to synchronize data between two environments, where the synchronizing partition was originally restored from a full system backup and you want to create a tape to port newer object changes between the two environments.

The Save Document Library Object command (SAVDLO) performs the same function for Document Library Objects (DLOs) as the SAVCHGOBJ command does for OS/400 library objects. In this configuration, SAVDLO will only save DLO folder and document objects that have been created since the last time the SAVDLO command was run, as specified by the *SAVDLOALL value in the Last Changed Date parameter (REFCHGDATE). Note that you can only save changed DLOs when the DLO parameter (DLO) is equal to *SEARCH.


Like the SAVCHGOBJ command, you can also tell the SAVDLO command to only save files that have been saved since a certain date and time by entering the starting date and time in the Last Changed Date (REFCHGDATE) and the Last Changed Time (REFCHGTIME) parameters.

The Save command (SAV) saves all the IFS objects that have changed since the last time the SAV command was run with the Update History parameter (UPDHST) set to *YES. (This is specified by setting the time period for last change parameter, CHGPERIOD, to *LASTSAVE in the code above). Like the other commands, the CHGPERIOD parameter can also be set to save IFS objects that were modified after a specific date and time.

With these commands, you can create a save changed objects tape that contains all the non-IBM objects that you might need to restore changed files to your current system or to a system in another environment. But just remember that this tape has to work in conjunction with a recent system backup or it will not be as helpful to your shop.


Click here to contact Joe Hertvik by e-mail.

Sponsored By
COMMON

COMMON Spring 2005
IT Education Conference & Expo
Chicago, Illinois
March 13-17, 2005

Register Now!

The COMMON IT Education Conference & Expo in Chicago, held March 13-17, will feature hundreds of sessions in business strategy, networking, and development, with a featured educational focus on Systems Management.

Conference Highlights
· Choose from more than 500 sessions organized by specific Courses of Study
· Take part in one of four in-depth pre-conference workshops covering Linux, Java, RPG and IBM Performance Management Tools
· Explore the latest technologies in the industry's largest Expo
· Network at COMMON social events
· Talk to IBM executives at the iSeries Nation Town Hall Meeting

COMMON conferences are one of the most cost-effective ways to gain the tools and knowledge you need to meet the changing demands of information technology. You'll receive education unlike any offered within the industry, and you'll garner a tangible and immediate return on your investment.

In addition to the direct savings on education, conference attendees make professional contacts whom they can consult long after the conference ends. Attendees will also have direct access to IBM developers and managers. The Expo offers an opportunity to talk one-on-one with industry vendors who provide the latest products and services. This means attendees return to the office with real-time solutions that can be implemented immediately--without wasting countless hours in independent research.

A typical COMMON conference attendee participates in nearly 40 hours of sessions presented by leading professionals in the IT industry - individuals who would charge up to $500 per hour, if you could secure them! At COMMON conferences, they're a standard part of our educational package.

COMMON is the largest users group of midrange IBM and IBM-compatible IT professionals, and it holds two education conferences per year.

For more information on COMMON and to register, visit:
www.common.org


Technical Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Managing Editor: Shannon Pastore
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.


THIS ISSUE
SPONSORED BY:

T.L. Ashford
Patrick Townsend & Associates
COMMON


BACK ISSUES

TABLE OF
CONTENTS
Recursion and the Alternatives

PC5250 and the Print Key

Admin Alert: Creating a Save Changed Objects Backup Tape


The Four Hundred
iSeries ISVs Elated as IBM Opens Roadmap and Wallet

Future "Cell" Power Processors Can Run OS/400

IBM's Chiphopper Tools to Help Build iSeries Apps

Four Hundred Stuff
Core Imaging Targets the Paper Chase at OS/400 Shops

It's Time for Web Services That Are Useable, Attachmate Says

iSeries Access for Linux Gives Users Choice

Versata Hopes for a SOA Spark with New Java IDE

Four Hundred Monitor


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc. (formerly Midrange Server), 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement