SPD Server Backup Utility (spdsbkup)

Backup Requirements

Client Access to an SPD Server Domain

The client that performs the backup does not have to execute on the same machine as the SPD Server. However, the client must be able to access the physical path of the server domain that is being backed up. The client can access the physical path of the domain directly or through a network connection.

Domain Preparation

In order for a table or domain to be eligible for backup, the domain BACKUP=YES option must be set in the libnames.parm parameter file. Here are examples of two domain definitions from a data server's libnames.parm parameter file:
LIBNAME=nobackup pathname=/usr/foo/test;

LIBNAME=canbackup pathname=/usr/foo/test BACKUP=YES;
The domain definition called NoBackup creates tables in the directory /usr/foo/test, but it does not specify the BACKUP= option. Therefore, tables that are created through this domain definition are ineligible for backup. In contrast, the definition for the domain CanBackup, which creates tables in the same directory, specifies the BACKUP=YES option. As a consequence, tables that are created through this domain are eligible for backup.
When spdsbkup performs a backup, it checks every table in /usr/foo/test. However, based on the parameter file entries in this example, spdsbkup backs up only the eligible tables in CanBackup. When you create client connections using pass-through or LIBNAME statements, you can use the BACKUP=NO LIBNAME option to override default backup settings.

Incremental Backups Require a Prior Full Backup

Before you can do an incremental backup of a server table, you must do a full backup of the table. You can perform the full backup in two ways:
  • Use the system's full backup utility, and then inform spdsbkup of the system's last full backup date.
  • If a full backup has not been done before, use spdsbkup to perform a full backup.
After you have performed a full backup on a server table, you can then proceed with an incremental backup strategy. The first incremental backup saves all table changes that were made after the last full backup date. Each successive incremental backup saves the changes that were made after the previous incremental backup.

Backup Process

The backup utility spdsbkup performs a full or incremental backup of a server table or domain. It creates a backup file that contains full backups of newly created server tables or incremental backups of tables that have been backed up before.
During the backup process, the spdsbkup utility performs the following tasks:
  • connects to a specified SPD Server
  • uses the SPD Server pass-through facility to generate SQL queries on server domain tables
  • backs up the records that the query returned
  • compresses the record data
  • stores the data in a flat data file so that the restore utility can use it later when it restores the tables
  • creates a table of contents file that contains summary information about the backup.

Content of a Full Backup

When you do a full backup of a server table, all of the table rows and attributes (indexes, partition size, compression, and sorted) are backed up. ACL files must be in the same physical directory as the domain. If any ACL file does not meet this requirement, the ACLs are not backed up, and a warning message is sent to the log. The spdsbkup utility continues to back up all specified tables.
When you perform an SPD Server full backup of a table, the SPD Server full backup utility does not save the index data. It saves only the information necessary to re-create the indexes when the table is restored. Therefore, when you back up table indexes, the information that is saved does not require additional overhead or a lot of additional space. If you must fully restore a table later, the SPD Server restore utility, spdsrstr, can re-create the indexes when the table is created. Or you can use the -n option in the restore. The -n option suppresses index creation. After the table is fully restored, you can use PROC DATASETS or PROC SQL to re-create the indexes.

Content of an Incremental Backup

When you perform an incremental backup of a server table, only changes that were made to the table rows since the last full backup are included in the backup. Changes to the table attributes are not backed up. When you restore an SPD Server incremental backup, the incremental changes to the rows are applied. Only attributes that were associated with the table at the time of the last full backup (indexes, partition size, compression, and sorted) are applied to the restored rows.

Backup Data File

Backup Data File Nomenclature

The spdsbkup utility stores backup data in a file named filename_BK_ddmmmyyyy_hhmmss.0.0.0.spds9. The suffix, which is added to the filename, generates a unique backup file that indicates when the backup was performed. Because the suffix is unique, you can use the same filename for successive backups of a domain or a table, without overwriting an existing file.

Backup Data File Extensions

If the backup file exceeds the system file size limit, spdsbkup automatically extends the file and stores the excess data in additional files. The software identifies these files with a file extension that follows the date/time. (The SPD Server file extension is the 0.0.0 portion of the filename.) Although the extensions for the files vary, the date/time is the same on all the files. You must have a backup file complete with file extension before you can begin a restore session.

Backup Table of Contents File

The backup table of contents file has a name in the form filename_TC_ddmmmyyyy_hhmmss. The TC in the filename identifies it as a table of contents file. If the table of contents file is created in the same SPD Server operation, the timestamp for the backup file and the table of contents file are identical. The table of contents file does not have an SPD Server file extension. Unlike the backup file, the table of contents file is a regular system file and cannot be extended. The table of contents file size is constrained only by the native operating system's file size limit.
The table of contents file contains the following information for each table that is backed up:
  • Columns 1–32 contain the table name. If the file is a domain ACL file, these columns contain the ACL name.
  • Columns 33–232 contain the backup filename.
  • Columns 233–250 contain the last full backup date, using the SAS datetime18. format.
  • Columns 251–258 contain the incremental backup sequence number, since the last full backup. For example, the value 2 indicates that this is the second incremental backup since the last full backup.
  • Columns 259–268 contain the number of rows that were backed up.
  • Column 269 contains F for a full SPD Server backup, or I for an incremental backup.
  • Columns 270–277 contain the number of indexes that were backed up during a full SPD Server backup. This field contains the value 0 if an incremental backup is being performed.
  • Column 278 is a Boolean ACL file indicator. Column 278 contains a T if a domain ACL file is being backed up, or an F if a table is being backed up. If the ACL file indicator is set to T, columns 1–32 are configured for ACL names.
The table of contents file is formatted so that it can be used as a table of contents for a SAS backup file. The table of contents file uses the following SAS format:
format lastfull datetime18.;
 input @1 table $32. @33 bk_file $200.
 @233 lastfull datetime18. @251 inc_seq 8.
 @259 rows 10. @269 bk_type $1.
 @270 num_idx 8.,
 @278 acls $1.; 
After you perform each SPD Server backup, you should append the resulting table of contents file to the table of contents file for the previous backup. This step saves the backup history and will assist you when you restore the tables.
For example, if you want to determine which backup files you need to restore a specific table, you could create the following SQL query, using the date of the last full backup:
select bk_file from foo.bkup_toc
where table = "dset"
and datepart(lastfull) >= 'ddmmmyyyy'd; 
Last updated: February 3, 2017