Jump to content

SAP Netweaver 7.5 with MaxDB 7.9 on Azure using Azure NetApp Files (ANF)

Featured Replies

Posted

SAP Netweaver 7.5 with MaxDB 7.9 on Azure using Azure NetApp Files (ANF)

 

Overview

 

 

 

 

This article describes the setup of SAP ERP 7.5 with MaxDB 7.9. In addition, we will show how to use azacsnap to create application consistent snapshots. This article is written for an audience which are familiar with Azure, Linux and SAP Basis. Since the login mechanism changed in version 7.7 we can only support the MaxDB 7.9 with all the automation scripts explained here iin the documentation.

 

 

 

SAP MaxDB: The SAP Database - Home

 

SAP MaxDB - MaxDB - Support Wiki

 

SAP MaxDB Directory Structure - MaxDB - Support Wiki

 

 

 

System Configuration

 

 

This illustration is a short overview of the system setup.

 

 

 

523x452vv2.png.a24a8384fb9fe497c21d9d2d5528a8bf.png

 

 

 

Create the Environment

 

The VM

 

 

SubscriptionSAP your subscribtion

Resource group (new) ralfMaxDB

Virtual machine name ralfmaxdb01

Region East US

Availability options Availability zone

Availability zone 1

Security type Standard

Image SUSE Enterprise Linux 15 SP3 +Patching - Gen2

VM architecture x64

Size Standard E16-8ads v5 (8 vcpus, 128 GiB memory)

Authentication type Password

Username admin01

Create the delegated network for ANF

 

 

657x322vv2.png.9975609a57c2f92b66e7bbdd4df2e01c.png

 

 

 

Create the Volume Structure

 

 

Download the sources from the SAP Marketplace

 

The DB Export

 

700x42vv2.png.984f1901c0cc9b33eedeb24e4d115938.png

 

 

 

The SWPM

 

668x37vv2.png.b5f0c1ef4ec6e56d8da22f0ef2ba7c19.png

 

 

 

The MaxDB

 

687x115vv2.png.5fd46ef3f97944a0c741af916ecf68c7.png

 

674x36vv2.png.a1b5ee4a1627f4336eac82dc4ad38dd7.png

 

The SAPCAR

 

678x204vv2.png.78558b9d75990ea727d8ae65bf4c0c57.png

 

 

 

The Kernel

 

670x128vv2.png.b94b63851773e31ce7cd29420939df86.png

 

667x35vv2.png.11ef42770765c62200f81167d0851b67.png

 

673x153vv2.png.117553a250ba1b5ec4bb3dd3cbc98162.png

 

674x36vv2.png.38561b37c89a9ed0034d7eb851fd1ca8.png

 

The IGS

 

675x203vv2.png.acabdfb7341288841b9661945f969703.png

 

675x199vv2.png.2988077dfc57ebfd161c5e5346dfd318.png

 

 

 

Finally, the HOST Agent.

 

661x197vv2.png.45da6bfa0de9ca2d44733b52377f1dd0.png

 

 

 

Volume design on ANF

 

 

Create the volume structure on ANF. The size of each volume depends on a proper capacity and performance sizing.

 

 

 

Mount the volumes and create the directories.

 

 

 

Modify the idmapd to align the NFSv4 domain.

 

vi /etc/idmapd.conf

# Example

[General]

Domain = defaultv4iddomain.com

[Mapping]

Nobody-User = nobody

Nobody-Group = nobody

 

 

 

update the system

 

zypper up

 

Install the RPM’s regarding the installation manual

 

zypper in motif libXtst-devel libXp-devel libX11-devel libSM-devel libICE-devel

 

zypper in glibc-32bit sapconf

 

 

 

Maintain the sysctl.conf

 

vi /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1

net.core.somaxconn = 4096

net.core.netdev_max_backlog = 300000

net.ipv4.tcp_rmem = 4096 131072 16777216

net.ipv4.tcp_wmem = 4096 16384 16777216

net.ipv4.tcp_max_syn_backlog = 16348

net.core.rmem_max = 16777216

net.core.wmem_max = 16777216

net.ipv4.tcp_slow_start_after_idle = 0

net.ipv4.conf.all.rp_filter = 0

net.ipv4.tcp_dsack = 1

net.ipv4.tcp_sack = 1

net.ipv4.tcp_no_metrics_save = 1

net.ipv4.tcp_moderate_rcvbuf = 1

net.ipv4.tcp_window_scaling = 1

net.ipv4.tcp_syn_retries = 8

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_timestamps = 1

net.ipv4.tcp_tw_recycle = 1

 

 

 

reboot the system to apply all the changes and reload the kernel after the update.

 

reboot

 

Check that sapconf is running and that it is enabled.

 

 

 

sapconf_check

This is sapconf_check v1.0.

It verifies if sapconf is set up correctly and will give advice to do so.

Please keep in mind:

- This tool does not check, if the tuning itself works correctly.

- Follow the hints from top to down to minimize side effects.

Checking sapconf

================

[ OK ] sapconf package has version 5.0.5

[ OK ] sapconf.service is active

[ OK ] sapconf.service is enabled

Sapconf is set up correctly.

 

create the group ID for your SAP systems (should be the same for all SAP systems)

 

groupadd sapsys -g 79

 

groupadd sdba -g 1001

 

 

 

creating the DB users to avoid issues during the DB installation

 

