Creating a Fallback Snapshot

Objective

After completing this lesson, you will be able to create a fallback snapshot

Fallback Snapshot Creation

Business Example

As a best practice, creating a backup may be useful if you perform changes to the contents of a database that you may need to roll back quickly, for example, if you upgrade to a new version of an application. The fallback snapshot feature lets you easily create a snapshot that ensures the rollback possibility without creating a complete backup.

How Fallback Snapshot Work

When a fallback snapshot is created, the frozen pages will not be released. Changes to existing pages will be recorded in new pages. After the application update is finished, there are the following two possible scenarios:

  • Delete fallback snapshot: The application update went without any errors and the frozen fallback snapshot situation isn't required anymore.
  • Reset to fallback snapshot: The application update produced severe errors and the productive system is unusable. Revert back to the frozen fallback snapshot situation to remove all database changes that happened during the upgrade. After reverting to the 'old' version of the application, the production system is available again.

Fallback snapshots are created on tenant level within a few seconds, and reverting back to the fallback snapshot situation takes as long as a database restart.

Points to Note About Fallback Snapshots

  • Fallback snapshots can only be created for tenant databases.

  • Configuration changes are not included.

  • You can only create one fallback snapshot per tenant database. If you need to create a new fallback snapshot, delete the existing one first.

  • A service cannot be added or removed if a fallback snapshot already exists.

  • A fallback snapshot does not replace a database backup.

  • A fallback snapshot is not included in a database backup.

What Happens during a Fallback Snapshot

When a fallback snapshot is triggered, the following actions are executed:

  1. A fallback snapshot savepoint is written to the data volume to have a consistent state of the database in the data volume.
  2. The fallback snapshot savepoint is kept. This frozen state prevents the pages belonging this savepoint to be overwritten.
  3. All changes to in-memory tables will performed as normal, and will be written to the transaction logs.
  4. The regular 5-minute savepoint will be executed as normal, but the fallback snapshot savepoint pages will be kept.

The SYS_DATABASES.M_SNAPSHOTS system view provides information about fallback snapshots.

Note

A fallback snapshot can also be created if the tenant database is the primary database in a system replication scenario.

Reset to a Fallback Snapshot

You can revert to a particular database state by resetting to a fallback snapshot. To revert to a fallback snapshot, use Manage Databases in the SAP HANA cockpit, and choose Reset to Fallback Snapshot or execute the SQL statement:

Code Snippet
1
ALTER SYSTEM START DATABASE <database name> FROM FALLBACK SNAPSHOT;

Delete a Fallback Snapshot

If a fallback snapshot for a tenant database is no longer needed, it can be deleted.

You can only create one fallback snapshot per tenant database. If you need to create a new fallback snapshot, delete the existing one first.

To delete a fallback snapshot, use Manage Databases in the SAP HANA cockpit, and choose Delete Fallback Snapshot or execute the SQL statement:

Code Snippet
1
ALTER DATABASE <database name> DROP FALLBACK SNAPSHOT;

Log in to track your progress & complete quizzes