SQL Reference

CREATE SERVER

The CREATE SERVER statement 73 defines a data source to a federated database.

Invocation

This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).

Authorization

The authorization ID of the statement must have SYSADM or DBADM authority on the federated database.

Syntax

>>-CREATE SERVER--server-name----+--------------------+--------->
                                 '-TYPE--server-type--'
 
>-----+------------------------------+---WRAPPER--wrapper-name-->
      '-VERSION--| server-version |--'
 
>-----+----------------------------------------------------------------------+>
      '-AUTHORIZATION--remote-authorization-name----+---------------------+--'
                                                    '-PASSWORD--password--'
 
                  .-,-------------------------------------------------.
                  V  .-ADD--.                                         |
>-----OPTIONS--(-----+------+---server-option-name--string-constant---+---)->
 
>--------------------------------------------------------------><
 
server-version
 
|---+-version--+--------------------------+-+-------------------|
    |          '-.--release--+---------+--' |
    |                        '-.--mod--'    |
    '-version-string-constant---------------'
 

Description

server-name
Names the data source that is being defined to the federated database. The name must not identify a data source that is described in the catalog. The server-name must not be the same as the name of any table space in the federated database.

TYPE server-type
Specifies the type of the data source denoted by server-name. This option is required with the DRDA, SQLNET, and NET8 wrappers. Refer to Appendix F, Federated Systems for a list of supported data source types.

VERSION
Specifies the version of the data source denoted by server-name.

version
Specifies the version number. version must be an integer.

release
Specifies the number of the release of the version denoted by version. release must be an integer.

mod
Specifies the number of the modification of the release denoted by release. mod must be an integer.

version-string-constant
Specifies the complete designation of the version. The version-string-constant can be a single value (for example, '8i'); or it can be the concatenated values of version, release, and, if applicable, mod (for example, '8.0.3').

WRAPPER wrapper-name
Names the wrapper that the federated server uses to interact with data sources of the type and version denoted by server-type and 'server-version'.

AUTHORIZATION remote-authorization-name
Specifies the authorization ID under which any necessary actions are performed at the data source when the CREATE SERVER statement is processed. This ID must hold the authority (BINDADD or its equivalent) that the necessary actions require.

PASSWORD password
Specifies the password associated with the authorization ID represented by remote-authorization-name. If password is not specified, it will default to the password for the ID under which the user is connected to the federated database.

OPTIONS
Indicates what server options are to be enabled. Refer to Server Options for descriptions of server-option-names and their settings.

ADD
Enables one or more server options.

server-option-name
Names a server option that will be used to either configure or provide information about the data source denoted by server-name.

string-constant
Specifies the setting for server-option-name as a character string constant.

Notes

Examples

Example 1:  Define a DB2 for MVS/ESA 4.1 data source that is accessible through a wrapper called DB2WRAP. Call the data source CRANDALL. In addition, specify that:

   CREATE SERVER CRANDALL
      TYPE DB2/MVS
      VERSION 4.1
      WRAPPER DB2WRAP
      AUTHORIZATION MURROW
      PASSWORD DROWSSAP
      OPTIONS
          ( NODE 'MYNODE',
          DBNAME 'MYDB',
          FOLD_ID 'U',
          FOLD_PW 'U',
          COLLATING_SEQUENCE 'Y' )

Example 2: Define an Oracle 7.2 data source that's accessible through a wrapper called KLONDIKE. Call the data source CUSTOMERS. Specify that:

Provide these statistics for the optimizer:

   CREATE SERVER CUSTOMERS
      TYPE ORACLE
      VERSION 7.2
      WRAPPER KLONDIKE
      OPTIONS
          ( NODE 'ABC',
          CPU_RATIO '2.0',
          IO_RATIO '1.5' )


Footnotes:

73
In this statement, the term SERVER and the parameter names that start with server- refer only to data sources in a federated system. They do not refer to the federated server in such a system, or to DRDA application servers. For information about federated systems, see DB2 Federated Systems. For information about DRDA application servers, see Distributed Relational Database.


[ Top of Page | Previous Page | Next Page ]