MaxDB

Following sections will show how to configure your MaxDB system to use cxLink Backup functionalities.

All commands in this guide are executed using an SAP Database with SID M10. Please replace M10 with your actual database SID.

Please note that SAP Database Studio is used during this guide to illustrate different cxLink Backup functionalities.

Only MaxDB SAP instances are supported by cxLink Backup. It is not possible to use cxLink Backup for a MaxDB standalone database.

Topics


To have MaxDB database using cxLink Backup follow the steps:

  • Create a configuration file named M10.bsi under /opt/emory/conf directory has to be created with the following recommended contents:
BACKINT /opt/emory/emory
INPUT /opt/emory/tmp/M10.bsi.in
OUTPUT /opt/emory/tmp/M10.bsi.out
ERROROUTPUT /opt/emory/tmp/M10.bsi.err
PARAMETERFILE /opt/emory/conf/M10.cfg
TIMEOUT_SUCCESS 60
TIMEOUT_FAILURE 60
ORIGINAL_RUNDIRECTORY /opt/emory/tmp
CHECK_AVAILABILITY YES
  • Set parameter BSI_ENV under MaxDB configuration set:
dbmcli -d M10 -n emorymaxdb -u <dbm_operator>,<dbm_operator_password> dbm_configset -raw BSI_ENV /opt/emory/conf/M10.bsi

Note: remember all examples here correspond to a MaxDB database with SID M10. Change M10 for your actual MaxDB SID. Change also emorymaxdb by your MaxDB server hostname.

Configure backup templates

Backup templates can be managed from SAP Database Studio, command line (dbmcli) and SAP GUI, and to have cxLink Backup working they must be set using the following mandatory parameters:

  • Device Type: pipe
  • Backup Tool: backint

All remaining attributes can be set at your convenience followin SAP MaxDB documentation.

This is an example of a creation of a complete data backup template named Complete from command line using dbmcli and medium_putopen in new window command:

medium_put Complete /tmp/pipe PIPE DATA 0 8 NO NO backup_replace BACK

DATA parameter stands for a complete backup type; PAGES would correspond to an incremental template and LOG to a log backup one.

This is an example of a complete data backup template from SAP Database Studio:

MaxDB complete data backup template

And the same for a parallel backup template:

MaxDB complete data backup parallel template

To configure how many parallel processes are going to be used during a backup operation, MaxBackupMedia MaxDB parameter has to be set.

You can do all template related configuration from SAP GUI as well using DB13 transaction.

This is an example of a complete data backup template using SAP GUI:

MaxDB complete data backup template from DB13

Configure Autolog

As per SAP documentation Autolog backup using pipes is not possible, so Autolog is not possible to be configured for cxLink Backup.

Log Backup to a Pipeopen in new window

You can execute a backup operation using cxLink Backup from:

  • Command line using dbmcli
  • DB13 transaction from SAP GUI
  • SAP Database Studio

Command Line Backup

All backups are executed using backup_start command and specifiying a template. The backup template defines backup level: complete, incremental or log backup.

Using a complete backup template named Complete and a database with SID M10:

emorymaxdb:sdb 999> dbmcli -d M10 -u <dbm_operator>,<dbm_operator_password>
dbmcli on M10>db_connect
OK

---
dbmcli on M10>backup_start Complete
OK
Returncode              0
Date                    20220307
Time                    00155458
Server                  emorymaxdb
Database                M10
Kernel Version          Kernel    7.9.10   Build 004-123-265-969
Pages Transferred       3473048
Pages Left              0
Volumes                 1
Medianame               Complete
Location                /tmp/m10_complete_pipe
Errortext
Label                   DAT_000000182
Is Consistent           true
First LOG Page          156010
Last LOG Page
DB Stamp 1 Date         20220307
DB Stamp 1 Time         00155457
DB Stamp 2 Date
DB Stamp 2 Time
Page Count              3473025
Devices Used            1
Database ID             emorymaxdb:M10_20211014_112604
Max Used Data Page      0
Converter Page Count    1874

---
dbmcli on M10>

In the case of an incremental backup an incremental backup template has to be used and in the case of a log backup a log backup one.

Regarding parallelism and compression, the same applies; it is the template what defines both.

SAP GUI Backup

As explained in the last section, what defines the backup operation to perform is the backup template, so the way a MaxDB backup operation is executed from DB13 transaction is quite simple, just schedule a new action Complete Data Backup and set a complete backup template.

Taking into account that we already defined a complete backup template named Complete:

DB13 Complete Data Backup

SAP Database Studio Backup

And the same applies when a backup operation is executed from SAP Database Studio

Taking into account that we already defined a complete backup template named Complete:

SAP Database Studio Complete Data Backup

Command line Recover

You can restoreopen in new window your MaxDB database using dbmcli.

Those are the steps for a SID M10:

First check backup history list. It is important to execute with -e option to show backup external information.

dbmcli -d M10 -u <dbm_operator>,<dbm_operator_password>

dbmcli on M10>backup_history_open
OK

---
dbmcli on M10>backup_history_list -e

...

