Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP SQL Anywhere, on-demand edition 1.0 SP 6 » Tenant databases » Connections to tenant databases » Database connection parameters and strings

Connection parameters to use when connecting to a tenant database in the cloud

Specify at minimum the following connection parameters:

Connection parameter Description
HOST

(Required) One or more host names (or IP addresses) and port numbers (if not the default TCP/IP 2638) of any cloud servers using fixed ports running in the cloud. For example, to connect using TCP/IP specify the following: myhost:49152.

DBN (Required) The name of the database in the cloud. For example, DBN=tenant1.
UID (Required) The user ID used to log in to the database.
PWD (Required) The password for the user ID specified by the UID connection parameter.

Additional connection parameters, such as those listed in the table below, can be specified.

Connection parameter Description
NodeType

By default, when you connect to a database in the cloud, the NodeType (NODE) connection parameter is set to PRIMARY. So, when you connect to a database in the cloud, the connection is redirected to the Primary database. To change this connection redirection behavior, set the NodeType connection parameter to one of the following values:

  • PRIMARY

    Default. Redirects the application to the tenant's primary database.

  • MIRROR

    Redirects the application to the tenant's mirror database.

  • COPY

    Redirects the application to a scale-out database copy of the database.

  • READONLY

    Redirects the application to any database copy: either a scale-out database copy or the mirror copy. If there are no scale-out database copies, READONLY is equivalent to the MIRROR setting. If there are only scale-out database copies, READONLY is equivalent to the COPY setting.

  • DIRECT

    Connection redirection does not apply. The connection succeeds only if the database is running on the host specified. When the NodeType connection parameter is set to DIRECT, you can specify the ServerName connection parameter. Otherwise, you cannot use the Server Name connection parameter.

    Caution

    Do not set NodeType to DIRECT. Following this recommendation allows the database to be moved to a different cloud server or host without affecting the connection to your application.

ENCRYPTION

If you specify ENCRYPTION=TLS then,

  • You must specify the TRUSTED_CERTIFICATES protocol option when you are connecting from a non-cloud host.

  • You must disable the host name check by specifying skip_certificate_name_check=ON.

Example

  • The primary and mirror servers are located in Waterloo, Ontario. Clients running in Japan may want to set up a group of copy nodes in Japan to reduce connection latency. If a branch of copy nodes in Japan was a direct child of the root node, then other children could be added beneath the copy node in Japan. Clients would connect to the hub and specify NodeType=COPY. Japanese local, read-only connections would then be load-balanced among the local database servers, and no client would ever connect to database servers elsewhere. If a client needed to make changes to the database, they would change their connection string to use NodeType=PRIMARY.

  • To connect to the read-write database named joey running in a cloud database configuration, where kangaroo1 and kangaroo2 are two hosts running cloud servers, you could use the following connection parameters:

    UID=rick;PWD=secret;DBN=joey;Host=kangaroo1,kangaroo2
  • To connect to any read-only database named joey running in a cloud database configuration, where kangaroo1 and kangaroo2 are two hosts running cloud servers, you could use the following connection parameters:

    UID=rick;PWD=secret;DBN=joey;Host=kangaroo1,kangaroo2;NodeType=READONLY