Examples - Advanced SQL Engine - Teradata Database

Database Utilities

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
ynh1604715438919.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1102
lifecycle
previous
Product Category
Teradata Vantage™

Example: Displaying the Cufconfig help

To display the cufconfig help, type the following:

cufconfig -h

The following appears:

valid options:
-o
   outputs the gdo to the screen.
-i
   initializes the gdo to the defaults.
-f filename
   modifies the gdo fields identified
   in filename. Fields not specified in filename
   will not be set or reset by this tool.

Note that if several options are specified
they are analyzed in the following order:
-i -f -o

If only a few fields need to be set differently than
the defaults, specify the -i option with the -f option.
Use the -o option to verify the settings.

Exiting cufconfig...

Example: Displaying the contents of the UDF GDO

To display the contents of the UDF GDO, type the following:

cufconfig -o
Version: 7
ModTime: 1308613095
SWDistNodeID: 33
SourceDirectoryPath: /etc/opt/teradata/tdconfig/Teradata/tdbs_udf/usr/
CompilerTempDirectory: /var/opt/teradata/tdtemp/UDFTemp/
UDFLibraryPath: /etc/opt/teradata/tdconfig/udflib/
CompilerPath: /usr/bin/gcc
LinkerPath: /usr/bin/ld
UDFServerMemPath: /var/opt/teradata/tdtemp/udfsrv/
MaximumCompilations: 10
UDFServerTasks: 2
SecureServerAMPs: 20
ParallelUserServerAMPs: 2
SecureServerPEs: 20
ParallelUserServerPEs: 2
TDSPLibBase: /etc/opt/teradata/tdconfig/tdsplib/
UDFLibPath:
UDFIncPath:
UDFEnvFile:
CLILibPath: /opt/teradata/client/14.00/lib64
CLIIncPath: /opt/teradata/client/14.00/include
CLIEnvFile:
JavaLibraryPath: /etc/opt/teradata/tdconfig/jarlib/
JREPath: /opt/teradata/jvm64/jre8/jre/
JavaLogPath: /tmp/
JavaEnvFile:
JavaServerTasks: 2
JavaHybridThreads: 20
JavaVersion: 0x10004
JavaBaseDebugPort: 0
JSVServerMemPath: /var/opt/teradata/tdtemp/jsvsrv/
MallocLimit: 33554432
GLOPLockTimeout: 130
GLOPLockWait: 120
MaximumGLOPSize: 256
MaximumGLOPMem: 2560
MaximumGLOPPages: 8
GLOPMapMemPath: /var/opt/teradata/tdtemp/udfglopdata/
CServerMemSize: 262144
JavaHybridServerMemSize: 262144
HybridServer1Execution: /usr/tdbms/bin/udfsas
HybridServer1Library: /usr/tdbms/lib/libudf3.so
HybridServer1LibPath:
HybridServer1IncPath:
HybridServer1EnvFile:
HybridServer1MemSize: 262144
HybridServer1Threads: 20
HybridServer1Language (display only): SAS
HybridServer1AppCat (display only): 6
HybridServer2Execution:
HybridServer2Library:
HybridServer2LibPath:
HybridServer2IncPath:
HybridServer2EnvFile:
HybridServer2MemSize: 262144
HybridServer2Threads: 0
HybridServer2Language (display only):
HybridServer2AppCat (display only): 7
HybridServer3Execution: /usr/tdbms/bin/udfsectsk
HybridServer3Library:
HybridServer3LibPath:
HybridServer3IncPath:
HybridServer3EnvFile:
HybridServer3MemSize: 262144
HybridServer3Threads: 20
HybridServer3Language (display only): EAH
HybridServer3AppCat (display only): 8
HybridServer3FreeSpace: 0
HybridServer3MemFileSize: 0
HybridServer3JREPath: /opt/teradata/jvm64/jre8/jre/
HybridServer3JVMOptions:
HybridServer4Execution:
HybridServer4Library:
HybridServer4LibPath:
HybridServer4IncPath:
HybridServer4EnvFile:
HybridServer4MemSize: 262144
HybridServer4Threads: 0
HybridServer4Language (display only):
HybridServer4AppCat (display only): 9
HybridServer5Execution:
HybridServer5Library:
HybridServer5LibPath:
HybridServer5IncPath:
HybridServer5EnvFile:
HybridServer5MemSize: 262144
HybridServer5Threads: 0
HybridServer5Language (display only):
HybridServer5AppCat (display only): 10
HybridServer6Execution:
HybridServer6Library:
HybridServer6LibPath:
HybridServer6IncPath:
HybridServer6EnvFile:
HybridServer6MemSize: 262144
HybridServer6Threads: 0
HybridServer6Language (display only):
HybridServer6AppCat (display only): 11
HybridServer7Execution:
HybridServer7Library:
HybridServer7LibPath:
HybridServer7IncPath:
HybridServer7EnvFile:
HybridServer7MemSize: 262144
HybridServer7Threads: 0
HybridServer7Language (display only):
HybridServer7AppCat (display only): 12
HybridServer8Execution:
HybridServer8Library:
HybridServer8LibPath:
HybridServer8IncPath:
HybridServer8EnvFile:
HybridServer8MemSize: 262144
HybridServer8Threads: 0
HybridServer8Language (display only):
HybridServer8AppCat (display only): 13
HybridServer9Execution:
HybridServer9Library:
HybridServer9LibPath:
HybridServer9IncPath:
HybridServer9EnvFile:
HybridServer9MemSize: 262144
HybridServer9Threads: 0
HybridServer9Language (display only):
HybridServer9AppCat (display only): 14
CStdUDFServerTimeout: 2
JStdUDFServerTimeout: 5
JHybUDFServerTimeout: 10
USRLibraryPath: /usr/tdbms/lib
GPLUDFServerMemSize: 33554432
ScriptMemLimit: 33554432
JVMOptions:

