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 » Autostart and autostop databases

Disabling and re-enabling an autostop database(dbcloudcmd)

Prevent an autostop database from stopping automatically for a period of time.

Prerequisites

You must have the AlterDatabase privilege.

Context

Use this task when you need to perform maintenance on a database and the database must not stop until you are done.

Procedure

  1. Disable the autostop database from stopping automatically by running a StartDatabase task on the database.

    If the database is stopped, it starts and it does not stop automatically. If the database is running, it continues to run and it does not stop automatically.

  2. Perform the maintenance that requires the database to continue running.
  3. Re-enable the database to stop automatically by running a StopDatabase task with the unconditionally parameter set to 0.

Results

If the database has no client connections, then the database stops. If the database has client connections, then it continues to run and it stops automatically after the last client connection disconnects.

Example

Database mydatabase is an autostart and autostop database. Fred must perform maintenance on the mydatabase database that requires the database to run throughout the process. Fred runs the following task to prevent the database from autostopping:

dbcloudcmd run StartDatabase database_list=mydatabase

After the maintenance ends, Fred runs the following task to re-enable the mydatabase database to stop automatically. If there are no client connections, then database stops. If there are client connections, then the database stops automatically when the last client connection disconnects.

dbcloudcmd run StopDatabase database_list=mydatabase unconditionally=0