Comprehensive data protection for all workloads
alex2801
Lurker
Posts: 2
Liked: never
Joined: Nov 06, 2009 9:49 am
Full Name: Alex Henstra
Contact:

Create a MAXDB (SAP) backup

Post by alex2801 »

Hi all,

I'm Looking for a way to backup some SAP server VM's with Veeam. The normal Veeam backup goes very well now and the last result is always "success". But since MaxDB is not VSS compliant ,the databases are in an inconsistent state. There must be more people in this situation ,but i can't find them with google .

Any help is appreciated.
Gostev
Chief Product Officer
Posts: 31460
Liked: 6648 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Create a MAXDB (SAP) backup

Post by Gostev »

Hi, you can use VMware prefreeze/postthaw scripts to suspend/resume database for snapshot operation. You may need to contact MaxDB vendor to find out what commands need to be used to suspend and resume database for hot backup.
alex2801
Lurker
Posts: 2
Liked: never
Joined: Nov 06, 2009 9:49 am
Full Name: Alex Henstra
Contact:

Re: Create a MAXDB (SAP) backup

Post by alex2801 »

Thanks for your reply Gostev,

I wil look for the freeze and thaw scripts. If anyone has succeeded in making such scripts, please let me now.
tsightler
VP, Product Management
Posts: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Create a MAXDB (SAP) backup

Post by tsightler »

SAP has some techniques for performing backups using "split mirror" techniques, which is basically the same thing. A split mirror is typically how Netapp or EMC describe using their snapshot technology to create backup snapshots presented to secondary host, but conceptually it's the same.

Unfortunately I don't have access to the SAP technotes, but SAP notes 371247 and 616814 seem to be the definitive reference for SAN based snapshots (VMware snapshots are not really different). Note 616814 has the following script:

Code: Select all

To create the split mirror or snapshot, proceed as follows:
dbmcli -d <database_name> -u < dbm_user>,<password>
util_connect < dbm_user>,<password>
util_execute suspend logwriter
==> Create the snapshot on the EVA
util_execute resume logwriter
util_release
exit
So effectively you should be able to use the concept to create a pre-freeze script to freeze the IO, and a post-thaw script to resume the logging but I must admit my experience here is minimal.
ehill@gtweed.com
Lurker
Posts: 1
Liked: never
Joined: Jan 10, 2011 8:24 pm
Full Name: Ethan Hill
Contact:

Re: Create a MAXDB (SAP) backup

Post by ehill@gtweed.com »

Has anyone had any success with the thaw portion of this. I get a vmware snapshot error to do with non 0 return code by the custom portion of the quiesce script.
Gostev
Chief Product Officer
Posts: 31460
Liked: 6648 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Create a MAXDB (SAP) backup

Post by Gostev »

Did you verify that thaw script returns zero when both pre and then post scripts are executed manually?
Felix
Enthusiast
Posts: 37
Liked: 2 times
Joined: Oct 30, 2009 2:43 am
Full Name: Felix Buenemann
Contact:

Re: Create a MAXDB (SAP) backup

Post by Felix » 1 person likes this post

Based on the info provided here and some googling, I'm now using the following freeze/saw script to backup our SAP MaxDB Windows machines:

Code: Select all

@echo off
REM %1 == freeze/thaw/freezeFail
if "%1" == "freeze" goto doFreeze
goto doThaw
:doFreeze
echo %1 >c:\freeze.log
dbmcli -d <dbname> -u <dbuser>,<dbpass> -uUTL -c "util_execute suspend logwriter" >>c:\freeze.log
goto EOF
:doThaw
echo %1 >>c:\freeze.log
dbmcli -d <dbname> -u <dbuser>,<dbpass> -uUTL -c "util_execute resume logwriter" >>c:\freeze.log
:EOF
Put the file as eg. 00_maxdb_logwriter.bat into %ProgramFiles%\VMware\VMware Tools\backupScripts.d\.
To test if it works, create a snapshot through VIMClient amd enable the quiesce filesystem checkbox.

You can find debugging info in the file c:\freeze.log, if everything went fine it should say freeze OK/IO SEQUENCE = <some number> and thaw OK.

You need to enable VMware Tools Quiesce in the Veeam Backup job options.
I'm not sure wether it makes sense to leave Veeam Backups's own VSS handler enabled or better disable it for the specific VMs.

Regards, Felix
HendrikHackmann
Lurker
Posts: 1
Liked: never
Joined: Sep 29, 2015 6:29 am
Full Name: Hendrik Hackmann
Contact:

[MERGED] Backup VM with SAP and MaxDB

Post by HendrikHackmann »

Hello,

is anyone using VEEAM to Backup a VMWARE Guest with SAP and MaxDB?
Is there any documented and certified way to do this?

I look forward to receiving your feedback

Thanks
Hendrik
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Backup VM with SAP and MaxDB

Post by PTide »

Hi,

Currently the only way to backup some unsupported database is to use pre/post guest script approach, see above. Starting v8, using these scripts can be fully automated in the backup job, as a part of guest processing.

Thank you.
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert » 1 person likes this post

