Use PROC SPDO to Back Up and Restore SPD Server Tables

You can use the SAS PROC SPDO spdscmd command to run the SPD Server backup and restore utilities. In order to use this command, you must submit the command using an SPD Server LIBNAME that has special privileges. Backup and restore utilities require privileged access. To grant special privileges, you must specify the LIBNAME option ACLSPECIAL=YES.
When you execute commands using the PROC SPDO spdscmd command, the current working directory is the root directory of SPD Server. Messages generated by the commands are echoed to the SAS log. In the next example, the SPD Server 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.
Use the following steps to use PROC SPDO to execute SPD Server backup and restore utilities:
  1. Create an SPD Server LIBNAME, and specify special privileges.
    LIBNAME backup sasspds 'test'
     host='sunny'
     serv='5150'
     user='admin'
     passwd='admin'
     ACLSPECIAL=YES; 
    This example creates the LIBNAME backup for the domain test on the host machine sunny. The port number of the name server is 5150, and admin is the SPD Server user ID and password.
  2. Invoke PROC SPDO for the LIBNAME:
    PROC SPDO lib=backup;
  3. Use PROC SPDO remote system commands to issue backup and restore statements on the server. The following example performs a full SPD Server backup of the domain tstdomn at 23:30 on February 3, 2008.
    spdscmd 'spdsbkup -a -full -d tstdomn -h sunny -s 5150 -f /spdsadm/bkup/test';
    The example statement creates the backup file /spdsadm/bkup/test_BK_03Feb2008_233000.0.0.spds and the table of contents file /spdsadm/bkup/test_TC_03Feb2008_233000 on the server.
  4. If a later restore operation is necessary, run the SPD Server restore utility to restore the domain to its last full backup state:
    spdscmd 'spdsrstr -aforce -d tstdomn -h sunny -s 5150 -e /spdsadm/bkup/test