5 1 0:SAP ERP with MaxDB
Overview
The MaxDB backup/restore is performed with the Database Manager CLI (dbmcli) utility, as described in the section dbmcli calls. The backint is an interface program that allows dbmcli to communicate with SAP MaxDB using pipes to perform backup and restore operations.
Requirements
To ensure error-free operation of SEP sesam and improve performance, make sure that the following conditions are met:
- Check the support matrix for the list of supported MaxDB versions. Note that all components for setting up the MaxDB extension are already included in the SEP sesam installation packages.
- SEP sesam Server v. 4.4.3 Beefalo or higher. Check the hardware requirements for SEP sesam Server, RDS and SEP sesam Client.
- Install the SAP ERP database on a supported MaxDB.
- Install the SEP sesam Client package on the SAP ERP server. You can download it from the SEP Download Center. The installation procedure is slightly different depending on the operating system (Linux/Unix or Windows). For details on the OS specific installation, see SEP sesam Quick Install Guide.
Installing SAP ERP on MaxDB
Before proceeding, make sure that the requirements above are met.
On Linux/Unix
Once you have downloaded your SEP sesam Linux Client on the SAP ERP server, proceed as follows:
- Unpack the tar-archive into a temporary directory. The archive contains the following files:
- backint_sapdb
- backint_sapdb.utl
- bsi.env
- Copy the backint_sapdb file to
<SESAM_ROOT>/bin/sesam
directory as a root user. This file has to be executable for the MaxDB user. You can also use a different directory. In this case, you have to adjust the configuration accordingly. - Check if the programs sbc and sbc_com_interface are executable for the MaxDB user in the directory
<SESAM DIR>/bin/sesam
. - Copy the file backint_sapdb.utl to the MaxDB <wrk_directory> (e.g.,
/usr/sapdb/indep_data/wrk/CER
, if the database DBsid is CER).
On Windows
Once you have installed your SEP sesam Windows Client on the SAP ERP server, proceed as follows:
- SEP sesam Windows Client already includes the necessary files for the MaxDB:
- backint_sapdb
- backint_sapdb.utl
- bsi.env
- The backint_sapdb.exe program is located in the directory
<SESAM ROOT>\bin\sesam
. You can copy it to a different directory, e.g., the MaxDB bin directory. In this case, you have to adjust the configuration accordingly. - Copy the files backint_ sapdb.utl and bsi.env from the directory
<SESAM ROOT>/skel/
to the MaxDB <wrk_ directory> (e.g.,C:\Program Files\sapdb\indep_data\wrk\CER
, if the database DBsid is CER).
Configuration on SEP sesam Server
After you have installed SAP ERP on MaxDB, proceed as follows:
- Configure your SAP ERP as a SEP sesam client by adding it to the SEP sesam environment: Main Selection -> Components -> Clients -> New Client -> add your SAP ERP client. For details, see Configuring Clients.
- Additionally, you have to create at least one backup task for the SAP ERP server with the MaxDB task type. Note that the entry for source can be specified freely. For details, see Creating a Backup Task.
Note | |
This task cannot be used for regular Path backups. It is recommended that you configure more dedicated tasks, e.g., to distinguish database backups from archive log backups. Which data is actually backed up depends on the respective SAP ERP backup call. |
Configuration on the SEP sesam SAP ERP MaxDB client
In order for MaxDB to be able to use the SEP sesam backint_sapdb program, you have to adjust the following entries in the profile file (default: <wrk_directory>/bsi.env
):
- BACKINT = <full path of the backint_sapdb program>
- INPUT = <full path of the input file>
- This file is used by the MaxDB server to communicate with the backint program.
- OUTPUT = <full path of the output file>
- This file is used by the MaxDB server to communicate with the backint program.
- ERROROUTPUT = <full path of the error file>
- Contains the error messages of the backint program.
- PARAMETERFILE = <full path of the parameter file which will be used>
- In this file the SEP sesam specific parameters are adjusted.
- CHECK_AVAILABILITY <number>BACKUPS
- Number of the old backups queried during restore.
For details, see Creating the Configuration File for Backint for SAP MaxDB and Example of a Configuration File for Backint for SAP MaxDB.
Example of a bsi.env file:
On Linux
BACKINT /opt/sesam/bin/sesam/backint_sapdb INPUT /tmp/infile4sapdb OUTPUT /tmp/outfile4sapdb ERROROUTPUT /tmp/backint4sapdb.err PARAMETERFILE /usr/sapdb/indep_data/wrk/CER/backint_CER.utl TIMEOUT_SUCCESS 600 TIMEOUT_FAILURE 300 # ORIGINAL_RUNDIRECTORY /opt/SAPDB/wrk/P1 CHECK_AVAILABILITY 20BACKUPS
On Windows
BACKINT "C:\Program Files\SEPsesam\bin\sesam\backint_sapdb.exe" INPUT C:\temp\CER_sapdb.in OUTPUT C:\temp\CER_sapdb.out ERROROUTPUT C:\temp\CER_backint4sapdb.err PARAMETERFILE C:\ProgramData\sdb\globaldata\wrk\P1\backint_CER.utl TIMEOUT_SUCCESS 600 TIMEOUT_FAILURE 300 # ORIGINAL_RUNDIRECTORY C:\ProgramData\sdb\globaldata\wrk\P1 CHECK_AVAILABILITY 20BACKUPS
Note | |
|
You can create several profile files. They are declared to the MaxDB by setting the environment variable BSI ENV.
Example for setting the environment variable BSI ENV:
dbmcli -d CER -u dbm,dbm dbm_configset -raw BSI_ENV /usr/sapdb/indep_data/wrk/CER/bsi.env
You can set different values for PARAMETERFILE in the respective profile files; for example, to use different media pools.
You have to configure at least the following parameters in the PARAMETERFILE:
- SESAM_SERVER = <SEP_sesam_Server>
- The name of the SEP sesam Server.
- SESAM_JOB = <SEP sesam SAP MaxDB client task>
- The name of the SEP sesam backup task which you have configured before. For details, see section above Configuration on SEP sesam Server.
- SESAM_DRIVE=<SEP_sesam_drive_number>
- The number of the SEP sesam drive that you want to use for backup.
- SESAM_POOL=<SEP sesam media pool>
- The name of the SEP sesam media pool that you want to use for backup.
- SSB_LOGFILE=<log_file_name>
- Full path of the SEP sesam backint log file.
Optionally, set the additional parameters:
- SBC=<SEP_sesam_path>
- Full path of the SEP sesam backup program. It only has to be set if the standard sbc cannot be used.
- PORT=<SEP_sesam_Server_communication_port>
- Only required if the STPD port was changed during the SEP sesam Server installation.
- SESAM_TAPESERVER=<Remote_device_server>
- IP name of the RDS for backup. By using this entry you can specify the backup net.
Example of a parameter (.utl) file:
On Linux
SESAM_SERVER=seplinux SESAM_JOB=lxsap01_SAP SESAM_DRIVE=2 SESAM_POOL=fullpool SSB_LOGFILE=/sapdb/data/wrk/CER/backint_CER.log
On Windows
SESAM_SERVER=seplinux SESAM_JOB=win03_SAP SESAM_DRIVE=2 SESAM_POOL=fullpool SSB_LOGFILE=C:\ProgramData\sdb\globaldata\wrk\CER\backint_CER.log
SAP ERP log files on MaxDB
The following log files are written by the individual SAP ERP backup modules in the MaxDB <wrk_ directory> (e.g., /sapdb/data/wrk/CER
or /usr/sapdb/indep_ data/wrk/CER
, if the database DBsid is CER).
- backint, sbc, and sbc_com_interface
- The programs backint_sapdb, sbc and sbc_com_interface write in the log file which was set during the configuration of the SSB LOGFILE entry in the parameter file, e.g.,
/sapdb/data/wrk/CER/backint_CER.log
.
- dbmcli
- The MaxDB dbmcli program writes its log files into the work directory, e.g.,
/sapdb/data/wrk/CER/dbm.ebp
.
dbmcli calls
MaxDB backup and restore commands can be invoked with the Database Manager CLI dbmcli program. The dbmcli is included in the MaxDB software. For details on DBM commands, see MaxDB documentation.
Note | |
As of 4.4.3 Beefalo V2, you can not only perform a full restore, but also restore SAP MaxDB instance to another instance using the dbmcli program. For details, see SAP MaxDB Restore to Another Instance. |
Example
In the following example, we have created three external media for full, incremental and log backup. These are pipes that are used to transfer the data between the MaxDB and SEP sesam.
Syntax
<medium_put> <medium_name> <location_type> <backup_type> [<size> [<block size> [<overwrite> [<autoloader> [<os_command> [<tool_type>]]]]]]
On Linux
OS> dbmcli -d TST -u dbm,dbm -c medium_put BACKData /tmp/sapdb/TST/data PIPE DATA 0 8 YES YES pwd BACK OS> dbmcli -d TST -u dbm,dbm -c medium_put BACKPages /tmp/sapdb/TST/pages PIPE PAGES 0 8 YES YES pwd BACK OS> dbmcli -d TST -u dbm,dbm -c medium_put BACKLog /tmp/sapdb/TST/log PIPE LOG 0 8 YES YES pwd BACK OS> dbmcli -d TST -u dbm,dbm -c medium_getall # print list of defined media
On Windows
The backup medium name of a type PIPE must be added to the following syntax \\.\pipe\<pipe_name>
. For details, see medium_put.
C:\> dbmcli -d TST -u dbm,dbm -c medium_put BACKData \\.\pipe\TST-Data PIPE DATA 0 8 YES YES pwd BACK C:\> dbmcli -d TST -u dbm,dbm -c medium_put BACKPages \\.\pipe\TST-Pages PIPE PAGES 0 8 YES YES pwd BACK C:\> dbmcli -d TST -u dbm,dbm -c medium_put BACKLog \\.\pipe\TST-Log PIPE LOG 0 8 YES YES pwd BACK C:\> dbmcli -d TST -u dbm,dbm -c medium_getall
Setting the environment variable BSI ENV
On Linux
OS> dbmcli -d TST -u dbm,dbm dbm_configset -raw BSI_ENV /usr/sapdb/wrk/TST/bsi.env
On Windows
C:\> dbmcli -d TST -u dbm,dbm dbm_configset -raw BSI_ENV C:\ProgramData\sdb\globaldata\wrk\TST\bsi.env
Full backup in cold mode
OS> dbmcli -d TST -u dbm,dbm -c db_cold # set to cold OS> dbmcli -d TST -u dbm,dbm -uUTL -c backup_start BACKData migration
Full backup in warm mode
OS> dbmcli -d TST -u dbm,dbm -c db_warm # set to warm OS> dbmcli -d TST -u dbm,dbm -uUTL -c backup_start BACKData migration
Incremental backup
OS> dbmcli -d TST -u dbm,dbm -uUTL -c backup_start BACKPages migration
Log backup
OS> dbmcli -d TST -u dbm,dbm -uUTL -c backup_start BACKLog
Full restore
See also: https://wiki.scn.sap.com/wiki/display/MaxDB/HowTo+-+SAP+MaxDB+Recovery+with+Database+Manager+CLI
OS> dbmcli -d <DBsid> -u dbm,dbm -c db_cold # set database to cold mode OS> dbmcli -d <DBsid> -u dbm,dbm -c db_admin # set database to admin mode OS> dbmcli -d <DBsid> -u dbm,dbm -uUTL # connect to the database >backup_ext_ids_forget # should return OK, clears backup list >backup_ext_ids_get BACKData # should return OK, requests backups from server, device "BACKData" >backup_ext_ids_list # should return OK # and displays a list of EBIDS # use backup_ext_ids_listnext to scroll further # Format: # Availability External Backup ID Save Type Date and Time # AVAILABLE <EBID 1> DATA MIGRATION <Date 1> # use full string enclosed in | as EBID >service_connect # open service connection >recover_start BACKData DATA ExternalBackupID "<EBID 1>" # should return OK > db_execute clear log # reset logfiles > db_warm # should return OK >exit
Consistency check of the backup with recover_check
OS> dbmcli -d TST -u <ADMNAME>,<PASSWORT> -uSRV dbmcli on CER>backup_ext_ids_get <BACKUPNAME> # e.g. BACKLog dbmcli on CER>backup_ext_ids_list
Example on Windows:
C:\Users\Administrator>dbmcli.exe -d MAXDB -U dbadmin1 -uSRV dbmcli.exe on MAXDB>backup_ext_ids_get BACKData OK --- C:\Program Files\sdb\MaxDB\pgm\dbmcli.exe on MAXDB>backup_ext_ids_list OK END AVAILABLE|MAXDB MAXDB_7115418748 \\.\pipe\MAXDB-Data|DATA MIGRATION|2019-10-15 17:43:05| AVAILABLE|MAXDB MAXDB_711542630 \\.\pipe\MAXDB-Data|PAGES MIGRATION|2019-10-15 17:44:21| AVAILABLE|MAXDB MAXDB_7123701371 \\.\pipe\MAXDB-Data|DATA MIGRATION|2019-10-16 16:43:31| AVAILABLE|MAXDB MAXDB_712375260 \\.\pipe\MAXDB-Data|PAGES MIGRATION|2019-10-16 16:52:04| AVAILABLE|MAXDB MAXDB_7123782847 \\.\pipe\MAXDB-Data|DATA MIGRATION|2019-10-16 16:57:06|
This command shows a list of the respective SEP sesam savesets. The output is divided by the pipe sign (|), the second parameter includes the external backup ID:
AVAILABLE|CER CER___6225258851 /tmp/sapdb/CER/data|DATA MIGRATION|2019-12-31 10:43:06| AVAILABLE|CER CER___6225271628 /tmp/sapdb/CER/pages|PAGES MIGRATION|2019-12-31 10:45:14| AVAILABLE|CER CER___6225285526 /tmp/sapdb/CER/log|LOG RECOVERY |2019-12-31 10:47:33|
The following example shows a recover_check call for the LOG backup type:
Call: dbmcli on CER>service_connect dbmcli on CER>recover_check <BACKUP_NAME> LOG ExternalBackupID "<BACKUP_ID>" AUTOIGNORE Example: dbmcli on CER>recover_check BACKLog LOG ExternalBackupID "CER CER___6225285526 /tmp/sapdb/CER/log" AUTOIGNORE OK Returncode 0 Date 20091231 Time 00110347 Server qslxmax01 Database CER Kernel Version Kernel 7.7.06 Build 009-121-202-944 Pages Transferred 312 Pages Left 0 Volumes 1 Medianame BACKLog Location /tmp/sapdb/CER/log Errortext Label LOG_000000001 Is Consistent First LOG Page 0 Last LOG Page 349 DB Stamp 1 Date 20091230 DB Stamp 1 Time 00111532 DB Stamp 2 Date 20091231 DB Stamp 2 Time 00104514 Page Count 291 Devices Used 1 Database ID qslxmax01:CER_20091231_104306 Max Used Data Page Converter Page Count
See also
SAP MaxDB Restore to Another Instance – SAP ERP