Find in this Blog

Wednesday, July 13, 2016

[110026] The state 'ManagerSnapshotExists' of the BackupManager does not allow the requested operation SQLSTATE: HY000

[110026] The state 'ManagerSnapshotExists' of the BackupManager does not allow the requested operation SQLSTATE: HY000


select BACKUP_ID from "SYS"."M_BACKUP_CATALOG" where entry_type_name ='complete data backup' and state_name = 'running' order by sys_start_time desc

Execute this comment if any backup running cancel it.

Go tho this SNOTE:

1703435 - Generating a copy of a running instance with database snapshots


Symptom
You want to duplicate a running SAP HANA database by copying the data area.
Comment: As of SAP HANA Support Package Stack 07, the procedure described in this SAP Note for copying a database is no longer recommended. For more information about the recommended database copy procedure, as well as about storage snapshots, see the SAP HANA Administration Guide.

Other Terms
Homogeneous system copy, database snapshot

Reason and Prerequisites
The software of the source database has at least Version 1.00.23. The software version of the target database has to be higher or equal to the software version of the source database.

The system landscapes of the source and target database have to be compatible. This means that the number of nodes and the number and types of services (such as index server) have to match.
The source database must be running, the target database must be offline.
You have to be logged on to the source database with a user who has the BACKUP ADMIN privilege.

Solution
Overview


To duplicate a running SAP HANA database using a copy of the data area, you have to use a database snapshot. A database snapshot is a consistent state that is saved to the data area of the database.

Creating a snapshot

To create a database snapshot in a running SAP HANA database, use the following SQL command:

BACKUP DATA CREATE SNAPSHOT

Take into account that only one database snapshot at a time can exist in an SAP HANA database. This also means that you cannot create a data backup if a database snapshot exists in the SAP HANA database.
If a snapshot already exists, or if a backup is currently running, when you execute the command, the system issues the error message "general error: Backup error: The state 'ManagerSnapshotExists' of the BackupManager does not allow the requested operation".


Removing a snapshot

To remove a database snapshot from a running SAP HANA database, use the following SQL command:

BACKUP DATA DROP SNAPSHOT

If no snapshot exists, calling this command leads to the error message "general error: Backup error: The state 'ManagerIdle' of the BackupManager does not allow the requested operation".

Activating a snapshot

To activate the consistent state that you saved in a database snapshot in the target database, use the following commands:

hdbnsutil -useSnapshot

and

hdbnsutil -convertTopology

hdbnsutil -useSnapshot replaces the current dataset by the dataset that is stored in the database snapshot.

If there is no database snapshot, calling hdbnsutil leads to an error message.

hdbnsutil -convertTopology carries out the required adjustments in the internal structures to the target system.


The database snapshot is removed during activation. As a result, it is neither required nor possible to manually remove the database snapshot in the target database.

Procedure to create a copy of a database using a database snapshot


1. In the source database, create a snapshot using the following SQL command:

BACKUP DATA CREATE SNAPSHOT

2. Copy all the files from the data area of the source database to the respective directory on the target database.
The directory name of the data area is defined in the configuration parameter basepath_datavolumes (in the configuration file global.ini, section persistence).

You have to make sure that the operating system user <SID>adm of the target database has read and write access to the files in the data area of the target database after copying.

3. Delete the snapshot in the source database using the following SQL command:

BACKUP DATA DROP SNAPSHOT

4. In the target database, delete existing file and log backup files.

The directory name for data backup files is defined in the configuration parameter basepath_databackup; the directory name for log backup files is defined in the configuration parameter basepath_logbackup. Both parameters are in the section persistence of the configuration file global.ini.

If in the directory -d $DIR_INSTANCE/../SYS/global/hdb/metadata
the file BackupCatalog.xml exists, delete it.


5. Execute the following commands in a command line environment of the target database:

hdbnsutil -useSnapshot
hdbnsutil -convertTopology

6. Start the target database.


Take into account:

After you activate a database snapshot in the target database, carry out a data backup as soon as possible because a recovery is not possible otherwise.

If a permanent license is installed in the source database, you have to install a new license in the target database.