Create a MAXDB (SAP) backup

Availability for the Always-On Enterprise

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Tue Jul 12, 2016 6:44 am

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?
thylab
Influencer
 
Posts: 10
Liked: 1 time
Joined: Mon Jul 11, 2016 1:57 pm
Full Name: Thys Basson

Re: Create a MAXDB (SAP) backup

Veeam Logoby Vitaliy S. » Tue Jul 12, 2016 10:17 am

Yes, you're spot on.
Vitaliy S.
Veeam Software
 
Posts: 19541
Liked: 1098 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Create a MAXDB (SAP) backup

Veeam Logoby Andreas Neufert » Tue Jul 12, 2016 2:33 pm 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.
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 357 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Wed Jul 13, 2016 8:42 am

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

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Wed Sep 21, 2016 7:10 am

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.
thylab
Influencer
 
Posts: 10
Liked: 1 time
Joined: Mon Jul 11, 2016 1:57 pm
Full Name: Thys Basson

Re: Create a MAXDB (SAP) backup

Veeam Logoby Andreas Neufert » Wed Sep 21, 2016 7:18 am

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.
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 357 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Wed Sep 21, 2016 7:37 am

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?
thylab
Influencer
 
Posts: 10
Liked: 1 time
Joined: Mon Jul 11, 2016 1:57 pm
Full Name: Thys Basson

Re: Create a MAXDB (SAP) backup

Veeam Logoby Andreas Neufert » Wed Sep 21, 2016 7:56 am

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.
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 357 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Wed Sep 21, 2016 8:28 am

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: Mon Jul 11, 2016 1:57 pm
Full Name: Thys Basson

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Wed Sep 21, 2016 8:48 am

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?
thylab
Influencer
 
Posts: 10
Liked: 1 time
Joined: Mon Jul 11, 2016 1:57 pm
Full Name: Thys Basson

Re: Create a MAXDB (SAP) backup

Veeam Logoby Andreas Neufert » Wed Sep 21, 2016 8:49 am

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.
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 357 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Re: Create a MAXDB (SAP) backup

Veeam Logoby thylab » Wed Sep 21, 2016 9:19 am 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
thylab
Influencer
 
Posts: 10
Liked: 1 time
Joined: Mon Jul 11, 2016 1:57 pm
Full Name: Thys Basson

Re: Create a MAXDB (SAP) backup

Veeam Logoby Andreas Neufert » Wed Sep 21, 2016 11:10 am

thx for the feedback.
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 357 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Previous

Return to Veeam Backup & Replication



Who is online

Users browsing this forum: Bing [Bot], DonZoomik, foggy, Google [Bot], Majestic-12 [Bot], quazer and 50 guests