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

CleanCloud task

Deletes expired data from the cloud.

Syntax 1 (SQL)
CALL DBCloud.CleanCloud ( [ optional-parameters ] )
Syntax 2 (Cloud Command utility)
dbcloudcmd run CleanCloud [ optional-parameters ]
  • num_deleted

    An output parameter. Internal use only.

  • num_remaining

    An output parameter. Internal use only.

  • runtime_limit_exceeded

    An output parameter. Internal use only.

  • runtime_limit_length

    The maximum number of time units for the task to run (0=no limit). The default is 0.

  • runtime_limit_unit

    The time unit that the runtime_limit_length is specified in. The default is 'M'.

    The following values are supported:

    • L


    • S


    • M


    • H


    • D


    • W


  • batch_size

    The number of objects to delete in one transaction. The default is 500.

Required privileges



When you install your cloud, the CleanCloud task is scheduled to run nightly.

CleanCloud identifies and deletes expired data from the cloud. Stored data about past actions or events is retained for a preconfigured period (adjustable via the AlterCloud task), after which it is considered expired and is deleted.

Events are retained as follows:

  • Active events are not removed by CleanCloud.

  • Inactive events that have not been dismissed are removed after the retention period specified in the cloud properties.

  • Inactive events that have been dismissed are removed the next time CleanCloud is run.

  • batch_size

    This parameter controls how often the CleanCloud task performs a COMMIT. Larger transaction sizes are more efficient, but in extreme cases could impact performance because of lock contention.

  • runtime_limit_length and runtime_limit_unit

    These parameters control how long the task is permitted to run. If the task deletes all expired data before the runtime limit is exceeded, the runtime_limit_exceeded parameter equals 0. If the runtime limit is exceeded, the task immediately commits and exits and the runtime_limit_exceeded parameter equals 1.

    Note Runtime limits should only be specified in scenarios where a large volume of expired data may cause an unacceptably long running time. For example, when CleanCloud has not been run for a long time, or immediately after altering the retention period. To prevent continuous growth of the cloud, the CleanCloud task should be scheduled to run regularly with a runtime limit large enough to allow the task to complete.


The following command sets a maximum runtime of three hours, with 1000 objects being deleted per transaction:

dbcloudcmd run CleanCloud runtime_limit_length=3 runtime_limit_unit=H batch_size=1000