cancel
Showing results for 
Search instead for 
Did you mean: 

Manage or clean-up the HANA catalog for a database with Azure Backup enabled

former_member726198
Discoverer
0 Kudos

Dear All,

I have recently installed a SAP Hana Database Server in MS Azure Cloud and noticed that the Hanacleaner was not able to clean-up the backup catalog. It ends with the following error:

* 2: general error: Backup error: Error writing backup to 'BACKINT' '/usr/sap/VSD/SYS/global/hdb/backint/SYSTEMDB/log_backup_0_0_0_0' SQLSTATE: HY000
ERROR: Could not execute
BACKUP CATALOG DELETE ALL BEFORE BACKUP_ID 1610038812880

ERROR: The user represented by the key HANACLEANERSYSDB could not clean backup catalog.
One possible reason for this is insufficient privilege,
e.g. lack of the system privilege BACKUP ADMIN.
If there is another error (i.e. not insufficient privilege) then please try to execute
BACKUP CATALOG DELETE ALL BEFORE BACKUP_ID 1610038812880
in e.g. the SQL editor in SAP HANA Studio. If you get the same error then this has nothing to do with hanacleaner.

The user which is responsible for the cleanup is not the issue, this user has enough permissions to execute the catalog clean-up.

The guide at Azure: Manage and monitor backed up SAP HANA databases, says to manually cleanup the catalog:

If you want to edit or clean-up the backup catalog, do the following:

  1. Wait for any full or log backups for the database to finish. Check the status in SAP HANA Studio/ Cockpit.
  2. for the relevant DB
    1. Unset the backint parameters. To do this, double-click systemdb > Configuration > Select Database > Filter (Log).
      • enable_auto_log_backup: No
      • log_backup_using_backint: False
      • catalog_backup_using_backint:False
  3. Edit the catalog and remove the older entries
  4. Then reverse the steps. For the same relevant DB mentioned above,
    1. re-enable the backint parameters
      1. catalog_backup_using_backint:True
      2. log_backup_using_backint: True

      enable_auto_log_backup: Yes

This is for us not a preferred way to clean-up the catalog, does anyone faced the same issue and figured out a solution how to fix this with the Hanacleaner script, or found another solution to automate this?

Thanks in advance!

Regards, Jeffrey Schouten

0 Kudos

Hello Jeffrey,

Did Azure came back with the solution?

I'm also facing the similar issue in the most of the HANA system which are having Azure BaaS as backup solution.

Accepted Solutions (0)

Answers (3)

Answers (3)

dvankempen
Product and Topic Expert
Product and Topic Expert

Hi Jeffrey,

Azure Backup provides a retention policy. Would this not cover the objective?

As there is no support at all on the Hanacleaner Python script, i would not recommend to use this "one-man's hobby" in production environments, particularly for such a delicate subject as backup and recovery.

At least make sure senior management has signed off on the disclaimer to avoid unpleasant surprises in the future

former_member726198
Discoverer

Hi All,

Just to give a little update on this subject, since the Hanacleaner script is a valued tool which is globally used on a large scale.

After intensive contact with MS Azure, they have explained that they have received many remarks/complaints regarding the Hanacleaner script which is not able to automatically clean-up the back-up catalog. Currently they are working on a fix for cleaning up the back-up catalog without disabling and enabling the backint parameters. The tentative timeline for this is July, 2021.

Regards, Jeffrey Schouten

0 Kudos

Hi Jeffrey

Did Microsoft give you an answer or workaround about this issue? because we have the same problem in our environment...

Any help is welcome

Regards, Hector Quiroz

darrylmg
Explorer
0 Kudos

I just wrote a wrapper script to take care of the following actions:

  1. check for running HANA backup.
    If a running backup is found, script loops every 1 min re-checking, then after 20 mins it hits a timeout.
  2. disable backint as per Microsoft's article.
  3. run HANACleaner.
  4. re-enable backint.

Done. 🙂

forgot to mention: For HSR the HANACleaner just exits with an error on secondary, but the wrapper is clever enough to not even bother running HANACleaner for the tasks that need an online DB.

Darryl

spalc
Participant
0 Kudos

Hello guys,

Interesting topic! I'm in the middle of it, lately realizing that Azure Backup won't cover any housekeeping when it comes to the backup catalog.

Just like Hector is asking: has anyone fresh news on this topic, like an official Azure/SAP guidance? I had a recent back and forth with Azure support on this - see below. In short: DIY.

Going this path, darryl.griffiths, may i ask you if would you be ok to share your wrapper? I would perfectly understand if this is not possible 🙂

Thanks! jean

Question :

  1. Does Azure Backup service will be housekeeping of catalog backup ?
  1. Is there any public document from MS regarding the catalog backup ?

Response :

  1. Does Azure Backup service will be housekeeping of catalog backup ? -- No, Pruning of catalog backups either through cockpit/ using SQL queries triggers a catalog backup to be generated.
  2. Is there any public document from MS regarding the catalog backup ? -- No, we currently do not have any documentation on managing catalog sizes, the reason being most of our customers manage it themselves. However, with large catalog sizes affecting the log backups we plan to update our documentation w.r.t the catalog pruning operation.


For the customers that reach out to us about this, we provide the same recommendation that SAP HANA provides – which is to keep latest 30 days of catalog and prune the remaining (given you do not have any compliance or legal mandates that require you to maintain catalogs of backups for more than 30 days). Also, for more of our customers today we see that this 30 day limit works well.

Recommendation :

  1. Please don’t run the pruning job for more than 60 days at once.
  2. Maximum limit of the catalog backup size is 100 mb.
pdl_skf_sap_o
Explorer
0 Kudos

We are migrated to Azure and HANACleaner is working with below dumyy command, what exactly can we use to delete HANACleaner.

python hanacleaner.py -k SYSTEMKEY -bd 30 -op /hana/shared/SID/HANACleaner_SID/hanacleaneroutput_bd -os true -es false