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
Configure backint-related parameters
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:
_10BACKINT /opt/emory/emory_10INPUT /opt/emory/tmp/M10.bsi.in_10OUTPUT /opt/emory/tmp/M10.bsi.out_10ERROROUTPUT /opt/emory/tmp/M10.bsi.err_10PARAMETERFILE /opt/emory/conf/M10.cfg_10TIMEOUT_SUCCESS 60_10TIMEOUT_FAILURE 60_10ORIGINAL_RUNDIRECTORY /opt/emory/tmp_10CHECK_AVAILABILITY YES
- Set parameter BSI_ENV under MaxDB configuration set:
_10dbmcli -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:
_10medium_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:
And the same for a parallel backup 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:
Configure Autolog
As per SAP documentation Autolog backup using pipes is not possible, so Autolog is not possible to be configured for cxLink Backup.
Backup and restore your database using cxLink Backup
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:
_35emorymaxdb:sdb 999> dbmcli -d M10 -u <dbm_operator>,<dbm_operator_password>_35dbmcli on M10>db_connect_35OK_35_35---_35dbmcli on M10>backup_start Complete_35OK_35Returncode 0_35Date 20220307_35Time 00155458_35Server emorymaxdb_35Database M10_35Kernel Version Kernel 7.9.10 Build 004-123-265-969_35Pages Transferred 3473048_35Pages Left 0_35Volumes 1_35Medianame Complete_35Location /tmp/m10_complete_pipe_35Errortext_35Label DAT_000000182_35Is Consistent true_35First LOG Page 156010_35Last LOG Page_35DB Stamp 1 Date 20220307_35DB Stamp 1 Time 00155457_35DB Stamp 2 Date_35DB Stamp 2 Time_35Page Count 3473025_35Devices Used 1_35Database ID emorymaxdb:M10_20211014_112604_35Max Used Data Page 0_35Converter Page Count 1874_35_35---_35dbmcli 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:
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:
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.
_18dbmcli -d M10 -u <dbm_operator>,<dbm_operator_password>_18_18dbmcli on M10>backup_history_open_18OK_18_18---_18dbmcli on M10>backup_history_list -e_18_18..._18_186227529A0027|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| |_18E:UNKNOWN|M10 20220308135659 /tmp/m10_log_pipe|_18622751EE0024|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| |_18E:UNKNOWN|M10 20220308135408 /tmp/m10_complete_pipe|_186227512F0022|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| |_18E:UNKNOWN|M10 20220308135056 /tmp/m10_incremental_pipe|_1862263A580020|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:
_10dbmcli on M10>db_admin_10OK_10_10---_10dbmcli on M10>db_connect_10OK_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:
_30dbmcli on M10>recover_start Complete DATA EBID "M10 20220308135408 /tmp/m10_complete_pipe"_30OK_30Returncode 0_30Date 20220310_30Time 00105624_30Server emorymaxdb_30Database M10_30Kernel Version Kernel 7.9.10 Build 004-123-265-969_30Pages Transferred 3483552_30Pages Left 0_30Volumes 1_30Medianame Complete_30Location /tmp/m10_complete_pipe_30Errortext_30Label DAT_000000189_30Is Consistent true_30First LOG Page 168061_30Last LOG Page_30DB Stamp 1 Date 20220308_30DB Stamp 1 Time 00135406_30DB Stamp 2 Date_30DB Stamp 2 Time_30Page Count 3483508_30Devices Used 1_30Database ID emorymaxdb:M10_20211014_112604_30Max Used Data Page 0_30Converter Page Count 1886_30_30---_30dbmcli 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:
_20dbmcli on M10>db_restartinfo_20OK_20Used LOG Page 168061_20First LOG Page 0_20Restartable 1_20Id Restart Record emorymaxdb:M10_20211014_112604_20Id LOG Info emorymaxdb:M10_20211014_112604_20Consistent 1_20Log Volume Enabled 1_20Log Auto Overwrite 0_20Master Servernode EMORYMAXDB_20Converter Version 4744_20Oldest Compatible Version 7.9.10.04_20Queue Count 2_20Repository Imports NO_20Last Known Log Io Sequence 174871_20Hot Standby Role None_20_20---_20dbmcli 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:
_30dbmcli on M10>recover_start Log LOG EBID "M10 20220308135659 /tmp/m10_log_pipe"_30OK_30Returncode 0_30Date 20220310_30Time 00120156_30Server emorymaxdb_30Database M10_30Kernel Version Kernel 7.9.10 Build 004-123-265-969_30Pages Transferred 552_30Pages Left 0_30Volumes_30Medianame Log_30Location /tmp/m10_log_pipe_30Errortext_30Label LOG_000000044_30Is Consistent_30First LOG Page 156012_30Last LOG Page 168070_30DB Stamp 1 Date 20220307_30DB Stamp 1 Time 00160145_30DB Stamp 2 Date 20220308_30DB Stamp 2 Time 00135614_30Page Count 12059_30Devices Used 1_30Database ID emorymaxdb:M10_20211014_112604_30Max Used Data Page_30Converter Page Count_30_30---_30dbmcli on M10>
In our case this is the last log backup we have and database can be started:
_10dbmcli on M10>db_online_10OK_10_10---_10dbmcli 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:
Put your database in Admin state:
Select Recover last backup option:
Wait until restore finishes:
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