Example: Modifying fields of the UDF GDO

Before you begin, make sure your computer has a minimum of 256 KB of free disk space to run the protected or secure mode server process. Each server process requires 256 KB of space.

Do the following steps to modify the fields of the UDF GDO:

  1. Open a new text file, or open an existing UDF configuration file.
  2. In a text editor, type the fields and field values you want to modify. For example:
    UDFServerTasks:10
    ParallelUserServerAMPs:4
    ParallelUserServerPEs:4
    UDFEnvFile: /home/sally/config/udf/UDFEnvFile.txt
    CLILibPath: /opt/teradata/client/14.00/lib64
    CLIIncPath: /opt/teradata/client/14.00/include
    CLIEnvFile: /home/sally/config/CLI/CLIEnvFile.txt
    JavaBaseDebugPort: 8000
    JavaLogPath: /tmp/
    JavaEnvFile: /home/sally/config/jvm/jvmenv.txt
    JavaServerTasks: 10
    The field names are case sensitive and must follow the same format as the output from the -o option. The UDF configuration file should contain only the fields you want to modify, with each field on a separate line as shown above.
  3. Save the UDF configuration file as a text file. For example, save the file as:
  4. Use the -f option to modify the UDF GDO with the field values specified in the UDF configuration file, and use the -o option to display the updated contents of the UDF GDO.

    Using the UDF GDO contents in Example: Displaying the contents of the UDF GDO if you apply the field changes from this example, the new output of the UDF GDO would be the following:

    Version: 6
    ModTime: 1206484172
    SWDistNodeID: 33
    SourceDirectoryPath: /etc/opt/teradata/tdconfig/Teradata/tdbs_udf/usr/
    CompilerTempDirectory: /var/opt/teradata/tdtemp/UDFTemp/
    UDFLibraryPath: /etc/opt/teradata/tdconfig/udflib/
    CompilerPath: /usr/bin/gcc
    LinkerPath: /usr/bin/ld
    UDFServerMemPath: /var/opt/teradata/tdtemp/udfsrv/
    MaximumCompilations: 10
    UDFServerTasks: 10
    SecureServerAMPs: 20
    ParallelUserServerAMPs: 4
    SecureServerPEs: 20
    ParallelUserServerPEs: 4
    TDSPLibBase: /etc/opt/teradata/tdconfig/tdsplib/
    UDFLibPath:
    UDFIncPath:
    UDFEnvFile: /home/sally/config/udf/UDFEnvFile.txt
    CLILibPath: /opt/teradata/client/14.00/lib64
    CLIIncPath: /opt/teradata/client/14.00/include
    CLIEnvFile: /home/sally/config/CLI/CLIEnvFile.txt
    JavaLibraryPath: /etc/opt/teradata/tdconfig/jarlib/
    JREPath: /opt/teradata/jvm64/jre8/jre/
    JavaLogPath: /tmp/
    JavaEnvFile: /home/sally/config/jvm/jvmenv.txt
    JavaServerTasks: 10
    JavaHybridThreads: 20
    JavaVersion: 0x10004
    JavaBaseDebugPort: 8000
    JSVServerMemPath: /var/opt/teradata/tdtemp/jsvsrv/
    MallocLimit: 33554432
    GLOPLockTimeout: 130
    GLOPLockWait: 120
    MaximumGLOPSize: 256
    MaximumGLOPMem: 2560
    MaximumGLOPPages: 8
    GLOPMapMemPath: /var/opt/teradata/tdtemp/udfglopdata/

    ... and so forth.

Example: Using a JavaEnvFile environment file

This example illustrates a use of the JavaEnvFile environment file. By default, a DBS Java external stored procedure uses the tdgssconfig.jar file located in the TDBMS\bin directory when connecting to the DBS session. To have the DBS use nondefault values for the tdgssconfig.jar file, copy, modify, and place the file in the tdconfig directory on each node. Then create a JavaEnvFile to configure the JVM to use the copy of the tdgssconfig.jar file.

When modifying the tdgssconfig.jar file, make a copy of it. The file may be overwritten when the DBS package is re-installed.
-Djava.class.path=/usr/tdbms/bin/javFnc.jar;/usr/tdbms/bin/terajdbc4.jar;/usr/tdbms/bin/tdgssjava.jar;/etc/opt/teradata/tdconfig/tdgssconfig.jar;

This configures the JVM to use the standard javFnc.jar, terajdbc4.jar, and tdgssjava.jar files, but use the alternate tdgssconfig.jar file.

For more information about the Teradata JDBC driver, see Teradata JDBC Driver Reference, available at https://teradata-docs.s3.amazonaws.com/doc/connectivity/jdbc/reference/current/frameset.html .

For more information about the javFnc.jar file, see Teradata Vantage™ - SQL External Routine Programming , B035-1147 .