useradd c11adm -g sapsys -c "SAP System Administrator" -u 1001 -s /bin/csh -d /home/c11adm

 

useradd sapadm -g sapsys -c "SAP System Administrator" -u 1002 -s /bin/false -d /home/sapadm

 

useradd sdb -g sdba -c "Database Software Owner" -u 1003 -s /bin/csh -d /home/sdb

 

useradd sqdc11 -g sapsys -c "Owner of Database Instance C11" -u 1004 -s /bin/csh -d /home/sqdc11

 

passwd c11adm

 

passwd sapadm

 

passwd sdb

 

passwd sqdc11

 

 

 

MaxDB Volume design for non XXL installations

 

 

As usual, create one shared volume for the Application Server part , a MaxDB volume for the database specific directories, data and log volume and the backup volume ideally on a different storage endpoint.

 

In this PoC we have all storage endpoints on one IP, which is okay for small and medium installations.

 

694x136vv2.png.7d8a403b255a424d650ca4551ecf590c.png

 

Get the FQDN name of the VM

 

hostname -f

 

ralfmaxdb01.lgbsmidv5lrurp4qqyuwbceesh.bx.internal.cloudapp.net

 

 

 

maintain the /etc/hosts

 

vi /etc/hosts

127.0.0.1 localhost

#

10.6.0.4 ralfmaxdb01.lgbsmidv5lrurp4qqyuwbceesh.bx.internal.cloudapp.net ralfmaxdb01

10.6.1.4 anf01

 

Create the SAP App server structure

 

mount -o vers=4.1 anf01:/C11usrsap /mnt

mkdir -p /mnt/sapmnt /mnt/usr_sap

mkdir -p /usr/sap/C11 /sapmnt

umount /mnt

 

 

 

Create the MaxDB “installation” structure

 

mount -t nfs -o vers=4.1 anf01:/C11MaxDB /mnt

mkdir -p /sapdb

mkdir -p /mnt/C11

 

 

 

Create the data structure

 

mkdir -p /sapdb/C11/sapdata

mkdir -p /mnt/C11/sapdata

 

 

 

Create the log structure

 

mkdir -p /sapdb/C11/saplog

mkdir -p /mnt/C11/saplog

 

 

 

Create the backup structure

 

mkdir -p /mnt/C11/backup

mount -t nfs -o vers=4.1 anf01:/C11backup /mnt/C11/backup

mkdir -p /sapdb/C11/backup/data /sapdb/C11/backup/log

mkdir -p /mnt/C11/backup/data /mnt/C11/backup/log

umount /mnt/C11/backup

umount /mnt

 

 

 

Create the fstab

 

vi /etc/fstab

...

/dev/sdc /Software xfs defaults 0 0

anf01:/C11usrsap/usr_sap /usr/sap nfs rw,hard,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

anf01:/C11usrsap/sapmnt /sapmnt nfs rw,hard,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

anf01:/C11MaxDB /sapdb nfs rw,hard,timeo=600,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

anf01:/C11data /sapdb/C11/sapdata nfs rw,hard,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

anf01:/C11log /sapdb/C11/saplog nfs rw,hard,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

anf01:/C11backup/data /sapdb/C11/backup/data nfs rw,hard,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

anf01:/C11backup/log /sapdb/C11/backup/log nfs rw,hard,vers=4.1,nconnect=8,rsize=262144,wsize=262144,noatime,lock 0 0

 

 

 

mount -a

chown -R sdb:sdba /sapdb

 

 

 

Create the Software directory

 

 

Create a /Software directory where you store the SAP archives.

 

 

 

Create the Software Disk

 

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 0 30G 0 disk

├─sda1 8:1 0 2M 0 part

├─sda2 8:2 0 512M 0 part /boot/efi

├─sda3 8:3 0 1G 0 part /boot

└─sda4 8:4 0 28.5G 0 part /

sdb 8:16 0 600G 0 disk

└─sdb1 8:17 0 600G 0 part

sdc 8:32 0 1T 0 disk

 

 

 

mkfs -t xfs /dev/sdc

mkdir /Software

 

 

 

ll /Software

drwxrwxrwx 3 root root 263 Mar 6 20:06 Export

drwxrwxrwx 2 root root 173 Mar 6 19:51 Kernel

drwxrwxrwx 2 root root 60 Mar 6 19:51 MaxDB

-rwxrwxrwx 1 root root 4507168 Mar 6 15:27 SAPCAR_1115-70006178.EXE

drwxrwxrwx 2 root root 22 Mar 6 19:51 SWPM

 

 

 

copy the SAPCAR into the PATH

 

mv SAPCAR_1115-70006178.EXE /usr/bin/SAPCAR

 

 

 

ASCS Installation

 

 

Extract the SWPM archive and start the SAP Installation

 

cd /Software/SWPM

SAPCAR -xf SWPM10SP37_0-20009701.SAR

SAPCAR: processing archive SWPM10SP37_0-20009701.SAR (version 2.01)

SAPCAR: 837 file(s) extracted

 

 

 

set the root password on the VM (required for the SAP installation)

 

sudo su –

passwd

Changing password for user root.

New password: *********

Retype new password: *******

passwd: all authentication tokens updated successfully.

 

 

 

 

 

Start the SWPM

 

/Software/SWPM # ./sapinst

 

 

 

Open your browser with

 

https://10.6.0.4:4237/sapinst/docs/index.html

 

