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

SAP Sybase SQL Anywhere, on-demand edition 1.0 Support Package 3 » SAP Sybase SQL Anywhere, on-demand edition 1.0 » Tasks and events

 

Running batches of tasks

Use the ExecuteTaskBatch task to run more than one task at a time.

Prerequisites

You must have the ExecuteSQL privilege.

Context and remarks

Not all SQL statements are supported. See SQL statements that are not supported in tenant databases.

 Task
  1. In the Cloud Console, navigate to the Events panel.

  2. Click Run new task.

  3. Select ExecuteTaskBatch.

  4. Click Next.

  5. In the sql_batch field, paste the statements for the tasks that you want to run.

    For example:



    -- Move all databases off of server MYCLOUD-VM00#2 
    --This task assumes that no read-write database copies in a read-only scale-out system, 
    or stopped primary databases in a tenant mirroring system, exist on the server MYCLOUD-VMOO#2
    CALL DBCloud.LoadBalanceDatabases('all:','not name:"MYCLOUD-VM00#2"');
    
    -- Shut down server MYCLOUD-VM00#2
    CALL DBCloud.StopServer('MYCLOUD-VM00#2');
    
    -- Drop server MYCLOUD-VM00#2
    CALL DBCloud.DropServer('MYCLOUD-VM00#2');
  6. In the server_list field, specify the servers that you want to run the task on.

    For example, specify MYCLOUD-VM00#1.

  7. Click Finish.

Results

The ExecuteTaskBatch task runs on the cloud server.

Example

The following task batch starts all stopped databases and applies the tag country to the database mydatabase:

CALL DBCloud.StartDatabase ('status:stopped');
CALL DBCLoud.ApplyTag ( 'country', 'name:mydatabase and  type:database');

 See also