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

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » Database maintenance » Backup and data recovery » Database recovery

 

Restoring a database from an archive backup (Interactive SQL)

Use Interactive SQL to restore a database from an archive backup.

Prérequis

You must not have any incremental backups of the transaction log that need to be applied as part of the recovery process.

If you created the backup of a strongly-encrypted database with free page elimination turned on, you must specify the encryption key for the database when restoring it.

 Task
  1. Run the following command to start a personal database server:

    dbeng16 -n server-name
  2. Start Interactive SQL and connect to the utility database. Complete the following fields:

    1. In the User ID field, type DBA.

    2. In the Password field, type sql.

    3. In the Database Name field, type utility_db.

  3. Click OK.

  4. Execute a RESTORE DATABASE statement, specifying the archive root.

    At this time, you can choose to restore an archived database to its original location (the default), or to a different computer with different device names using the RENAME clause.

Résultat

The database is restored.

Exemple

The following statement restores a database from a tape archive to the database file c:\newdb\newdb.db.

RESTORE DATABASE 'c:\\newdb\\newdb.db'
FROM '\\\\.\\tape0';

The following statement restores a database from an archive backup in file c:\backup\archive.1 to the database file c:\newdb\newdb.db. The transaction log name and location are specified in the database.

RESTORE DATABASE 'c:\\newdb\\newdb.db'
FROM 'c:\\backup\\archive';

The following statement restores a database from an archive backup in file c:\backup\archive.1 to the database file c:\newdb\newdb.db. The transaction log name and location are specified in the database. The encryption key is specified for the database.

RESTORE DATABASE 'c:\\newdb\\newdb.db'
FROM 'c:\\backup\\archive'
KEY '3Km57y1z';

 See also