and select advanced

 

550x410vv2.png.c323be7b393ff96e96b6878388b92723.png

 

 

 

Select continue.

 

Login as root

 

350x219vv2.png.8043d00804a2b5f09c15834b8b5af35a.png

 

507x450vv2.png.765972df312b47a371fae0bb71860db8.png

 

511x270vv2.png.fa53bdbcb93f4cc544a77c63712207ef.png

 

481x241vv2.png.1ba63714eb0c6cc7ad55fcf8155341e0.png

 

478x123vv2.png.f6c46227e9422779e47fe6e462b92d79.png

 

517x300vv2.png.4cf3ca2036109e229d2b28f66944556f.png

 

528x242vv2.png.630652d26c0d888649a1a3708328401e.png

 

 

 

MaxDB Installation

 

 

After the ASCS is installed we now install the MaxDB and load the content into it.

 

 

 

ralfmaxdb01:/Software/SWPM # ./sapinst

cd /Software/MaxDB

mkdir DB Patch

mv unzip 51052559_8.ZIP DB

mv 51054410_2.ZIP Patch/

cd DB

unzip 51052559_8.ZIP

 

564x273vv2.png.710e206418951a5ed2771e93b6f1dbbd.png

 

488x263vv2.png.9b534b7655494f03b10bea1765af1046.png

 

496x236vv2.png.74b1db9f844dd27c57ad1f908c8d6e70.png

 

499x322vv2.png.4b61613e7fe01041bd4ab12145dbe3cd.png

 

496x278vv2.png.4b06dd1d230d82dce3d54de790ae4e5a.png

 

491x189vv2.png.7bac5eb513120e4d1bf9c6b3f8265b2a.png

 

486x231vv2.png.db4f6ea6744ac855aa84de0bbcafdebb.png

 

485x234vv2.png.0b7faa318f7daf7ee73fcee1b0c802e2.png

 

487x354vv2.png.0741a019966a1d8d19738a39c0222400.png

 

487x281vv2.png.3db31c4cc70b405a97ba086a0cf27eba.png

 

488x278vv2.png.a073cc44dd3c7916cd8da60a0b55fff5.png

 

487x358vv2.png.b5c1fe9ed23737d764c5347e1424cb1f.png

 

484x283vv2.png.88110dd3bf1149f3250ba326a05a6365.png

 

483x175vv2.png.b850c4c6da73015fafbfc5f82b1a5496.png

 

 

 

Primary App Server installation

 

 

./sapinst

 

490x220vv2.png.fbf0d6e1fdf59b7bebfcef1d5b7641b6.png

 

491x296vv2.png.975c4ca2143305a96aa5458f5546ad7f.png

 

490x269vv2.png.35ebbe4133ff2a8188e16ad20f04a24b.png

 

490x175vv2.png.ad1cbef7ae80d6b525990c9d093561dc.png

 

 

 

Install the MaxDB Database Studio

 

 

SAP Help Portal

 

 

 

Installing or Upgrading Database Studio for SAP MaxDB | SAP Help Portal

 

577x179vv2.png.7f59015dca4b0245b601b2e5e3940856.png

 

Download SAPCAR for Windows and extract the MAXDBSTUDIO.sar archive in a separate folder.

 

Then call the sdbsetup.exe to install the MaxDB Studio

 

Backup the Database

 

 

HowTo - SAP MaxDB Backup with Database Manager CLI - MaxDB - Support Wiki

 

Before you can create snapshot based backups we need to take a full database backup. Then we can switch the logmode

 

su – c11adm

dbmcli -d C11 -u superdba,<pwd> user_getall

OK

control

superdba

dbmcli -d C11 -u superdba,<pwd> user_get superdba

OK

SERVERRIGHTS=UserMgm,InstallMgm,SystemCmd,DBFileRead,AccessUtility,Recovery,Backup,ParamFull,ParamCheckWrite,ParamRead,AccessSQL,ExecLoad,LoadSysTab,DBStop,DBStart,DBInfoRead,SharedMemoryMgm,SchedulerMgm,Scheduling,EvtDispMgm,EvtDisp

GUIRIGHTS=

SECONDPASSWORD=NO

DISABLED=NO

COMMENT=

USERTYPE=DBA

EXTERNAL_IDS=

MASTER_PW_ALTER_TIME=2023-03-07 18:51:54

 

Create an xuser key to be able password less access to the DB.

 

xuser set -U ADMIN -d C11 -u superdba,<pwd>

 

 

 

List the xuser entries

 

xuser -U ADMIN list

----------------------------------------------------------

XUSER Entry 5

--------------

Key :ADMIN

Username :SUPERDBA

UsernameUCS2 :S.U.P.E.R.D.B.A. . .. . . . . . . . . . .

Password :?????????

PasswordUCS2 :?????????

PasswordUTF8 :?????????

Dbname :C11

Nodename :<unspecified>

Sqlmode :<unspecified>

Cachelimit :-1

Timeout :-1

Isolation :-1

Charset :<unspecified>

 

Login as SUPERDBA using the XUSER key

 

dbmcli -U ADMIN

dbmcli on C11>

 

 

 

Create template d1 for data backup:

 

dbmcli on C11> backup_template_create d1 to FILE /sapdb/C11/backup/data/DAT0001 CONTENT DATA

 

 

 

Create template l1 for log backup:

 

