In-Database Deployment Package for Teradata

Prerequisites

SAS Foundation and the SAS/ACCESS Interface to Teradata must be installed before you install and configure the in-database deployment package for Teradata.
Teradata server (database) version 13.00 or higher and client (TTU) version 13.00 are required for in-database products. If you want to use the new SAS Embedded Process to publish your scoring models, you need version 13.10.02.01 or higher and client (TTU) version 13.00 or 13.10.

Overview of the In-Database Deployment Package for Teradata

This section describes how to install and configure the in-database deployment package for Teradata (SAS Formats Library for Teradata 2.1 and SAS Embedded Process 9.31). The in-database deployment packages for Teradata must be installed and configured before you can perform the following tasks:
  • Use the %INDTD_PUBLISH_FORMATS format publishing macro to publish the SAS_PUT( ) function and to publish user-defined formats as format functions inside the database.
  • Use the %INDTD_PUBLISH_MODEL scoring publishing macro to publish scoring model files or functions inside the database.
The format and scoring publishing macros are included in SAS/ACCESS Interface to Teradata. For more information about using the format and scoring publishing macros, see the SAS In-Database Products: User's Guide.
The in-database deployment package for Teradata includes the SAS formats library and starting in November 2011, the SAS Embedded Process.
The SAS formats library is a run-time library that is installed on your Teradata system. This installation is done so that the SAS scoring model functions or the SAS_PUT( ) function can access the routines within the run-time library. The SAS formats library contains the formats that are supplied by SAS.
The SAS Embedded Process is a SAS server process that runs within Teradata to read and write data. The SAS Embedded Process contains macros, run-time libraries, and other software that is installed on your Teradata system. These installations are done so that the SAS scoring files created in Teradata can access to routines within its run-time libraries.
Note: If you are performing a system expansion where additional nodes are being added, the version of the SAS formats library and the SAS Embedded Process on the new database nodes must be the same as the version that is being used on already existing nodes.
Note: In addition to the in-database deployment package for Teradata, a set of SAS Embedded Process functions must be installed in the Teradata database. The SAS Embedded Process functions package is downloadable from Teradata.For more information, see Installing the SAS Embedded Process Support Functions.

Teradata Installation and Configuration Steps

  1. If you are upgrading from or reinstalling a previous version, follow the instructions in Upgrading from or Reinstalling a Previous Version.
  2. Install the in-database deployment package.
  3. Install the SAS Embedded Process support functions.
  4. If you plan to use SAS Model Manager with the SAS Scoring Accelerator for in-database scoring, perform the additional configuration tasks provided in Configurations for SAS Model Manager.

Upgrading from or Reinstalling a Previous Version

To upgrade from or reinstall a previous version of the SAS Formats Library, the SAS Embedded Process, or both, follow these steps.
  1. Check the current installed version of the SAS formats library.
    How you do this depends on the version of the SAS formats library.
    • If a SAS 9.2 version of the formats library is currently installed, run this command:
      psh "rpm -q -a" | grep jazxfbrs
      If a previous version is installed, a result similar to this is displayed. The version number might be different.
      jazxfbrs-9.2-1.9
    • If a SAS 9.3 version of the formats library is currently installed, run this command:
      psh "rpm -q -a" | grep acc
      If a previous version is installed, a result similar to this is displayed. The version number might be different.
      accelterafmt-2.1-1
    If the library is not installed on the Teradata nodes, no output is displayed. You can continue with the installation steps in Installing the SAS Formats Library and the SAS Embedded Process.
  2. Run this command to check the current installed version of the SAS Embedded Process.
    psh "rpm -qa | grep tkindbsrv"
    If a previous version is installed, a result similar to this is displayed. The version number might be different.
    tkindbsrv-9.31-1
    If the SAS Embedded Process is not installed on the Teradata nodes, no output is displayed. You can continue with the installation steps in Installing the SAS Formats Library and the SAS Embedded Process.
  3. If a version of the SAS formats library, the SAS Embedded Process, or both is being installed that has a name that is different from the library that was previously installed, then follow these steps. An example would be accelterafmt-2.1-1 replacing jazxfbrs-9.2-1.6 or tkindbsrv-9.31-2 replacing tkindbsrv-9.31-1.
    1. If you are upgrading from or reinstalling the SAS Formats Library, shut down the Teradata database.
      tpareset -y -x shutdown_comment
      This step is required because an older version of the SAS formats library might be loaded in a currently running SAS query.
      Note: If you are upgrading or reinstalling only the SAS Embedded Process (tkindbsrv.rpm file), you do not need to shut down the database. You do need to shutdown the SAS Embedded Process. For more information, see Controlling the SAS Embedded Process.
    2. Confirm that the database is shut down.
      pdestate -a
      DOWN/HARDSTOP is displayed if the database is shut down.
    3. Remove the old version before you install the updated version of the in-database deployment package.
      • To remove the package from all nodes concurrently, run this command:
        psh "rpm -e package-name"
        package-name is either jazxfbrs.9.version, accelterafmt-2.version, or tkindbsrv-9.31-version.
        For example, to remove jazxfbrs, run the command psh "rpm —e jazxfbrs-9.2–1.6".
      • To remove the package from each node, run this command on each node:
        rpm -e package-name
        package-name is either jazxfbrs.9.version, accelterafmt-2.version, or tkindbsrv-9.31-version.
  4. (Optional) To confirm removal of the package before installing the new package, run this command on all nodes:
    psh "rpm -q package-name"
    package-name is either jazxfbrs.9.version, accelterafmt-2.version, or tkindbsrv-9.31-version.
    The SAS Formats Library or the SAS Embedded Process should not appear on any node.

Installing the SAS Formats Library and the SAS Embedded Process