6227529A0027|LOG_000000044|SAVE WARM|2022-03-07 16:01:45|2022-03-08 13:56:14|2022-03-08 13:56:58|2022-03-08 13:57:02|    156012|    168070|   |Log                                                             |     12072|         0|         0|                                                   |
E:UNKNOWN|M10 20220308135659 /tmp/m10_log_pipe|
622751EE0024|DAT_000000189|SAVE WARM|2022-03-08 13:54:06|2022-03-08 13:54:06|2022-03-08 13:54:06|2022-03-08 13:55:58|    168061|          |NO |Complete                                                        |   3483552|         1|         0|                                                   |
E:UNKNOWN|M10 20220308135408 /tmp/m10_complete_pipe|
6227512F0022|PAG_000000188|SAVE WARM|2022-03-08 13:50:55|2022-03-08 13:50:55|2022-03-08 13:50:55|2022-03-08 13:51:00|    168056|          |NO |Incremental                                                     |       240|         1|         0|                                                   |
E:UNKNOWN|M10 20220308135056 /tmp/m10_incremental_pipe|
62263A580020|PAG_000000187|SAVE WARM|2022-03-07 18:01:12|2022-03-07 18:01:12|2022-03-07 18:01:12|2022-03-07 18:01:19|    165066|          |NO |Incremental                                                     |       112|         1|         0|                                                   |
... 

The line starting with E: corresponds to the external backup information. First field is availavility information, second one the external backup id

Put the database in admin state and connect:

dbmcli on M10>db_admin
OK

---
dbmcli on M10>db_connect
OK

---

Start recover from a complete backup template; this will start restore from backup template named Complete and backup identified by external id M10 20220308135408 /tmp/m10_complete_pipe:

dbmcli on M10>recover_start Complete DATA EBID "M10 20220308135408 /tmp/m10_complete_pipe"
OK
Returncode              0
Date                    20220310
Time                    00105624
Server                  emorymaxdb
Database                M10
Kernel Version          Kernel    7.9.10   Build 004-123-265-969
Pages Transferred       3483552
Pages Left              0
Volumes                 1
Medianame               Complete
Location                /tmp/m10_complete_pipe
Errortext
Label                   DAT_000000189
Is Consistent           true
First LOG Page          168061
Last LOG Page
DB Stamp 1 Date         20220308
DB Stamp 1 Time         00135406
DB Stamp 2 Date
DB Stamp 2 Time
Page Count              3483508
Devices Used            1
Database ID             emorymaxdb:M10_20211014_112604
Max Used Data Page      0
Converter Page Count    1886

---
dbmcli on M10>

Recover completed successfully and the log page that system expects after backup is 168061, as you can read from First LOG page field.

That means if you want to recover to a more recent point in time, you must recover log backup corresponding to that log page.

You can see this executing db_restartinfo command:

dbmcli on M10>db_restartinfo
OK
Used LOG Page                   168061
First LOG Page                  0
Restartable                     1
Id Restart Record               emorymaxdb:M10_20211014_112604
Id LOG Info                     emorymaxdb:M10_20211014_112604
Consistent                      1
Log Volume Enabled              1
Log Auto Overwrite              0
Master Servernode               EMORYMAXDB
Converter Version               4744
Oldest Compatible Version       7.9.10.04
Queue Count                     2
Repository Imports              NO
Last Known Log Io Sequence      174871
Hot Standby Role                None

---
dbmcli on M10>

From that command you can also see the database is ready to be started by checking Restartable attribute value.

You can see from backup history that log backup LOG_000000044 contains pages from 156012 to 168070.

To recover from that backup:

dbmcli on M10>recover_start Log LOG EBID "M10 20220308135659 /tmp/m10_log_pipe"
OK
Returncode              0
Date                    20220310
Time                    00120156
Server                  emorymaxdb
Database                M10
Kernel Version          Kernel    7.9.10   Build 004-123-265-969
Pages Transferred       552
Pages Left              0
Volumes
Medianame               Log
Location                /tmp/m10_log_pipe
Errortext
Label                   LOG_000000044
Is Consistent
First LOG Page          156012
Last LOG Page           168070
DB Stamp 1 Date         20220307
DB Stamp 1 Time         00160145
DB Stamp 2 Date         20220308
DB Stamp 2 Time         00135614
Page Count              12059
Devices Used            1
Database ID             emorymaxdb:M10_20211014_112604
Max Used Data Page
Converter Page Count

---
dbmcli on M10>

In our case this is the last log backup we have and database can be started:

dbmcli on M10>db_online
OK

---
dbmcli on M10>

SAP Database Studio Recover

You can recover a backup easyly using SAP Database Studio.

Only last complete backup recovery will be covered in this guide, to do so follow the steps:

Access database administration with an administrator account, select Recovery... option:

Recovery option

Put your database in Admin state:

Admin State

Select Recover last backup option:

Admin State

Admin State

Wait until restore finishes:

Admin State

Where are your backups stored?

They will be stored in the target bucket as:

<SAP_SID>/<DB>/<year>/<month>/<day>/<timestamp>.<MaxDB_Backup_Label>.<full|partial|archive>

Example: DBD/DBD/2022/02/25/20220307155459.DAT_000000182.FULL