dbmcli on DB1> backup_template_create l1 to FILE /sapdb/C11/backup/log/LOG0001 CONTENT LOG

 

 

 

Starting a backup

 

db_connect

backup_start d1

 

check the data backup location

 

ls -lh /sapdb/C11/backup/data/

-rw-rw---- 1 sdb sdba 24G Mar 7 19:39 DAT0001

 

 

 

Checking a backup after completion

 

medium_label d1

OK

Returncode 0

Date 20230307

Time 00193608

Server ralfmaxdb01

Database C11

Kernel Version Kernel 7.9.09 Build 005-123-259-005

Pages Transferred 0

Pages Left 0

Volumes

Medianame

Location /sapdb/C11/backup/data/DAT0001

Errortext

Label DAT_000000001

Is Consistent true

First LOG Page 6939

Last LOG Page

DB Stamp 1 Date 20230307

DB Stamp 1 Time 00193608

Page Count 3044252

Devices Used 1

Database ID ralfmaxdb01:C11_20230307_193608

Converter Page Count 1681

 

Short Presentation Title (sap.com)

 

As of SAP MaxDB Version 7.8 you can use external filer snapshot in combination with SAP MaxDB snapshot to create a consistent backup in online database mode.

 

 

 

As of version 7.7 you can freeze the data area of a SAP MaxDB using internal database snapshots.

 

A snapshot can be created in the ONLINE operational state.

 

As of SAP MaxDB version 7.8 you can perform a complete data backup with an external file system snapshot in the operational state ONLINE in combination with a SAP MaxDB Database Snapshot.

 

First a SAP MaxDB (internal) Snapshot is created followed by the external file snapshot.

 

While this backup procedure the database is in online mode and the users can work with the application. Moreover, this procedure guarantees that this external file system backup is included in the backup history.

 

The Log area is never part of this backup procedure.

 

605x425vv2.png.59b1322586bffedcf20192e04586b399.png

 

In response to this command, the system displays the following output:

 

OK

 

Returncode -8020

 

...

 

Max Used Data Page 0

 

 

 

The return code -8020 together with the number of maximum used data pages (Max Used Data Page), in this case 0, displays in this case that the complete data backup was successfully started.

 

 

 

Create the Snapshot

 

backup_template_create External_Snapshot TO EXTERNAL SNAPSHOT

db_connect

backup_start External_Snapshot

OK

Returncode -8020

Date 20230307

Time 00201047

Server ralfmaxdb01

Database C11

Kernel Version Kernel 7.9.09 Build 005-123-259-005

Pages Transferred 0

Pages Left 0

Volumes

Medianame External_Snapshot

Location

Errortext

Label DAT_000000002

Is Consistent true

First LOG Page 6940

Last LOG Page

DB Stamp 1 Date 20230307

DB Stamp 1 Time 00201047

DB Stamp 2 Date

DB Stamp 2 Time

Page Count

Devices Used 1

Database ID ralfmaxdb01:C11_20230307_193608

Max Used Data Page 0

Converter Page Count

---

 

 

 

take the snapshot with azacsnap on ANF than finish the backup

 

backup_finish External_Snapshot ExternalBackupID 202303071508

 

(backup ID e.g. date and time)

 

backup_finish External_Snapshot ExternalBackupID 202303071508

OK

Returncode 0

Date 20230307

Time 00201047

Server ralfmaxdb01

Database C11

Kernel Version Kernel 7.9.09 Build 005-123-259-005

Pages Transferred 0

Pages Left 0

Volumes

Medianame External_Snapshot

Location

Errortext

Label DAT_000000002

Is Consistent true

First LOG Page 6940

Last LOG Page

DB Stamp 1 Date 20230307

DB Stamp 1 Time 00201047

DB Stamp 2 Date

DB Stamp 2 Time

Page Count

Devices Used 1

Database ID ralfmaxdb01:C11_20230307_193608

Max Used Data Page 0

Converter Page Count

 

 

 

Check the logfile

 

tail -f ./sapdb/C11/data/wrk/C11/dbm.prt

23611 INF 7 DBMKnl Data: DBSTAMP1 DATE..... 20230307

23611 INF 7 DBMKnl Data: DBSTAMP1 TIME..... 00201047

23611 INF 7 DBMKnl Data: DBSTAMP2 DATE..... (null)

23611 INF 7 DBMKnl Data: DBSTAMP2 TIME..... (null)

23611 INF 7 DBMKnl Data: BD PAGE COUNT..... (null)

23611 INF 7 DBMKnl Data: TAPEDEVICES USED.. 1

23611 INF 7 DBMKnl Data: DB_IDENT.. ralfmaxdb01:C11_20230307_193608

23611 INF 7 DBMKnl Data: MAX USED DATA PNO. 0

23611 INF 7 DBMKnl Data: CONV PAGE COUNT.. (null)

2023-03-07 20:17:46 23611 INF 419 DBMSrv Command 'backup_finish' has ended with return code 0.

Restore using an Snapshot

 

 

HowTo - SAP MaxDB Recovery with Database Manager CLI - MaxDB - Support Wiki

 

632x438vv2.png.3f15a6322e76168f5e4f15907e25cd32.png

 

Recovery tests

 

Crash the system by sending the sysrequest trigger b

 

echo b > /proc/sysrq-trigger

 

umount the data volume before we restore the snapshot

 

umount /sapdb/C11/sapdata

 

