About the SAS Metadata Server Backup and Recovery Facility

Overview of the SAS Metadata Server Backup and Recovery Facility

The SAS 9.3 Metadata Server includes a new server-based facility that performs metadata server backups automatically on a scheduled basis. This facility can also be used to perform ad hoc backups and to perform roll-forward recovery. The facility replaces the %OMABAKUP macro, which was available in SAS 9.1 and 9.2, and the Backup and Restore Wizard in SAS Management Console, which was available in SAS 9.2.
The backup and recovery facility provides the following features:
  • A schedule of daily backups is configured by the SAS Deployment Wizard. Therefore, daily backups are taken without the need for administrator intervention. In addition, unscheduled backups are launched automatically in certain situations, such as after the SAS Deployment Wizard configures the metadata server.
  • Administrators can use SAS Management Console to change the schedule and the configuration options, including the backup directory location and the backup retention policy. Backups can also be run on an ad hoc (unscheduled) basis from SAS Management Console, from the operating system command line, from SAS, or through third-party scheduling software.
  • When repositories are restored in the event of a metadata server failure, transactions recorded in the journal file can be used to perform roll-forward recovery to a specified point in time after the last backup was taken.
  • SAS Management Console displays detailed backup and recovery history. The history includes all backups that are run using the server’s backup facility, regardless of how the backup was invoked (from the server’s own scheduling facility, from SAS Management Console, from the command line, from SAS, or from third-party scheduling software).
  • The backup process is a “hot” backup that executes in a separate thread while the metadata server is running. Therefore, the server does not need to be paused during the backup, and all transactions, including updates, continue to be processed. If journaling has been disabled or if the Reorganize Repositories backup option has been selected, the server is paused for Read-Only use, so that queries (but not updates) can continue to be processed.
  • The metadata server runs its own backup and recovery processes. These processes do not rely on any other servers, such as workspace servers, DATA step batch servers, or scheduling servers. Because the metadata server has permission to access all of the needed files, there is no need to set up a host account with special operating system rights and permissions.
Note: When you migrate to SAS 9.3, the SAS Deployment Wizard removes all SAS 9.1.3 and SAS 9.2 backup and restore jobs, backup schedules, and backup programs that were registered in SAS Management Console. The SAS 9.1.3 and SAS 9.2 metadata server backup utilities, including %OMABAKUP and the Backup and Restore Wizard, are not supported in SAS 9.3.

About the Automatically Configured Daily Backups of the Metadata Server

When you migrate to or install SAS 9.3, the SAS Deployment Wizard configures a schedule of automatic daily backups of the SAS Metadata Server. The automatic backups are configured as follows:
  • Backups are performed daily (seven days a week) at 1:00 a.m. server local time.
  • The backup that is performed on Monday uses the Reorganize Repositories option.
  • Backups and their associated journal files are stored in the following location: SAS-configuration-directory/Lev1/SASMeta/MetadataServer/Backups. (If you select the Custom option when installing SAS 9.3, the SAS Deployment Wizard enables you to specify a different location.) Within the backup location, each set of backup files is stored in a directory that is named based on the date and time that the backup was started (for example, 2011-06-06T01_00_01-04_00). Do not change this directory name, because the recovery facility requires the name to be in this format.
    Tip
    As a best practice, you should modify your backup configuration to specify a storage device other than the device that is used to store the metadata repositories and the server configuration files. Specifying a separate device will ensure that backup files and their associated journal files (including the most current journal file) are available in the event of a disk failure.
    Tip
    Be sure to include this backup location in your regular system backups.
  • Backups are retained for a period of seven days. Each time a backup is successfully completed, all previously created backup files that are more than seven days old are deleted from the backup directory. A record of the deleted backups is retained in backup history. (When a backup is attempted but not competed successfully, no backup files are deleted.)
The backup facility automatically backs up the following files:
  • all of your metadata repositories, regardless of their access state (Online, Read-Only, Administration, or Offline).
  • the repository manager.
  • all of the files in SAS-configuration-directory/Lev1/SASMeta/MetadataServer, including metadata server configuration files, INI files, SAS programs, scripts, and backup history files, as well as any additional files that you might have stored in this directory. These files are backed up to a ConfigurationFiles subdirectory within the backup location.

About Unscheduled Backups of the Metadata Server

In addition to running scheduled backups, the metadata server automatically backs itself up in certain unscheduled situations. Unscheduled backups use the same server-based backup facility and the same backup configuration options that are used for scheduled backups.
  • A backup is run automatically after the SAS Deployment Wizard configures the SAS Metadata Server.
  • A backup is run automatically after you complete a successful recovery of the metadata server. (Backups that are completed in this situation are not deleted when they are older than the retention period.)
  • If you change the JOURNALTYPE option in the omaconfig.xml file to NONE or SINGLE (which is not recommended), and you later change the option back to ROLL_FORWARD, a metadata server backup is run automatically when you restart the server.
As a best practice, you should run an ad hoc backup before and after making other types of major changes to your system. For example, you should run a backup before and after the SAS Deployment Wizard configures the middle and client tiers of your deployment, before and after you change the host name of an existing server, before you delete a repository, and after you add a new repository.

How Journal Options Affect Metadata Server Backup and Recovery

The metadata server journal is a high-speed disk file in which transactions are recorded until they can be applied to repositories. The JOURNALTYPE option of the metadata server configuration file (omaconfig.xml) specifies whether metadata journaling is enabled and, if so, which type of journal file is created:
  • The SAS Deployment Wizard sets the JOURNALTYPE option to ROLL_FORWARD. This option creates a linear journal file that permanently stores all transactions that have occurred since the most recent backup. The journal file is written to the same location as the associated backup files. Each time a new backup is executed, journaling stops and a new journal file is started in the new backup location.
    CAUTION:
    As a best practice, it is strongly recommended that you keep the default setting of ROLL_FORWARD for the JOURNALTYPE option.
    ROLL_FORWARD must be specified if you want to be able to use roll-forward recovery in the event of a metadata server failure.
  • If you change the JOURNALTYPE option to SINGLE (which is not recommended), the roll-forward option is unavailable in the event of a metadata server failure. This setting creates a single circular journal file of a fixed size at the location that is specified in JOURNALPATH. Journal entries are appended to the file until the file grows to the size that is specified in JOURNALSIZE. Subsequent entries overwrite previously written entries starting at the beginning of the file.
  • If you change the JOURNALTYPE option to NONE (which is not recommended), then no journal file is created and the roll-forward option is unavailable in the event of a metadata server failure. In addition, the metadata server cannot be backed up while the server is in an ONLINE state. The server will pause itself to a READONLY state each time a backup is executed, and any update transactions that are issued during the backup will fail.

About the Reorganize Repositories Backup Option

When metadata is deleted from a SAS 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. When you schedule or run a metadata server backup, you can select the Reorganize Repositories option to reclaim unused disk space left from the previously deleted metadata objects.
The default backup schedule specifies a weekly reorganization at 1:00 a.m. each Monday. It is not necessary to reorganize the repositories more frequently than once a week, except in extraordinary situations such as the deletion of a large amount of metadata.
If the Reorganize Repositories option is selected, the backup process does the following:
  • pauses the server, placing it in a READONLY state
  • copies the metadata server files to the backup destination
  • re-creates the repository data sets in place, eliminating unused space in the process
  • resumes the server to an ONLINE state
CAUTION:
The Reorganize Repositories option should be used only during times of little or no user activity. The metadata server is paused during the reorganization process, and any update transactions that are issued during this process will fail.