Skip to main content

SAP 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:

_10
BACKINT /opt/emory/emory
_10
INPUT /opt/emory/tmp/M10.bsi.in
_10
OUTPUT /opt/emory/tmp/M10.bsi.out
_10
ERROROUTPUT /opt/emory/tmp/M10.bsi.err
_10
PARAMETERFILE /opt/emory/conf/M10.cfg
_10
TIMEOUT_SUCCESS 60
_10
TIMEOUT_FAILURE 60
_10
ORIGINAL_RUNDIRECTORY /opt/emory/tmp
_10
CHECK_AVAILABILITY YES

  • Set parameter BSI_ENV under MaxDB configuration set:

_10
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_put command:


_10
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 Pipe

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:


_35
emorymaxdb:sdb 999> dbmcli -d M10 -u <dbm_operator>,<dbm_operator_password>
_35
dbmcli on M10>db_connect
_35
OK
_35
_35
---
_35
dbmcli on M10>backup_start Complete
_35
OK
_35
Returncode 0
_35
Date 20220307
_35
Time 00155458
_35
Server emorymaxdb
_35
Database M10
_35
Kernel Version Kernel 7.9.10 Build 004-123-265-969
_35
Pages Transferred 3473048
_35
Pages Left 0
_35
Volumes 1
_35
Medianame Complete
_35
Location /tmp/m10_complete_pipe
_35
Errortext
_35
Label DAT_000000182
_35
Is Consistent true
_35
First LOG Page 156010
_35
Last LOG Page
_35
DB Stamp 1 Date 20220307
_35
DB Stamp 1 Time 00155457
_35
DB Stamp 2 Date
_35
DB Stamp 2 Time
_35
Page Count 3473025
_35
Devices Used 1
_35
Database ID emorymaxdb:M10_20211014_112604
_35
Max Used Data Page 0
_35
Converter Page Count 1874
_35
_35
---
_35
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 restore 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.


_18
dbmcli -d M10 -u <dbm_operator>,<dbm_operator_password>
_18
_18
dbmcli on M10>backup_history_open
_18
OK
_18
_18
---
_18
dbmcli on M10>backup_history_list -e
_18
_18
...
_18
_18
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| |
_18
E:UNKNOWN|M10 20220308135659 /tmp/m10_log_pipe|
_18
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| |
_18
E:UNKNOWN|M10 20220308135408 /tmp/m10_complete_pipe|
_18
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| |
_18
E:UNKNOWN|M10 20220308135056 /tmp/m10_incremental_pipe|
_18
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| |
_18
...

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:


_10
dbmcli on M10>db_admin
_10
OK
_10
_10
---
_10
dbmcli on M10>db_connect
_10
OK
_10
_10
---

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:


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


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


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

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


_10
dbmcli on M10>db_online
_10
OK
_10
_10
---
_10
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