restore the SnapShot

 

mediumvv2px400.png.8dc72283c7e56153eb6a56bb8577003d.png

 

Remount the volume and start the DB for the automated recovery

 

mount -a

 

 

 

go to Restore the database --> further down

 

 

 

Creating automated DB SnapShots

 

 

A MaxDB Snapshot must be created before taking a storage Snapshot. The database will be set into a consistent state by quiescing the database. The following steps show how to perform database backup by using a storage Snapshot copy.

 

 

 

Install the Azure CLI on Linux | Microsoft Docs (SLES)

 

 

 

Download the azacsnap tool

 

https://aka.ms/azacsnapinstaller

 

Get started with Azure Application Consistent Snapshot tool for Azure NetApp Files | Microsoft Learn

 

 

 

1612412 - SAP MaxDB: How does a database backup with external file system backups take place?

 

1928060 - Data backup and recovery with file system backup - SAP ONE Support Launchpad

 

2282054 - Background DBM server - SAP ONE Support Launchpad

 

 

 

SAP MaxDB | SAP Community

 

Configure azacsnap

 

 

Install the Azure Application Consistent Snapshot tool for Azure NetApp Files | Microsoft Learn

 

Azacsnap is supporting only HANA, DB2 and Oracle at the moment. It is, however, possible to take a snapshot from the data volume and use the new feature in the version 6 with pre and post automation.

 

Create the service principal for your subscription and install azacsnap – in the Azure Portal

 

Store the output in a file I used /tmp/auth.json

 

 

 

az ad sp create-for-rbac --name "AzAcSnap" --role Contributor --scopes /subscriptions/{subscription-id} --sdk-auth

 

 

 

You will get an output which looks similar to this:

 

{

"clientId": "0815**4711-4**-a91f-d937*********1",

"clientSecret": "d~_8Q~****Zk*****Y_********",

"subscriptionId": "47110815-***-****-***-**********",

"tenantId": "K47110815-****-4ecc-bda0-**********",

"activeDirectoryEndpointUrl": "Sign in to your account",

"resourceManagerEndpointUrl": "https://management.azure.com/",

"activeDirectoryGraphResourceId": "https://graph.windows.net/",

"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",

"galleryEndpointUrl": "https://gallery.azure.com/",

"managementEndpointUrl": "https://management.core.windows.net/"

}

 

 

 

Create an auth.conf file and copy the content into this file

 

vi /tmp/auth.json

 

 

 

ls -l /Software/azacsnap*

admin01 users 16478438 Mar 8 15:30 /Software/azacsnap_7a_(1AA8343)_installer.run

 

 

 

Install azacsnap

 

 

cd /Software/

ralfmaxdb01:/Software # chmod 755 azacsnap_7a_\(1AA8343\)_installer.run

./azacsnap_7a_\(1AA8343\)_installer.run -I

 

 

 

Configure azacsnap

 

su - azacsnap

azacsnap -c configure --configuration=new

Building new config file

Add comment to config file (blank entry to exit adding comments): MaxDB

Add comment to config file (blank entry to exit adding comments):

Enter the database type to add, 'hana', 'oracle', 'db2', or 'exit' (to save and exit): hana

=== Add SAP HANA Database details ===

HANA SID (e.g. H80): C11

HANA Instance Number (e.g. 00): 00

HANA HDB User Store Key (e.g. `hdbuserstore List`): ADMIN

HANA Server's Address (hostname or IP address): 10.6.0.4

Do you need AzAcSnap to automatically disable/enable backint during snapshot? (y/n) [n]:

=== Azure NetApp Files Storage details ===

Are you using Azure NetApp Files for the database? (y/n) [n]: y

Enter new value for 'ANF Backup (none, renameOnly)' (current = 'none'): renameOnly

--- DATA Volumes have the Application put into a consistent state before they are snapshot ---

Add Azure NetApp Files resource to DATA Volume section of Database configuration? (y/n) [n]:

--- OTHER Volumes are snapshot immediately without preparing any application for snapshot ---

Add Azure NetApp Files resource to OTHER Volume section of Database configuration? (y/n) [n]: y

Full Azure NetApp Files Storage Volume Resource ID (e.g. /subscriptions/.../resourceGroups/.../providers/Microsoft.NetApp/netAppAccounts/.../capacityPools/Premium/volumes/...): /subscriptions/da/resourceGroups/ralfMaxDB/providers/Microsoft.NetApp/netAppAccounts/ralfmaxdbanf/capacityPools/ralfMaxDB/volumes/C11data

