SPDO Procedure

Example 4: Using PROC SPDO to Back Up and Restore Tables

Features:

SPDSCMD statement with SPDSBKUP and SPDSRSTR commands

Details

This example shows how to execute the server backup and restore utilities, spdsbkup and spdsrstr, via the PROC SPDO SPDSCMD statement. In order to issue the SPDSCMD statement, you must have special privilege in the password database.
When you execute commands using the PROC SPDO SPDSCMD statement, the current working directory is the root directory of the server. Messages generated by the commands are echoed to the SAS log. In this example, the incremental backup and restore utilities reside in the SPD Server directory. The incremental backup and restore files are saved in the server directory /spdsadm/bkup.
Note: There is a limitation when you use the -AFORCE option with PROC SPDO to restore data on Windows. The -AFORCE option fails if ACLs exist and there are active connections to the domain that were specified by using the -D option during the restore process. ACLSPECIAL= connections to a libref must specify a domain that is separate from the domain in which you are attempting to restore the ACLs (if the ACLs currently exist). If you make ACLSPECIAL= libref connections that specify the domain in which you are attempting to restore the ACLs, then the ACL restore operation fails.
Issue a LIBNAME statement that specifies special privilege.This example creates the libref Backup for the domain Test on the host machine Sunny. The port number of the name server is 5150. The connection specifies the Admin user ID and password.
libname backup sasspds 'test'
host='sunny'
serv='5150'
user='admin'
passwd='admin'
ACLSPECIAL=YES;
Invoke PROC SPDO for the libref and specify the SPDSBKUP command in the SPDSCMD statement.The following code performs a full SPD Server backup of the domain Tstdomn. The backup is made on February 3, 2016. The command creates the backup file /spdsadm/bkup/test_BK_03Feb2016_233000.0.0.spds9 and the table of contents file /spdsadm/bkup/test_TC_03Feb2016_233000.
proc spdo lib=backup;
spdscmd 'spdsbkup -a -full -d tstdomn -h sunny -s 5150 -f /spdsadm/bkup/test';
To restore SPD Server from a backup, invoke PROC SPDO and specify the SPDSRSTR command in the SPDSCMD statement.The restore utility restores the domain to its last full backup state.
spdscmd 'spdsrstr -aforce -d tstdomn -h sunny -s 5150 -e /spdsadm/bkup/test';
Last updated: February 3, 2017