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 » Task syntax

LoadBalanceDatabases task

Moves databases to balance the load of the cloud.

Syntax 1 (SQL)
CALL DBCloud.LoadBalanceDatabases ( databasecopy_list=databasecopy_list, server_list=server_list )
Syntax 2 (Cloud Command utility)
dbcloudcmd run LoadBalanceDatabases databasecopy_list server_list
Parameters
  • databasecopy_list

    A list of database copies to be considered for load balancing. Accepts a search query that identifies database copies, for example a list of database copy names or IDs separated by semicolons (;). (Required)

  • server_list

    A list of cloud servers that are candidate cloud servers for the listed database copies. Accepts a search query that identifies cloud servers, for example a list of cloud server names or IDs separated by semicolons (;). (Required)

Required privileges

MoveDatabase

Remarks

The specified database copies are moved in a way to avoid overloaded cloud servers where possible. If the load is already balanced and all of the copies specified are located on the specified target cloud servers, then nothing is moved.

This task distributes the specified database copies among the specified cloud servers to avoid overloading individual cloud servers. When choosing a cloud server, free disk space on the host with the cloud server, strict rules, the major and minor version of the cloud server, and database page size are considered. Overloaded cloud servers are considered as targets, but the cloud chooses one only if there is not a better option.

Load balancing cannot move the following database copies:

  • The read-write database copy in a read-only scale-out system.

  • The mirror database copy if the primary is not running.

  • The primary database copy if:

    • There is more than one copy for the database

    • There is a mirror, and both the primary and mirror are not running.

Load balancing does not consider the following cloud servers as candidates:

  • Cloud servers running database copies of the specified database(s)

  • The arbiter server of the specified database(s)

  • Cloud servers on the hosts that are running the primary or mirror copy of the specified database(s)

  • Cloud servers whose major and minor server versions are incompatible with the specified database(s).

Load balancing primary and mirror database copies can cause tenant connections to be dropped. Load balancing database copies can put extra load on the tenant databases involved.

Use the following format to specify the database copy:

database-name@server-name

Example

Run the following task to move the database copy mytenant2@my-server#4 to any of the three cloud servers my-server#3, my-server#6, or my-server#10:

dbcloudcmd run LoadBalanceDatabases databasecopy_list=mytenant2@my-server#4 server_list=my-server#3;my-server#:6;my-server#10

Run the following task to move all database copies with the tag Midwest to either my-server#4 or my-server#8:

dbcloudcmd run LoadBalanceDatabases "database:tag:Midwest" "my-server#4;my-server#8"

This task moves the database copies if they are running on my-server#3, even if the destination cloud server is overloaded. The cloud selects the best suitable cloud server (among cloud servers other than my-server#3) that meets the criteria for these databases: the server must be running, have an appropriate page size, enough disk space, and strict rules must allow the database to be placed on that server.

dbcloudcmd run LoadBalanceDatabases "database:mytenant2 or database:demo1" "not my-server#3"