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

RestoreBackupCopy task

Restores a database from a backup copy.

Syntax 1 (SQL)
CALL DBCloud.RestoreBackupCopy ( backupcopy=backupcopy, server=server [, optional-parameters ] )
Syntax 2 (Cloud Command utility)
dbcloudcmd run RestoreBackupCopy backupcopy server [ optional-parameters ]
Parameters
  • backupcopy

    The backup copy to restore. Accepts a backup copy name, ID, or a search query that identifies one backup copy. (Required)

  • server

    The target cloud server. Accepts a cloud server name, ID, or a search query that identifies one cloud server. (Required)

  • include_latest_log

    Set to 1 to include the latest transaction log from the database. The default is 0.

Required privileges

RestoreDatabase

Remarks

This task restores a tenant database from either a full or incremental backup.

RestoreBackupCopy deletes all copies of the tenant database including read-only scale-out database copies and the mirror, as well as the arbiter setting. If any database copies cannot be dropped, the task will fail.

After the task completes, you have a single read-write copy of the database. You must set up tenant mirroring and/or read-only scale-out systems as required.

All relevant backup files are copied to the host where the specified cloud server is running and the database is started on that cloud server.

You can only restore the backup copy to a cloud server that matches all the strict rules that apply to the tenant database.

Restoring a database recreates the read-write database copy. All cloud settings such as rules, tags, maintenance plans, and backups are unchanged.

This task is similar to the CreateDatabaseFromBackupCopy task. Both tasks restore a backup, but RestoreBackupCopy replaces the database whose backup it is restoring and requires that database be stopped. Restoring a backup is useful when a database has become corrupted or data has been lost, and you want to restore the database to a previous state. CreateDatabaseFromBackupCopy does not require the database to be stopped and creates a new database that is an exact copy of the original database at the time of the specified backup. This task can be used to create a temporary copy of a database that can be modified without affecting the existing database.

The tenant database must be stopped.

The backupcopy parameter accepts a backup copy ID. To view a list of backup copy IDs on the host myhostname with the specified start time, run the following command:

dbcloudcmd describe "type:backupcopy and host:myhostname and start_time > '2012-05-02T14:20:00-04:00'"

Example

The backupcopy parameter accepts a backup copy ID. To view a list of backup copy IDs on the host myhostname with the specified start time, run the following command:

dbcloudcmd describe "type:backupcopy and host:myhostname and start_time > '2012-05-02T14:20:00-04:00'"

Run the following task to restore the backup copy with the ID BC-a5v5 and start it on the cloud server my-server#3:

dbcloudcmd run RestoreBackupCopy backupcopy=BC-a5v5 server=my-server#3