Registering the server definitions for an ODBC data source

You must register each ODBC server that you want to access in the federated database.

Procedure

  1. Issue the CREATE SERVER statement from the command line and specify the required server options.
    For example:
    CREATE SERVER server_definition_name TYPE data_source_type 
        VERSION version_number WRAPPER wrapper_name 
        OPTIONS (NODE 'node_name', CODEPAGE 'codepage_name', 
        DBNAME 'database_name');
    CREATE SERVER server_definition_name TYPE data_source_type 
        VERSION version_number WRAPPER wrapper_name 
        OPTIONS (HOST 'ip_address', PORT 'port_number', 
        CODEPAGE 'codepage_name', DBNAME 'database_name');
    Although NODE, HOST, CODEPAGE, and DBNAME are server options in the CREATE SERVER statement, they are required for ODBC data sources:
    • The NODE server option must be set to the data source specified on the DATASOURCE keyword in the cac.ini file.
      Example
      If the cac.ini file specifies DATASOURCE = CACSAMP tcp/150.45.37.49/5000, then the NODE option should be set to CACSAMP.
    • The HOST server option must be set to the data source IP address. If NODE option is specified, then HOST option can be ignored, otherwise, HOST option is required.
      Example
      If the remote data source is HIVE server, the IP address is 9.181.139.59(svt1.cn.ibm.com), then the HOST option should be set to ‘9.181.139.59’ or ‘svt1.cn.ibm.com’.
    • The CODEPAGE server option must be set to the code page number of the client code page specified in the cac.ini file. The client code page is the code page of the data source.
      Example
      If the cac.ini file specifies CLIENT CODEPAGE = IBM-850, then the CODEPAGE option should be set to 850.
    • The DBNAME server option must be set to the name of the data source database that you want to access.
      Example
      If the ODBC data source name is venice, then the DBNAME option should be set to venice.
  2. After the server definition is created, use the ALTER SERVER statement to add or drop server options.

What to do next

After you complete this task, you can create a user mapping.