Moving the SAS Formats Library and the SAS Embedded Process Packages to the Server Machine

  1. Locate the in-database deployment package files, accelterafmt-2.1-n.x86_64.rpm and tkindbsrv-9.31-n.x86_64.rpm. n is a number that indicates the latest version of the file. If this is the initial installation, n has a value of 1. Each time you reinstall or upgrade, n is incremented by 1.
    The accelterafmt-2.1-n.x86_64.rpm file is located in the SAS-install-directory/SASFormatsLibraryforTeradata/2.1/TeradataonLinux/ directory. The tkindbsrv-9.31-n.x86_64.rpm file is located in the SAS-install-directory/SASTKInDatabaseServer/9.31/TeradataonLinux/ directory.
  2. Put the package files on your Teradata database server in a location where it is both read and write accessible.
    The package files must be readable by the Teradata Parallel Upgrade Tool. You need to move this package file to the server machine in accordance with procedures used at your site.
Note: The SAS Embedded Process might require a later release of Teradata than function-based scoring. Please refer to the system requirements documentation.

Installing the SAS Formats Library and the SAS Embedded Process with the Teradata Parallel Upgrade Tool

This installation should be performed by a Teradata systems administrator. The steps assume full knowledge of the Teradata Parallel Upgrade Tool and your environment. For more information about using the Teradata Parallel Upgrade Tool, see the Parallel Upgrade Tool (PUT) Reference Release 3.05.01B035–5713–011K January 2011, located at http://www.info.teradata.com/edownload.cfm?itemid=110550001. On this page, search for “Parallel Upgrade Tool” and download the appropriate document for your system.
The following steps explain the basic steps to install the SAS formats library package by using the Teradata Parallel Upgrade Tool.
Note: The Teradata Parallel Upgrade Tool prompts are subject to change as Teradata enhances its software.
  1. Move the SAS Formats Library and the SAS Embedded Process packages to your server machine where they can be accessed from at least one of the Teradata nodes. For more information, see Moving the SAS Formats Library and the SAS Embedded Process Packages to the Server Machine.
  2. Start the Teradata Parallel Upgrade Tool.
  3. Be sure to select all Teradata TPA nodes for installation, including Hot Stand-By nodes.
  4. If Teradata Version Migration and Fallback (VM&F) is installed, you might be prompted whether to use VM&F or not. If you are prompted, choose a Non-VM&F installation.
  5. If the install is successful, accelterfmt-2.1-n or tkindbsrv-9.31-n is displayed. n is a number that indicates the latest version of the file. If this is the initial installation, n has a value of 1. Each time you reinstall or upgrade, n is incremented by 1.
    Alternatively, you can manually verify that the install is successful by running these commands from the shell prompt.
    psh "rpm -q -a" | grep accelterafmt
    psh "rpm -q -a" | grep tkindbsrv
  6. (Optional) Start the server so that all database processes can load the new version of the library and the SAS Embedded Process.
    /etc/init.d/tpa start
    Note: If you are upgrading from or reinstalling a previous version of the SAS Formats Library for Teradata, the database was shut down in preparation for this procedure, and no other database maintenance needs to be performed at this time, you should start the database.

Installing the SAS Embedded Process Support Functions

The SAS Embedded Process support function package includes stored procedures that generate SQL to interface with the SAS Embedded Process and functions that load the SAS program and other run-time control information into shared memory. The SAS Embedded Process support functions setup script creates the SAS_SYSFNLIB database and the SAS Embedded Process interface fast path functions in TD_SYSFNLIB.
The SAS Embedded Process support function package is available on the Teradata Web site. For access to the package, contact your local Teradata account representative.

Controlling the SAS Embedded Process

The SAS Embedded Process starts when a query is submitted. The SAS Embedded Process continues to run until it is manually stopped or the database is shutdown. You might want to disable or shutdown the SAS Embedded Process without shutting down the database.
The following commands control the SAS Embedded Process.
Command
Action performed
CALL DBCEXTENSION.SERVER CONTROL ('STATUS', :A);
Provides the status of the SAS Embedded Process.
CALL DBCEXTENSION.SERVER CONTROL ('SHUTDOWN', :A);
Shuts down the SAS Embedded Process.
Note: You cannot shutdown until all queries are complete.
CALL DBCEXTENSION.SERVER CONTROL ('DISABLE', :A);
Stops new queries from being started. Queries that are currently running continue to run until they are complete.
CALL DBCEXTENSION.SERVER CONTROL ('ENABLE', :A);
Enables new queries to start running.

Teradata Permissions

Because functions are associated with a database, the functions inherit the access rights of that database. It might be useful to create a separate shared database for the SAS scoring functions or the SAS_PUT( ) function so that access rights can be customized as needed.
You must grant the following permissions to any user who runs the scoring or format publishing macros:
CREATE FUNCTION ON database TO userid
DROP FUNCTION ON database TO userid
EXECUTE FUNCTION ON database TO userid
ALTER FUNCTION ON database TO userid
If you use the SAS Embedded Process to run your scoring model, you must grant the following permissions:
EXECUTE PROCEDURE ON SAS_SYSFNLIB TO userid
EXECUTE FUNCTION ON SAS_SYSFNLIB TO userid
EXECUTE FUNCTION ON SAS_SYSLIB.MonitorVirtualConfig TO userid
Note: If you plan to use SAS Model Manager with the SAS Scoring Accelerator for in-database scoring, additional permissions are required. For more information, see Configurations for SAS Model Manager.

Documentation for Publishing SAS Scoring Models and Formats in Teradata

For information about how to publish SAS formats and scoring models, see the SAS In-Database Products: User's Guide located at http://support.sas.com/documentation/onlinedoc/indbtech/index.html.