Previous Page | Next Page

Best Practices for Backing Up and Restoring Your System

Best Practices for Backing Up Your SAS System


Summary of Best Practices for Backing Up Your SAS System

The following are the recommended best practices for backing up your SAS system:

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.

CAUTION:
If you choose to use operating system commands to back up your metadata repositories and the repository manager, instead of using the Backup Wizard or %OMABAKUP, then you must be sure to pause the metadata server before performing the backup. Otherwise, the backup files will not be usable.   [cautionend]

The %OMABAKUP macro and the Backup Wizard provide the following advantages:


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:


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:

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:

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:

Metadata cannot be used without the associated content that is stored on this server. If you need to recover from a failure, the metadata that you restore must be synchronized correctly with the content server.

To back up the SAS Content Server:

  1. 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.

  2. 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:

  1. Stop the SAS Table Server.

  2. 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:

For more information about the Shared Services database, see the SAS Intelligence Platform: Web Application Administration Guide.

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:


Synchronize Metadata Backups with SAS Content Server, SAS Table Server, and Physical File Backups


Recommended Approach for Synchronizing Metadata Backups with Physical 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:


Example of a PROC METAOPERATE Program that Pauses the Metadata Server to an Offline State

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.


Example of a PROC METAOPERATE Program that Resumes the Metadata Server

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.

Previous Page | Next Page | Top of Page