To call the Teradata PT from an XSP, configure the Teradata Database’s environment to register the necessary Teradata PT libraries. Depending on the operating system that the Teradata Database is running on, this may involve relocating specific Teradata PT libraries as well as setting runtime environment variables using the Cufconfig utility. For more information on using the Cufconfig utility, see Utilities (B035-1102).
Configuring the Teradata Database on Linux
Before using the CREATE PROCEDURE SQL statement to create a Teradata PT XSP, the following libraries from the Teradata PT package must be moved into the /usr/tdbms/lib directory:
- libtelapi.so
- libpxicu.so
If the default Teradata PT installation is used, these libraries can be found in the /opt/teradata/client/16.20/lib64 directory.
After using the CREATE PROCEDURE SQL statement to create a Teradata PT XSP, configure the Teradata Database’s environment to allow the XSP to run. If it is possible to restart the Teradata Database, use the Cufconfig utility to set the CLIEnvFile variable to register a file with the following environment variable settings:
COPERR=/usr/lib64 COPLIB=/usr/lib64
Add the location of the dynamic library containing the user created XSP to the LD_LIBRARY_PATH in the environment variable settings file. After setting the CLIEnvFile variable using the Cufconfig utility, the Teradata Database must be restarted to allow the database to register the new runtime environment settings.
If it is not possible to restart the Teradata Database, move the following Teradata PT libraries into the /usr/tdbms/lib directory:
- libopcommon.so
- libexportop.so (If using the Export driver)
- libloadop.so (If using the Load driver)
- libstreamop.so (If using the Stream driver)
- libupdateop.so (If using the Update driver)
If the default Teradata PT installation is used, these libraries can be found in the following directory:
/opt/teradata/client/tbuild/16.20/lib64
Move the opermsgs.cat message catalog into the / (root) directory. If the default Teradata PT installation is used, find this catalog in the following directory:
/opt/teradata/client/tbuild/16.20/msgLastly, place the dynamic library containing the user created XSP in the /usr/tdbms/lib directory.