Service Principal Authentication filename or Azure Key Vault Resource ID (e.g. auth-file.json or https://...): auth.json

Add Azure NetApp Files resource to OTHER Volume section of Database configuration? (y/n) [n]:

=== Azure Managed Disk details ===

Are you using Azure Managed Disks for the database? (y/n) [n]:

=== Azure Large Instance (Bare Metal) Storage details ===

Are you using Azure Large Instance (Bare Metal) for the database? (y/n) [n]:

Enter the database type to add, 'hana', 'oracle', 'db2', or 'exit' (to save and exit): exit

Editing configuration complete, writing output to 'azacsnap.json'.

 

 

 

Test the storage connection, at this point we “only” can test the storage connection. The ASE backup-mode will be scheduled as “runbefore” and “runafter”.

 

azacsnap -c test --test storage –preview

PASSED: Storage test completed successfully for all 'other' Volumes

END : Storage tests complete

END : Test process complete for 'storage'

 

 

 

Create the .bashrc for the azacsnap user (compare the environment from the SIDadm user)

 

vi .bashrc

test -s ~/.alias && . ~/.alias || true

export PATH=$PATH:/sapdb/clients/C11/bin:/sapdb/programs/bin

export LD_LIBRARY_PATH=/usr/sap/C11/SYS/exe/run:/usr/sap/C11/SYS/exe/uc/linuxx86_64:/sapdb/clients/C11/lib

export LANG=C.UTF-8

 

 

 

create the user key

 

xuser set -U ADMIN -d C11 -u superdba,<pwd>

 

 

 

Test the dbmcli connection using the user-key

 

dbmcli -U ADMIN

dbmcli on C11>quit

 

Create the two Quiece and Unquiece scripts. (no Microsoft support) this is only an example.

 

vi cat MaxDBQuiece.sh

#!/bin/bash

SID="$1"

KEY="$2"

DATE="`date +%m-%d-%Y`"

LOGFILE="/tmp/MaxDM_Snapshot${SID}.log"

# MAX LOGFILE SIZE is 2 MB

MAXSIZE=2000000

# Get file size

FILESIZE=$(stat -c%s "$LOGFILE")

if [[ "$SID" == "" || "$KEY" == "" ]]; then

echo "Usage: `basename $0` <SID> <USERSTOREKEY>" exit 1

fi

sqlFile=$(mktemp)

cat > $sqlFile << EOF

background_server_start myserver

background_server_execute myserver db_connect

background_server_get_reply myserver -wait

background_server_execute myserver backup_start External_Snapshot DATA

background_server_get_reply myserver -wait

EOF

echo "Size of $LOGFILE = $FILESIZE bytes." >>$LOGFILE

if (( $FILESIZE > $MAXSIZE)); then

echo "Moving the MaxDM Snapshot logfile to a backup" >>$LOGFILE

mv $LOGFILE ${LOGFILE}-${DATE}

else

echo "Logfilesize OK" >>$LOGFILE

fi

echo "`date` Creating MaxDB SnapShot" >>$LOGFILE

#rc=`dbmcli -U $KEY -i $sqlFile -b | head -1 | tr -d "[:blank:]"`

dbmcli -U $KEY -uUTL -i $sqlFile >>$LOGFILE

echo "Returncode = $?" >>$LOGFILE

rm $sqlFile

 

 

 

vi MaxDBunQuiece.sh

#!/bin/bash

SID="$1"

KEY="$2"

DATE="`date +%m-%d-%Y`"

LOGFILE="/tmp/MaxDM_Snapshot${SID}.log"

# MAX LOGFILE SIZE is 2 MB

MAXSIZE=2000000

# Get file size

FILESIZE=$(stat -c%s "$LOGFILE")

if [[ "$SID" == "" || "$KEY" == "" ]]; then

echo "Usage: `basename $0` <SID> <USERSTOREKEY>" exit 1

fi

sqlFile=$(mktemp)

cat > $sqlFile << EOF

background_server_execute myserver backup_finish External_Snapshot ExternalBackupID ANFSnapShot

background_server_get_reply myserver -wait

background_server_exit myserver

EOF

echo "Size of $LOGFILE = $FILESIZE bytes." >>$LOGFILE

if (( $FILESIZE > $MAXSIZE)); then

echo "Moving the MaxDM Snapshot logfile to a backup" >>$LOGFILE

mv $LOGFILE ${LOGFILE}-${DATE}

else

echo "Logfilesize OK" >>$LOGFILE

fi

echo "`date` Creating MaxDB SnapShot" >>$LOGFILE

#rc=`dbmcli -U $KEY -i $sqlFile -b | head -1 | tr -d "[:blank:]"`

dbmcli -U $KEY -uUTL -i $sqlFile >>$LOGFILE

echo "Returncode = $?" >>$LOGFILE

rm $sqlFile

 

 

 

chmod 755 MaxDB*

 

create the cron script to schedule the azacsnap call

 

vi cron_backup_daily.sh

#!/bin/bash

BACKUP_PREFIX="daily"

PRIMARY_BACKUP_RETENTION=2

SAPSID="C11"

USERKEY="ADMIN"

## AZACSNAP - PRIMARY BACKUP ##

#HANA_CLIENT_PATH=`find /hana/shared/ -name hdbclient -type d -print 2>/dev/null`

#export PATH=$PATH:$HANA_CLIENT_PATH

#

echo "Executing primary backup with prefix $BACKUP_PREFIX (retention ${PRIMARY_BACKUP_RETENTION})."

/home/azacsnap/bin/azacsnap -c backup --volume other --prefix $BACKUP_PREFIX --retention $PRIMARY_BACKUP_RETENTION -v --runbefore "/home/azacsnap/bin/MaxDBQuiece.sh $SAPSID $USERKEY" --runafter "/home/azacsnap/bin/MaxDBunQuiece.sh $SAPSID $USERKEY" –preview

 

 

chmod 755 cron_backup_daily.sh

 

Schedule the daily backup in the cron

 

crontab -e

# create daily backups twice a day and replicate them via ANF backup

0 2,14 * * * /home/azacsnap/bin/cron_backup_daily.sh

 

Check the backup history in MaxDB

 

backup_history_list -c label,action,pages,stop,media

OK

END

|HISTLOST | | | |

|HISTLOST | | | |

DAT_000000001|SAVE WARM|44272|2023-03-07 19:39:57|d1 |

LOG_000000001|SAVE WARM| 6952|2023-03-07 19:45:09|l1 |

DAT_000000002|SAVE WARM| 0|2023-03-07 20:17:45|External_Snapshot |

DAT_000000005|SAVE WARM| 0|2023-03-08 16:52:18|External_Snapshot |

DAT_000000008|SAVE WARM| 0|2023-03-08 17:10:02|External_Snapshot |

 

 

 

Show the MaxDB Templates

 

backup_template_show ALL

OK

 

NAME d1

CONTENT DATA

CREATIONDATE 20230307193424

MODIFICATIONDATE 20230307193424

TOOL NONE

BLOCKSIZE 8

DATACARRIER

TYPE FILE

LOCATION /sapdb/C11/backup/data/DAT0001

OVERWRITE NO

COMPRESSED NO

 

NAME l1

CONTENT AUTO

CREATIONDATE 20230307193440

MODIFICATIONDATE 20230307193440

TOOL NONE

BLOCKSIZE 8

DATACARRIER

TYPE FILE

LOCATION /sapdb/C11/backup/log/LOG0001

OVERWRITE NO

COMPRESSED NO

 

NAME External_Snapshot

CONTENT DATA

CREATIONDATE 20230307201008

MODIFICATIONDATE 20230307201008

TOOL DBMC

BLOCKSIZE 8

DATACARRIER

TYPE EXTERNAL

LOCATION

OVERWRITE NO

COMPRESSED NO

 

List the taken SnapShots

 

azacsnap -c details --preview

>>> Preview Feature 'ANF Backup' enabled in config file 'azacsnap.json'.

================================================================================

PREVIEWS ARE PROVIDED "AS-IS," "WITH ALL FAULTS," AND "AS AVAILABLE," AND

ARE EXCLUDED FROM THE SERVICE LEVEL AGREEMENTS AND LIMITED WARRANTY

Preview Terms Of Use | Microsoft Azure

================================================================================

User has enabled execution of PREVIEW features with '--preview'.

--------------------------------------------------------------------------------

List snapshot details called with snapshotFilter ''

#, Volume, SnapshotName, Created

#1, C11data, Backup_202303141218, 14-Mar-2023 11:18:44am (UTC+0)

#2, C11data, Backup_202303141215, 14-Mar-2023 11:15:20am (UTC+0)

#3, C11data, Backup_202303131057, 13-Mar-2023 9:57:42am (UTC+0)

 

 

Restore using azacsnap

 

 

Shutdown SAP and ASE (if possible – if not simply “kill” the DB. We are restoring anyway.

 

stopsap all

 

 

 

umount the data volume

 

umount /sapdb/C11/sapdata

 

 

 

At the moment azacsnap does not support “Revert Volume” for ANF. If you would like to keep the volume names you have the option to “revert a volume using the Azure Portal.

 

See:

 

su – azacsnap

 

cd bin

 

 

 

azacsnap -c restore --dbsid C11 --restore revertvolume --configfile azacsnap.json --snapshotfilter daily__F44BFE3175B__c11data

 

...

 

Azure NetApp Files volumes not supported for revertvolume, will not revert volume.

 

 

 

With ANF you do have the option to clone a volume. This is probably the better option anyway. How to clone a volume for a recovery is demonstrated here:

 

 

 

AzAcSnap is designed to restore a collection of dataVolumes and otherVolumes. AzAcSnap makes sure all the dataVolumes share the same snapshot to be restored and the otherVolumes the latest snapshot to be restored. In a deployment with multiple data volumes (e.g., SAP HANA Scale-Out) this can save a lot of time trying to ensure all the snapshots match in the Azure Portal before cloning or reverting the volumes. This means when using a setup with custom scripts to quiesce/unquiesce the database it's necessary to create a copy of the backup configfile and change "otherVolume" to "dataVolume" and change "dataVolume" to "otherVolume" effectively switching them.

 

 

 

cp azacsnap.json azacsnap_snaptovol.json

vi azacsnap_snaptovol.json

"anfStorage": [

{

"otherVolume": [],

"dataVolume": [

 

 

 

Down here are the specifications of your ANF volumes à keep unchanged change only dataVolume to otherVolume and otherVolume to dataVolume.

 

list the available SnapShots

 

azacsnap -c details

List snapshot details called with snapshotFilter ''

#, Volume, SnapshotName

#1, ralfC11data, daily__F44BFE3175B__c11data

 

 

 

azacsnap -c restore --dbsid C11 --restore revertvolume --configfile azacsnap_snaptovol.json --snapshotfilter daily__F44BFE3175B__c11data

 

 

 

create the new /etc/fstab

 

 

 

pwd

/home/azacsnap/bin

 

grep rwclone ./logs/*.log

… Creating new volume 'ralfc11data-rwclone-20221111-0732'

… Volume 'ralfc11data-rwclone-20221111-0732' successfully created from snapshot.

… Creating new volume 'ralfc11sybase-rwclone-20221111-0732'

… Volume 'ralfc11sybase-rwclone-20221111-0732' successfully created from snapshot.

 

 

 

Mount the cloned volume to the sapdata directory

 

mount -a

 

 

 

Recover the database

 

 

dbmcli -U ADMIN

dbmcli on C11>backup_history_list -c label,action,pages,stop,media

OK

...

.. |

DAT_000000030|SAVE WARM|0|2023-03-14 11:18:04|External_Snapshot |

DAT_000000031|SAVE WARM|0|2023-03-14 11:18:57|External_Snapshot |

---

dbmcli on C11>quit

 

Restore the latest SnapShot

 

dbmcli -U ADMIN

db_admin

OK

db_connect

OK

recover_start External_Snapshot DATA ExternalBackupID DAT_000000031

OK

 

 

 

Start the DB and SAP

 

The Database will automatically apply the latest logfiles to the database.

 

su – c11adm

startsap

 

 

 

Upgrade MaxDB

 

 

su - c11adm

stopsap

 

as root

 

cd /Software/MaxDB/Patch/MaxDB_7.9___SP10_Build_05_/DATA_UNITS/MAXDB_LINUX_X86_64

./SDBUPD –d C11 -u control,<pwd>

 

 

 

ANF Cross Region Replication

 

 

Azure NetApp Files volume replication is supported between various Azure regional pairs and non-standard pairs. Azure NetApp Files volume replication is currently available between the following regions. You can replicate Azure NetApp Files volumes from Regional Pair A to Regional Pair B, and vice versa.

 

650x403vv2.png.15cc86f66e02cfee9f4340e366f419d3.png

 

 

 

555x448vv2.png.8d5f388042485f0fccb7f7e176367bb0.png

 

 

 

Cross-region replication of Azure NetApp Files volumes | Microsoft Learn

 

 

 

Azure NetApp Files cross region replication and new enhancements in preview | Azure Blog and Updates | Microsoft Azure

 

 

 

Cross-zone replication of Azure NetApp Files volumes | Microsoft Learn

 

 

 

Create an storage account in the destination region (must be the paired region (see table).

 

mediumvv2px400.png.8e8191479a85b811781613e57cac1941.png

 

 

 

Create a VNET (if not already existing in the DR region)

 

617x477vv2.png.0e04347295d435e752336a9354e7320f.png

 

723x340vv2.png.e147059129fab043eb8107945127817b.png

 

Create a Capacity Pool for the DR volume (can be a different QoS level)

 

686x163vv2.png.894d77fec0d458555b6ca3338980a4a3.png

 

Create the target DR volume.

 

On the destination storage account overview select Add data Protection

 

636x299vv2.png.67400cea0e6c5a2b13282e51cf87e6f9.png

 

obviously the new volume should have the same size as the destination volume.

 

608x495vv2.png.53bf5db5fd101bbd442c5140869fdd5e.png

 

514x297vv2.png.0dc98effdc47ab6f768d75d273fb0028.png

 

Schedule an hourly replication for the data volume

 

549x95vv2.png.14d7bf3309b2a4e55726309b95b54eb3.png

 

 

 

Now authorize the source volume for the replication.

 

599x250vv2.png.459fc50680a55312cf8bc7453367a402.png

 

Specify the volume resource ID of the DR volume to the Source volume

 

613x216vv2.png.5064674cc9864837ce9dd33081dc5d19.png

 

583x134vv2.png.c0d71ff65999f8c5ce7f289dc1e075ea.png

 

Finished

 

 

 

Now repeat the same for the log backup volume but schedule the transfer every 10 Minutes

 

587x163vv2.png.edfba771c6a11ee5ab61c38f0a997070.png

 

 

 

Crontab for snapshots and logbackup

 

 

crontab -l

# create daily backups twice a day and replicate them via ANF backup

0 2,14 * * * /home/azacsnap/bin/cron_backup_daily.sh

*/10 * * * * /home/azacsnap/bin/cron_logbackup.sh

 

The second part with the log volume is optional if you set the autolog_on to 300 second (5 minutes)

 

Create the logbackup script

 

 

vi cron_logbackup.sh

#!/bin/bash

SID="$1"

DATE="`date +%m-%d-%Y`"

LOGFILE="/tmp/MaxDM_Logbackup${SID}.log"

# MAX LOGFILE SIZE is 2 MB

MAXSIZE=2000000

# Get file size

FILESIZE=$(stat -c%s "$LOGFILE")

if [[ "$SID" == "" ]]; then

echo "Usage: `basename $0` <SID> " exit 1

fi

echo "Size of $LOGFILE = $FILESIZE bytes." >>$LOGFILE

if (( $FILESIZE > $MAXSIZE)); then

echo "Moving the MaxDM logbackup logfile to a backup" >>$LOGFILE

mv $LOGFILE ${LOGFILE}-${DATE}

else

echo "Logfilesize OK" >>$LOGFILE

fi

echo "`date` Creating MaxDB Logbackup" >>$LOGFILE

 

#rc=`dbmcli -U $KEY -i $sqlFile -b | head -1 | tr -d "[:blank:]"`

dbmcli -U ADMIN -uUTL -c backup_start l1 >>$LOGFILE

echo "Returncode = $?" >>$LOGFILE

 

 

 

as an alternative you can enable autolog backup to 300 seconds

 

dbmcli -U ADMIN

dbmcli on C11>db_connect

dbmcli on C11>autolog_off

dbmcli on C11>autolog_on l1 INTERVAL 300

dbmcli on C11>db_stop

dbmcli on C11>db_start

dbmcli on C11>exit

 

 

 

END

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...