Best Practices for Backing Up and Restoring Your System |
Summary of Best Practices for Backing Up Your SAS System |
The following are the recommended best practices for backing up your SAS system:
Perform full backups of the metadata server before and after major changes.
Specify a backup destination that is included in daily system backups.
Use alternating backup locations if the backup destination is not included in daily system backups.
Occasionally use the REORG option to reclaim unused disk space.
Occasionally use the RUNANALYSIS option to optimize metadata server memory usage.
Back up the SAS Table Server and the SAS Shared Services database.
The following topics describe the best practices in detail.
Always Use the Backup Wizard or %OMABAKUP to Back Up the Repository Manager and the Metadata Repositories |
The processes that you use to make regular system backups of your file system cannot directly access the metadata repositories, because the repository data sets are normally locked. Therefore, the recommended method for backing up your metadata repositories, the repository manager, the metadata journal file, and the metadata server's configuration files is to use the %OMABAKUP macro. (To use this macro, you can execute the backupServer.sas program that is provided with your installation, run the Backup Wizard, or write a custom %OMABAKUP program.) Your daily system backup process can then copy the files from the backup destination without needing to pause the server.
The %OMABAKUP macro and the Backup Wizard provide the following advantages:
They automatically pause the repository manager and the repositories that are being backed up or restored, and they quickly resume the repository manager and the repositories after the backup or restore operation is completed. A manual pause and resume operation might result in longer down time.
As a default, they back up the repository manager, the metadata journal file, your registered metadata repositories (depending on their access modes), and the metadata server's configuration files. For details about which repository access modes are supported by each tool, see About the Metadata Server Backup and Restore Utilities.
When performing backups, you can use the REORG option to reclaim unused disk space in metadata repositories.
When performing backups, you can use the RUNANALYSIS option to optimize the memory usage of metadata records that are retained in memory on the metadata server.
Perform Regularly Scheduled Full Backups |
To safeguard the integrity of your metadata, make regular full backups (rather than incremental backups) of your metadata repositories, the repository manager, the metadata journal file, and the metadata server's configuration files. If your metadata is being updated continually (for example, if information maps, reports, or user identities are created or modified frequently), then you should perform full backups on a nightly basis.
By performing full backups, you will ensure that associations between metadata are correctly maintained and that your metadata repositories can be restored to a consistent state. The best way to ensure that your backups meet this requirement is to use the Backup Wizard to create your backup job, or use %OMABAKUP to create a custom backup program
To maintain system integrity, you must also back up the SAS Content Server, the SAS Table Server, and the physical files that are associated with your metadata. See the following topics:
Back Up the SAS Table Server and the SAS Shared Services Database
Synchronize Metadata Backups with SAS Content Server, SAS Table Server, and Physical File Backups
Perform Backups Before and After Major Changes |
In addition to your regular full backup schedule, you should also perform a full backup before and after making major changes to your system. For example, you should perform a backup on the following occasions:
after you complete your initial installation and configuration
before and after you upgrade your system to a new release or service pack
after you add a new repository
before you delete a repository
The Backup Wizard is a useful tool for performing ad hoc (unscheduled) backups. You can also use %OMABAKUP to create a custom backup job.
In unscheduled backup situations that involve associated content and files (for example, the addition of new reports or stored processes), be sure to include the SAS Content Server, the SAS Table Server, and the physical files in your backup. If the backup does not involve a large amount of data, then the Import and Export wizards can be useful for this type of backup (see About Using the Export SAS Package Wizard to Back Up Specific SAS Folders).
In unscheduled backup situations where the metadata has changed but no physical files are involved, it is sufficient to back up just the repository manager, the metadata repositories, and the metadata server's configuration files. For example, no physical files are affected when you make changes to server definitions, user and group definitions, and access control templates. If you choose not to back up the physical files, you should make sure that no user activity that affects physical files has taken place since the last backup was taken. For example, make sure that no stored processes, jobs, or reports have been created or modified since the last backup.
Schedule Backups When Metadata Server Demand is Low |
When you run an %OMABAKUP job or a job created by the Backup Wizard, the metadata server is paused and the repositories are changed to Offline status. To minimize the impact of repository downtime on clients, you should execute these jobs during periods when demand for the metadata server is low.
Specify a Backup Destination That Is Included in Daily System Backups |
If the backup destination already contains backup files, the Backup Wizard or %OMABAKUP overwrites them with the new backup files. To ensure that you can restore metadata repository files from a previous backup, you should specify a backup destination that is included in your regular system backups. Then if a restore is necessary, you can obtain the files from the appropriate system backup.
As a default, the backupServer.sas program and the Backup Wizard write backup files to the SASBackup subdirectory of the metadata server startup directory. If you use the default destination, make sure that the SASBackup directory is included in your regular system backups.
Use Alternating Backup Locations |
If the backup destination is not included in daily system backups, then you should consider alternating backups to multiple backup locations. For example, you might alternate backups to different network-accessible drives, depending on the day of the week. Then if backup files become corrupted, or if a backup host is damaged, you can restore the metadata repositories and the repository manager from another location. For a sample backup program that uses this method, see Example: Backup Program on Windows, Using Alternating Destinations.
Occasionally Use the REORG Option to Reclaim Unused Disk Space |
When metadata is deleted from a metadata repository, the record is removed from both memory and disk. However, the disk space that had been allocated for the record remains in the data set after the record is removed.
When you use the Backup Wizard or %OMABAKUP to perform a backup, you can use the REORG parameter to reclaim unused disk space that is left from previously deleted metadata objects. The Backup Wizard or %OMABAKUP does the following if this parameter is set to YES:
re-creates the repository data sets as it copies them to the backup destination, eliminating unused space in the process
copies the re-created data sets back to their original locations
Because of the overhead that is associated with re-creating the data sets, you might not want to use the REORG option for every backup. Consider using this option once a month and after large amounts of metadata have been deleted.
Occasionally Use the RUNANALYSIS Option to Optimize Metadata Server Memory Usage |
When you use the Backup Wizard or %OMABAKUP to perform a backup, you should occasionally use the RUNANALYSIS option. This option checks the repository backup files for unnecessary indexes, long character variables that can be stored as variable-length strings, duplicate strings, and other issues that can affect memory. The next time you run a backup with the Backup Wizard or %OMABAKUP, the backup program uses the results of the analysis to perform memory optimization tasks. These tasks optimize the amount of space that is used when repository records are read into the metadata server's memory.
It is not necessary to use the RUNANALYSIS option on a regular basis. Variable usage is unlikely to change much unless you add or delete a significant percentage of the total metadata in a repository. The analyses are most useful after metadata is first loaded into metadata repositories and after significant updates are applied.
The %OMARUNAN macro performs the same functions as the RUNANALYSIS option of %OMABAKUP, except that %OMARUNAN runs independently of other programs and the metadata server. To minimize the impact of the character variable analyses on the metadata server, you might want to direct the backup copies that you want to analyze to a network-accessible drive, and execute %OMARUNAN on that computer. Note that %OMARUNAN must be executed in the same operating environment that was used to create the backups.
For information about using these features, see Using %OMARUNAN (or the RUNANALYSIS Option of %OMABAKUP) to Optimize Memory Usage.
Back Up the SAS Content Server |
If your deployment includes SAS Web applications, then it is important to back up the SAS Content Server when you back up the metadata server. The SAS Content Server contains content that is associated with metadata objects that are contained in the repositories, including the following:
content for the SAS Information Delivery Portal
report definition files
other supporting files for reports, including PDF files and image files
content for SAS solutions
To back up the SAS Content Server:
As a best practice, stop either the Web application server or the SAS Content Server application before making the backup.
If you are using an IBM WebSphere Application Server or an Oracle WebLogic Server, then you can stop the SAS Content Server application.
If you are using a JBoss Application Server, then you must stop the server.
Use operating system commands or third-party tools to copy all of the files and subdirectories from the following path:
SAS-configuration-directory\Lev1\AppData\SASContentServer\Repository
If you need to back up just a subset of the SAS Content Server, or if you want to create a backup for input to a system other than the SAS Content Server, you can use use the WebDAVDump and WebDAVRestore utilities. For instructions, see SAS Usage Note 38667.
Back Up the SAS Table Server and the SAS Shared Services Database |
If your deployment includes SAS Web applications, then it is important to back up the SAS Table Server. Follow these steps:
Stop the SAS Table Server.
Use operating system commands or third-party tools to copy all of the files and subdirectories from the following path:
SAS-configuration-directory\Lev1\SASTS
You must also back up the Shared Services database that exists on the table server. Use the following command:
sastback -b SharedServices.fdb -mo read_only [-verbose] SharedServices.fbk
If you need to restore the Shared Services database, use the following command:
sastback -r SharedServices.fbk [-verbose] SharedServices.fdb
The SASTBACK executable is located in the following path:
On Windows: SAS-installation-directory\SASFoundation\9.2\vulcan\bin
On UNIX and z/OS: SAS-installation-directory/SASFoundation/9.2/vulcan/bin
Back Up Data That Is Stored in File Systems |
When you back up the metadata server, it is important to also back up the physical data that is associated with the metadata objects that are contained in the repositories. The metadata cannot be used without the associated data. If you need to recover from a failure, the metadata that you restore must be synchronized correctly with the associated data.
Since the Backup Wizard and %OMABAKUP do not back up the physical data that is associated with the metadata, you must use operating system commands or third-party tools to back up the physical data.
Your backup strategy should include the following data:
portal content that is not stored in the SAS Content Server, including custom portlets, custom themes, and applications
report definition files and other supporting files for reports (for example, PDF files and image files) that are stored in your file system, if you are not storing these items on the SAS Content Server
source files for stored processes
packages that have been published to a channel's persistent store (archive) location
stored process results that are stored in permanent packages
data sources, including the following:
SAS tables
OLAP data
SAS Scalable Performance Data Server data
RDMS data sets
custom code, processes, and postprocesses that are associated with SAS Data Integration Studio jobs
XML files and XML maps that are contained in libraries
source files for SAS Data Integration Studio jobs that have been scheduled or deployed for scheduling
Synchronize Metadata Backups with SAS Content Server, SAS Table Server, and Physical File Backups |
To maintain system integrity in the event that a restore is needed, your backups of the SAS Content Server, SAS Table Server, and physical data must be synchronized correctly with your metadata backups. To ensure that the backups are synchronized, you can use one of the following approaches:
Back up the metadata server, the SAS Content Server, the SAS Table Server, and the physical files concurrently (that is, in the same backup window).
Back up the SAS Content Server, the SAS Table Server, and the physical files immediately after the metadata server is backed up, and do not allow clients to update metadata while you are performing these backups. You can accomplish this in either of the following ways:
If you are running the backup on a batch basis (for example, as part of a daily schedule), then you can do the following:
Write a program that uses PROC METAOPERATE to pause the metadata server to an Offline state. See Example of a PROC METAOPERATE Program that Pauses the Metadata Server to an Offline State.
If you use the Backup Wizard or %OMABAKUP to back up the metadata server, then the server is paused automatically. However, you can use this program to pause the metadata server while you back up the SAS Content Server, SAS Table Server, and associated physical data.
If you use operating system commands to back up the metadata server, then you can use this program to pause the server before running the backup.
Write another program that resumes the metadata server to an Online state. See Example of a PROC METAOPERATE Program that Resumes the Metadata Server. You can use this program after using operating system commands to back up the metadata server, or you can use it after backing up the SAS Content Server, SAS Table Server, and associated physical data.
If you are running an ad hoc (unscheduled) backup and you need to also back up associated data, then you can do the following:
Use the Backup Wizard or %OMABAKUP to back up the metadata server. Then immediately use SAS Management Console to pause the metadata server (see Using SAS Management Console to Operate SAS Servers). As an alternative, you can use SAS Management Console to temporarily change the registered access mode of the repositories to ReadOnly (see Change the Properties of a Metadata Repository).
Back up the SAS Content Server, the SAS Table Server, and the physical data.
When you are finished backing up the SAS Content Server, the SAS Table Server, and the physical data, use SAS Management Console to resume the metadata server (or to return the registered access mode of the repositories to Online).
Here is an example program that uses PROC METAOPERATE to pause the metadata server to an Offline state.
If you use operating system commands to back up the metadata server, you can use this program to pause the server before running the backup.
If you use the Backup Wizard or %OMABAKUP to back up the metadata server, then the server is paused automatically. However, you can use this program to pause the metadata server while you back up the SAS Content Server, SAS Table Server, and associated physical data.
proc metaoperate server="host-name" port=8561 userid="user-ID" password="encoded-password" protocol=bridge action=pause noautopause; run;
The user that is specified in user-ID must be assigned to the Metadata Server: Operation role.
Here is an example program that uses PROC METAOPERATE to resume the metadata server to an Online state. You can use this program after using operating system commands to back up the metadata server, or you can use it after backing up the SAS Content Server, SAS Table Server, and associated physical data.
proc metaoperate server="host-name" port=8561 userid="user-ID" password="encoded-password" protocol=bridge action=resume noautopause; run;
The user that is specified in user-ID must be assigned to the Metadata Server: Operation role.
For detailed information about PROC METAOPERATE, see SAS Language Interfaces to Metadata.
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.