3.9.1 Specification format and rules for the CREATE SERVER statement
Define a foreign server.
- Organization of this subsection
(1) Specification format
CREATE SERVER-statement ::= CREATE SERVER foreign-server-name
[OPTIONS (foreign-server-option [,foreign-server-option]...)]
foreign-server-option ::= {ACCESS_KEY access-key-string
|SECRET_KEY secret-key-string
|ENDPOINT endpoint-string}
access-key-string ::= character-string-literal
secret-key-string ::= character-string-literal
endpoint-string ::= character-string-literal
(2) Explanation of specification format
- ● foreign-server-name
-
Specifies the name of the foreign server to be defined. You cannot specify a foreign server name that is being used.
For rules for specifying foreign server names, see (2) Rules for characters that can be used in names in 6.1.4 Specifying names.
- ● foreign-server-option
-
foreign-server-option ::= {ACCESS_KEY access-key-string |SECRET_KEY secret-key-string |ENDPOINT endpoint-string}The foreign server option specifies the information required to access the foreign server.
The rules for specifying the foreign server option is as follows:
-
The same option cannot be specified, such as specifying the ACCESS_KEY option twice.
-
Both ACCESS_KEY and SECRET_KEY options must be specified, or both must be omitted.
- ACCESS_KEY access-key-string
-
Specifies the access key to be used for foreign server authentication. Up to 100 bytes of character string data can be specified for the access key string.
- SECRET_KEY secret-key-string
-
Specifies the secret key to be used for foreign server authentication. Up to 100 bytes of character string data can be specified for the secret key string.
- ENDPOINT endpoint-string
-
When accessing a foreign server using an endpoint, specify the endpoint in URI format in the endpoint string. Up to 100 bytes of character string data can be specified for the endpoint string.
For the endpoint string, specify a string beginning with "http://" or "https://". For example, if the endpoint is "https://XXXX:1234", the endpoint string is specified as "'https://XXXX:1234'".
- Important
-
If you omit the ACCESS_KEY and SECRET_KEY options in the AWS environment, you will need to configure authentication information using IAM roles or an authentication information file. For details, see How to define a foreign server in the manual HADB Setup and Operation Guide.
-
(3) Privileges required at execution
To execute the CREATE SERVER statement, the CONNECT privilege and the DBA privilege are required.
(4) Examples
- Examples
-
Define an foreign server (FOREIGNSERVER1).
CREATE SERVER "FOREIGNSERVER1" OPTIONS(ACCESS_KEY '6yTZJwzVjl6nYTjKICop' ,SECRET_KEY 'Bs6E43CgrwXYyX9jvVJpPgH8rOdTafeuVNrwGJf' ,ENDPOINT 'https://xxxx-yyz99:1234')