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 » Adding a tenant database (dbcloudadd)

Cloud Add Database utility (dbcloudadd)

Adds a database to the cloud by making a copy of a database, upgrading, and configuring it for use in the cloud, and then copying it into the cloud.

Use this utility to add databases that are larger than 100 MB and/or have dbspaces; otherwise, use the Cloud Console.

Syntax
dbcloudadd -cc "keyword=value;..." -c "keyword=value;..."  database-file [ options ]
Option Description
@data

Environment variable or configuration file to read options from.

To protect passwords or other information in the configuration file, you can use the File Hiding utility (dbfhide) to encrypt the contents of the configuration file.

-c "UID= database-user-ID ;PWD= database-password [ ;DBN= database-name ] "

Database connection string:

  • UID

    For version 12 and earlier databases, the user ID of a user with DBA authority to connect to the database (required).

    For version 16 databases and later, the user ID of a user with the SYS_AUTH_DBA_ROLE compatibility role or the equivalent role (required).

  • PWD

    Password to connect to the database (required).

  • DBN

    Name for the database in the cloud. This name must be unique among tenant databases and must conform to the tenant database name restrictions. By default, this name is the name of the database file.

-cc "HOST= cloud-host-name[: port-number];UID= cloud-user-ID ;PWD= cloud-password "

Cloud connection string:

  • Host

    Host name or comma-separated list of host names or IP addresses (required).

  • Port

    TCP/IP port number of the host.

  • UID

    User ID to connect to the cloud (required).

  • PWD

    Password to connect to the cloud (required).

Additional connection parameters can be specified.

If you specify ENCRYPTION=TLS, then:

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

  • Disable the host name check by specifying skip_certificate_name_check=ON.
database-file Path and file name of the database being added to cloud (required).
-autostart [ on ] When -autostart on is specified, the database is configured to automatically start when a client attempts to connect ot it.
-autostop_wait_time Only applies when -autostart on is specified. Specify the time in minutes to wait before stopping the database after the last client connection disconnects. Specify 0 to stop the database immediately after the last client disconnects from the database. Specify -1 to never stop the database. The default is 10 minutes.
dbspace_name= dbspace-file

Name of the dbspace and its file name. Can be specified multiple times if the database has multiple dbspaces.

-ek database-encryption-key

Encryption key required to connect to the database.

-server_list candidate-server-search

Limited list of cloud servers taht the database can run on. Use a search query to specify the cloud servers.

The -upgrade_to_version parameter takes precedence over this parameter.

-system_procedure_as_definer { on | off } This option applies when you are upgrading to a version 16 or later database. Specify on to have system procedures in the database execute with the privileges of their owner (definer). Specify off to have them execute with the privileges of the invoker. By default, the system procedures retain the same invoker/definer setting as the original database.
-upgrade_to_version { 12 | 16 | 17 }

This option is required to upgrade the database to version 12 or later. The database is added to a cloud server of the same version of the upgraded database. The default is 17.

The -server_list parameter can restrict the cloud server version that the database gets added to; however, the -upgrade_to_version parameter takes precedence.

Prerequisites
  • You must have access to the database files.

  • The database cannot be running.

  • The database cannot have mirror transaction logs.

  • The user ID and password for a database user:

    • For version 12 and earlier databases, the user must have DBA authority.

    • For version 16 and later databases, the user must have equivalent of the SYS_AUTH_DBA_ROLE compatibility role.

  • The cloud user ID must have the AddDatabase privilege.

Remarks
  • Host connection string

    The host connection string is used to connect to the cloud. Omit the TCP/IP port number for the host or hosts if the cloud server uses the default TCP/IP port.

  • Database connection string

    The database connection string is used to connect to the database and prepare the database for use by the cloud.

    The user ID of the user that you specify is stored in the cloud; the password is discarded after the database is added. The cloud uses this user ID to connect to the database to perform administrative tasks, such as backups.

    If you specify an incorrect user ID and/or password, run the SpecifyDatabaseUserAndPassword task.

Example

The following command connects to the cloud and adds the SQL Anywhere sample database:

dbcloudadd -cc "HOST=myhost:2638;UID=admin;PWD=admin" -c "UID=DBA;PWD=sql;DBN=Tenant1" 
"C:\Documents and Settings\All
          Users\Documents\SQL Anywhere 17\Samples\demo.db"

The following command connects to the cloud and adds a database with dbspaces:

dbcloudadd -cc "HOST=myhost:2638;UID=admin;PWD=admin" -c "UID=DBA;PWD=sql;DBN=Tenant1" 
"C:\Documents and Settings\All
          Users\Documents\SQL Anywhere 17\Samples\demo.db" 
dbspace_name="C:\Documents and Settings\All
          Users\Documents\SQL Anywhere 17\Samples\dbspace1.dbs"

The following command adds a database to either server Red#1 or server Orange#2:

dbcloudadd -cc "HOST=myhost:2638:UID=admin;PWD=admin" -c "UID=DBA;PWD=sql;DBN=Tenant1" 
"C:\Documents and Settings\All
          Users\Documents\SQL Anywhere 17\Samples\demo.db"  
-server_list "Red#1;Orange#2"

The following command adds a database to a host that has a tag named EMEA:

dbcloudadd -cc "HOST=myhost:2638:UID=admin;PWD=admin" -c "UID=DBA;PWD=sql;DBN=Tenant1" 
"C:\Documents and Settings\All
          Users\Documents\SQL Anywhere 17\Samples\demo.db" 
-server_list "host:tag:EMEA"