CREATE SERVER statement - Examples for the Teradata wrapper

Use the CREATE SERVER statement to register server definitions for the Teradata wrapper. This topic includes a complete example with the required parameters, and an example with additional server options.

The following example shows you how to register a server definition for a Teradata wrapper by issuing the CREATE SERVER statement:
CREATE SERVER tera_server TYPE TERADATA 
     VERSION 2.5 WRAPPER my_wrapper
     OPTIONS (NODE 'tera_node');
tera_server
A name that you assign to the Teradata database server. Duplicate server definition names are not allowed.
TYPE TERADATA
Specifies the type of data source server to which you are configuring access. For the Teradata wrapper, the server type must be TERADATA.
VERSION 2.5
The version of the Teradata database server that you want to access.
WRAPPER TERADATA
The wrapper name that you specified in the CREATE WRAPPER statement.
NODE 'tera_node'
The name of the node where the Teradata database server resides. Obtain the node name from the hosts file. This value is case sensitive.

Although the name of the node is specified as an option in the CREATE SERVER statement, it is required for Teradata data sources.

Server options

When you create a server definition, you can specify additional server options in the CREATE SERVER statement. The server options can be general server options and Teradata-specific server options.

The CPU_RATIO and IO_RATIO server options provide the statistical information about the Teradata server to the query optimizer. To specify that the CPU resources of the federated server are twice as powerful as the CPU resources of the Teradata server, set the value of the CPU_RATIO server option to 2.0. To specify that the I/O devices of the federated server process data three times faster than the I/O devices of the Teradata server, set the IO_RATIO server option to 3.0.

The following example shows a Teradata server definition with these options:
CREATE SERVER tera_server TYPE TERADATA 
     VERSION 2.5 WRAPPER my_wrapper
     OPTIONS (NODE 'tera_node', CPU_RATIO '2.0', IO_RATIO '3.0');