Starting from 7.8.02 and 7.9 it isn´t anymore supported to stop the log writer with above script. The replacement commands for this can be found in the SAPNOTE 1928060
fwagner
Novice
Posts: 3
Liked: never
Joined: Jun 01, 2016 12:03 pm
Full Name: Frank Wagner
Contact:

Re: Create a MAXDB (SAP) backup

Post by fwagner »

You can also use our MaxDB VSS Writer (see http://www.maxback.io).

It has been created by our company explicitly for integration with Veeam and has been released as part of our MaxDB backup solution recently.

Best Regards,
Frank
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert »

very cool, thank you.

Is the VSS Writer free or paid?
fwagner
Novice
Posts: 3
Liked: never
Joined: Jun 01, 2016 12:03 pm
Full Name: Frank Wagner
Contact:

Re: Create a MAXDB (SAP) backup

Post by fwagner »

Is the VSS Writer free or paid?
It is a paid solution.

If you what to know more just send me an email or use the contact form on http://www.maxback.io.

Best Regards,
Frank
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

[MERGED] VBR and MAXDB snapshots

Post by thylab »

Hi All

Hoping someone can perhaps share some information and tips with regards to backing up SAP running MAXDB which isnt VSS compatible. What would be the best way have consistent backups of this SAP MAXDB database?

Any assistance would be appreciated.
Kind Regards
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Create a MAXDB (SAP) backup

Post by Vitaliy S. »

Hi Thys, if VSS cannot be used, then pre-freeze/post-thaw scripts should be a way to go. Thanks!
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab »

Vitaliy S. wrote:Hi Thys, if VSS cannot be used, then pre-freeze/post-thaw scripts should be a way to go. Thanks!
Hi, i assume these pre-freeze/post-thaw scripts pauses the database and stop any connections made to it during the backup window?
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Create a MAXDB (SAP) backup

Post by Vitaliy S. »

Yes, you're spot on.
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert » 2 people like this post

As Tom wrote above, there is anothe method that do online backup:
Veeam Pre Script:

Code: Select all

dbmcli –d <database> -u <DBMuser>,<password>
util_connect <DBMuser>,<password>  
util_execute suspend logwriter
exit
Veeam PostScript:

Code: Select all

dbmcli –d <database> -u <DBMuser>,<password>
util_connect <DBMuser>,<password>  
util_execute resume logwriter
util_release 
exit
Veeam uses a VMware SnapShot (or Volume SnapShot at Hyper-V) that bring all VM volumes at same time into the snapshot which is inline with the MaxDB requirements.
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab »

Thank you very much. we will give this a try.
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab »

Hi All

Any idea why the Pre Script would fail when running the job? The account we are using are domain admin. When we use the local administrator the scripts runs but times out after few minutes. When i run the script manually on the server it never goes past the first line in the script.

dbmcli –d <database> -u <DBMuser>,<password>
util_connect <DBMuser>,<password>
util_execute suspend logwriter
exit

Is there any specific OS permissions the account need to run scripts on the VM?

Any input would be appreciated.
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert »

Maybe you used an Windows Editor for this script?
Windows uses other new line commands.
Download an editor that support Unix linefeed. Open the script an convert it to unix.
Or you can create with vi the script on the linux system and copy it later to the Veeam server.
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab »

I've just used NotePad++ to convert the script into Unix format and its still doing the same. When I use the Domain Admin account the script fails immediately, unable to run the script and when I use the local admin account the script runs, but runs for 10 minutes then times out. Its something to do with permissions or execution of the script. I have also disable UAC to see if this is not causing the problems.

Any other ideas?
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert »

Oh I missed the Windows thing here. In most cases customers uses Linux with maxDB. (So the Unix Editor will not work at all.... again sorry).

So you say that your MaxDB VM runs on Windows.
Please do the following.

Goto the MaxDB VM.
Open a command line and execute the above commands one by one. Maybe you will see a error there. It is maybe needed that you give the script the full path to the dbmcli.
When the commands run successfully in the Command line, create a .bat file on the system and run them again. (Login with the same User you will later give Veeam for GuestInteraction).

If this script runs then, you can copy it to the Veeam Server.
Create a new directory and check that Veeam Service account and "System" has access to that folder.

Go to the Veeam Job and add the Max DB Server. Enable Guest Interaction and under the VM add the Scripts. (do not add the script under "Storage-Advanced-Scripts" as it will not execute this in the VM).

Press the "Test" button and have a look that RPC communication is possible. (VIX communication not needed).

Run the Job.
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab »

Thanks, ok when running the commands one-by-one we get the following. I ran the commands in 2 different command prompt windows, Standard User and Elevated Command prompt (Administrator)

These commands were run with the Veeam service account on the MaxDB VM

Standard User: First command failed, so no need to run the rest.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\removed>D:\SAPDB\PBD\DB\PGM\dbmcli.exe -d PBD -u control,<removed>
Can not open file 'D:\sapdb\data\wrk\dbmsrv_removed.err'.
(System error 5; Access is denied.)
Error! Connection failed to node (local) for database PBD:
-24700,ERR_DBMSRV_NOSTART: Could not start DBM server.
-24832,ERR_SHMNOTAVAILABLE: Shared memory not available
-24827,ERR_SHMALLOCFAILED: ID D:\sapdb\data\wrk\PBD.dbm.shi, requested size 2608
6,Creating shared memory file D:\sapdb\data\wrk\PBD.dbm.shi failed, rc = 183.
C:\Users\removed>

Administrator:
C:\Windows\system32>D:\SAPDB\PBD\DB\PGM\dbmcli.exe -d PBD -u control,removed
D:\SAPDB\PBD\DB\PGM\dbmcli.exe on PBD>util_connect control,removed
OK
---
D:\SAPDB\PBD\DB\PGM\dbmcli.exe on PBD>util_execute suspend logwriter
OK
IO SEQUENCE = 28870124
---
D:\SAPDB\PBD\DB\PGM\dbmcli.exe on PBD>
C:\Windows\system32>

The assumption here is, that Veeam is trying to run the script on the MaxDB VM as a Standard user without Elevated rights. The service account and "System" have full access to the folder where the scripts are stored.
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab »

Ok, so made some progress. Its definitely related to some sort of permission issue on the MaxDB VM. With the Domain Administrator account the pre-freeze script executes fine, howerver with the newly created service account thats part of the Domain Admin group, it does not work. I have also given the service account the following User rights assignments

Act as part of the operating system
Backup files and directories
Log on as a batch job
Log on as a service
Restore files and directories

Still not working with the service account. Any ideas what OS permissions are required for the service account?
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert »

you are right.

Maybe save the bat file to the system, create a shortcut to it and enable under advanced the run as administrator privileges.
If this runs ok. you can create another script that start the Linkx name.lnk from the Veeam script.
This is just an idea from googling.

Another option would be to create a windows (planned task) and allow runs as admin there.
Then you can start the planned task if needed.
thylab
Influencer
Posts: 10
Liked: 1 time
Joined: Jul 11, 2016 1:57 pm
Full Name: Thys Basson
Contact:

Re: Create a MAXDB (SAP) backup

Post by thylab » 1 person likes this post

Resolved our issue. This was related to UAC. Local Policies > Security Settings. In the right pane you will see a setting User Account Control: Turn on Admin Approval Mode change this to disabled

Had to disable UAC to get it to work with the new service account, not ideal, but it will do for now. Now we will just have to test the consistency of the MaxDB to make sure the backups are fine.

We also adjusted the batch file to have everything in 1 line.
Pre-freeze
dbmcli.exe -d Database -u user,password -uUTL -c util_execute suspend logwriter
Post-freeze:
dbmcli.exe -d Datagase -u user,password -uUTL -c util_execute resume logwriter
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Create a MAXDB (SAP) backup

Post by Andreas Neufert »

thx for the feedback.
stuartmacgreen
Expert
Posts: 149
Liked: 34 times
Joined: May 01, 2012 11:56 am
Full Name: Stuart Green
Contact:

Re: Create a MAXDB (SAP) backup

Post by stuartmacgreen »

Andreas Neufert wrote: May 18, 2016 8:02 am Starting from 7.8.02 and 7.9 it isn´t anymore supported to stop the log writer with above script. The replacement commands for this can be found in the SAPNOTE 1928060
SAPNOTE 1928060 states

Procedure with DBMCLI
1. Perform a complete data backup
a. Start the DBMCLI and log onto the database:

Code: Select all

dbmcli -d <database_name> -u <dbm_operator>,<password>
b. Open a connection to the database:

Code: Select all

db_connect
c. Start the complete data backup:

Code: Select all

backup_start <backup_template> data
In response to this command, the system displays something like the following output:
OK
Returncode -8020
...
Max Used Data Page
0
...

In this case, the return code -8020 along with the value 0 for the maximum number of used data pages (Max Used Data Page) indicates that the complete data backup was started successfully.

2. Perform the external file system backup of the data volumes.
Leave the DBMCLI session open. Perform your external file system backup of the data volumes.


3. End the complete data backup.
Once the external file system backup of the data volumes is complete, enter the DBM command backup_finish and specify an external backup ID (EXTERNAL BACKUP ID) freely chosen by yourself:

Code: Select all

backup_finish <backup_template> ExternalBackupID <external_backup_ID>
This command is the signal for the database that the complete data backup can be be concluded. A successfully concluded complete data backup is entered in the backup history. This entry contains the external backup ID that you assigned.


Q: How can you use pre-freeze and post-thaw when Step 2 states to leave the session open. I'm a bit confused. HELP.
(I am not a DBA expert)
Also I am using MAXDB 7.8.0.2 on Linux


Thanks.
Jurbat
Lurker
Posts: 1
Liked: never
Joined: Feb 15, 2021 2:25 pm
Full Name: Jurgen Baert
Contact:

Re: Create a MAXDB (SAP) backup

Post by Jurbat »

@stuartmacgreen

Where facing the same challenge and wanted to check if you found a solution to backup MAXDB with veeam.

Thanks,
Jurgen
Post Reply

Who is online

Users browsing this forum: Ivan239 and 269 guests