Advanced Backup - SAP MaxDB iDataAgent

Table of Contents

Full Backup

A full backup contains the backup of an entire database. The full backup becomes a baseline to which subsequent incremental backups are applied should data restoration be requested.

Performing an Offline (Cold) Full backup

  1. Open the DBM Command line Interface and verify the status of the database.

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL
    dbmcli on CERT1>db_state
    OK
    State
    ADMIN

  2. Ensure that the database is in admin (cold) state.

    If not, execute the command to bring the database to admin (cold) state.

    #> dbmcli -d CERT1 -u dbm,dbm db_cold

  3. Type the command to execute the offline full backup.

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL -c backup_start BackData2 Migration

    The backup should complete without any errors.

    ok
    Return Code 0

Performing Online (Warm) Full Backup

  1. Open the DBM Command line Interface and verify the status of the database.

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL
    dbmcli on CERT1>db_state
    OK
    State
    ONLINE

  2. Ensure that the database is in online (warm) state.

    If not, execute the command to bring the database to online (warm) state.

    #> dbmcli -d < DBsid > -u dbm,dbm db_warm

  3. Type the command to execute the online full backup.

    # dbmcli -d CERT1 -u dbm,dbm -uUTL -c backup_Start BackData2 Recovery

  4. The backup should complete without any errors.

    ok
    Return Code 0

Incremental Backups

An incremental backup contains only data that is new or has changed since the last backup, regardless of the type. On average, incremental backups consume far less media and place less of a burden on resources than full backups. To streamline the backup process and to optimize the time and resources, you can run incremental backups.

Performing an Offline (Cold) Incremental Backup

  1. Open the DBM Command line Interface and verify the status of the database.

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL
    dbmcli on CERT1>db_state
    OK
    State
    ADMIN

  2. Create a table and add records.

    Usage example:

    #> sdbfill <DBName> init|create|append|check|delete [<From> <To>
    [<TransactionLength> [<SleepBeforeCommit> [ q|a|b
    [dba dbapassword]]]]]

    #> sdbfill CERT1 append 1000000 2000000 10000 0 a DBA DBA
    2000000, finale commit at 1999999
    1000000 rows inserted successfully.

  3. Ensure that the database is in admin (cold) state.

    If not, execute the command to bring the database to admin (cold) state.

    #> dbmcli -d CERT1 -u dbm,dbm db_cold

  4. Type the command to execute the offline incremental backup.

    #> dbmcli -d <DBSid> -u dbm,dbm -uUTL -c backup_start BackPages migration

    The backup should complete without any errors.

    ok
    Return Code 0

Performing an Online (Warm) Incremental Backup

  1. Open the DBM Command line Interface and verify the status of the database.

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL
    dbmcli on CERT1>db_state
    OK
    State
    ONLINE

  2. Create a table and append the data in the table.

    Usage example:

    sdbfill <DBName> init|create|append|check|delete [<From> <To>
    [<TransactionLength> [<SleepBeforeCommit> [ q|a|b
    [dba dbapassword]]]]]
    #> sapdbfill append 1000000 2000000 10000 0 a DBA DBA

  3. Ensure that the database is in online (warm) state.

    If not, execute the command to bring the database to online (warm) state.

    #> dbmcli -d CERT1 -u dbm,dbm db_warm

  4. Type the command to execute the online incremental backup.

    #> dbmcli -d <DBsid> -u dbm,dbm -uUTL -c backup_start BACKPages recovery

    The backup should complete without any errors.

    ok
    Return Code 0

Selective Online Full Backups

An auxiliary copy operation or a data protection operation copies valid data from a source copy of a specific storage policy to all or one active secondary copy within a storage policy. These secondary copies can be either synchronous or selective copies. A selective copy allows you to copy the backup data selectively from a source copy to the secondary copy, providing for better tape rotation.

During a data protection operation that creates an inline copy, only those backups from the primary copy that meet certain criteria will be copied to a selective copy. You can define a selective copy to be time-based, automatically selected, or automatically not selected on the primary copy.

Selective copy will copy the selective Online Full backups along with their linked jobs.

Enable Backups Using Selective Copy

Include the SelectiveOnlineFull parameter in the param file and set the parameter value to 1 to enable backups using selective copy from the client.

Set the parameter value to 0 to disable this capability.

Example:

For Unix:

[root@rhel5sap64ismorethanthirtycharacters /]# cat /opt/simpana/SapMaxDbAgent/param
numstreams
2
CvInstanceName
Instance001
CvClientName
rhel5sap64ismorethanthirtycharacters
SelectiveOnlineFull
1

For Windows:

Path to param file mentioned during install
numstreams
2
CvInstanceName
Instance001
CvClientName
sde-sap2
SelectiveOnlineFull
1

The following examples enable you to understand the various scenarios under which an online full backup job can be copied to selective copies:

Example 1

Successful completion of an online full backup cycle requires the successful completion of a full data and corresponding configuration backup job followed eventually by a full log and corresponding configuration backup job. (A single job will be initiating for data/logs with a corresponding configuration file.) As such, the shortest successful cycle can be illustrated as follows:

DATA, CONFIG, FULL (pass) --> First, A full backup with data and configuration files (backint.conf and parameter file) is successfully completed.

LOG, CONFIG, FULL (pass) ---> Next, A Log backup with configuration files (backint.conf and parameter file ) is successfully completed.

In this example, each required job has completed successfully within the full backup cycle. Therefore, the online full data backup job (along with all the other jobs in the cycle) will be copied to a selective copy..

Example 2

A full backup cycle can include other backup job types (e.g., incremental backup jobs). If the full backup cycle is successful, these jobs are also copied to a selective copy. This includes incremental backup jobs within the cycle:

DATA, CONFIG, FULL (pass) --> First, a full backup with data and configuration files (backint.conf and parameter file) is successfully completed.

DATA, CONFIG, INCR (pass)--> Next, an Incremental backup with configuration files (backint.conf and parameter file) is successfully completed.

LOG, CONFIG, FULL (fail) --> However, if a Log backup that is performed after a successful incremental backup failed. This will not constitute as an online full backup cycle.

DATA, CONFIG, INCR (pass)--> A full backup with data and configuration files (backint.conf and parameter file) is successfully completed.

LOG, CONFIG, FULL (pass) --> On the second attempt after another incremental backup, a Log backup with configuration files (backint.conf and parameter file ) is successfully completed.

In this example, the first attempt at running the configuration job for the full log backup job failed; however, the second attempt succeeded and therefore completed a successful cycle. As a result, each job (total of five) within the cycle will be copied to a selective copy. This includes the one configuration job that failed.

Example 3

A full backup cycle is started before a full online backup cycle completes:

DATA, CONFIG, FULL (pass)--> First, a full backup with data and configuration files (backint.conf and parameter file) is successfully completed.

DATA, CONFIG, INCR (pass)-->Next, an Incremental backup with configuration files (backint.conf and parameter file) is successfully completed.

DATA, CONFIG, FULL (pass)--> However, before a log backup can be taken to complete the full cycle, another full backup with data and configuration files is successfully completed. As such, none of the backup jobs in the first cycle can be copied to a selective copy.

In this example, you need to run a log backup after the successful incremental backup to complete the online full cycle. Only after a full successful cycle, each job within the cycle will be copied to a selective copy.

Archive Log Backups

Log backups are useful when you want to recover database transactions that have been lost due to an operating system or disk failure. You can apply these logs to an online backup in order to recover a database.

  1. Open the DBM Command line Interface and verify the status of the database.

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL
    dbmcli on CERT1>db_state
    OK
    State
    ADMIN

  2. Ensure that the database is in online (warm) state.

    If not, execute the command to bring the database to online (warm) state.

    #> dbmcli -d CERT1 -u dbm,dbm db_warm

  3. Type the command to execute the log backup

    #> dbmcli -d CERT1 -u dbm,dbm -uUTL -c backup_start BackLog

    The backup should complete without any errors.

    ok
    Return Code 0

Automatic Log backups

When you activate automatic log backups, the log entries are regularly backed up.

  1. Create a FILE medium for Auto log backup. Auto log backup cannot use a PIPE medium. The location of the log_version should be in a different volume from where the log segments are located. Only then, the Auto Log Backups can automatically clear up the log segments.

    dbmcli on cert1>medium_put AutoLog /space/sdb/data/cert1/files/log_version FILE AUTO 0 0 NO NO ''BACK
    OK

  2. Enable Auto Log in the database and assign the FILE medium for it.

    dbmcli on cert1>autolog_on AutoLog
    OK

    If you enable Auto log backups, you cannot perform regular log backups. Hence, disable the Auto log backups when you need to perform regular log backups.

Offline Full Backups

Type the command to perform a full offline Auto log backup.

[root@sappg54 sdb]# dbmcli -d CERT1 -u dbm,
dbm -uUTL -c backup_start BackData2 Migration
OK
Returncode                 0
Date                       20101202
Time                       00232908
Server                     sapclient.company.com
Database                   CERT1
Kernel Version             Kernel    7.7.04  
Build                      028-123-194-355
Pages Transferred          8616
Pages Left                 0
Volumes                    2
Medianame                  BackData2
Location                   /space/sdb/data/cert1/files/pipe_mem2
Errortext
Label                      DAT_000000003
Is Consistent              true
First LOG Page             22115
Last LOG Page
DB Stamp 1 Date            20101202
DB Stamp 1 Time            00232825
DB Stamp 2 Date
DB Stamp 2 Time
Page Count                 8574
Devices Used               2
Database ID                sapclient.company.com:CERT1_20101202_231525
Max Used Data Page         0
Converter Page Count       11

Incremental Backups While the Database Is in Cold Mode

Type the command to perform an incremental Auto log backup while the database is in a cold mode.

[root@sappg54 sdb]# dbmcli -d CERT1 -u dbm,dbm dbmcli on CERT1>db_cold
OK

---
dbmcli on CERT1>quit
OK

---
[root@sappg54 sdb]# dbmcli -d CERT1 -u dbm,dbm -uUTL -c backup_start BackPages2 Migration
OK
Returncode 0
Date 20101202
Time 00233902
Server sapclient.company.com
Database CERT1
Kernel Version Kernel 7.7.04 Build 028-123-194-355
Pages Transferred 4104
Pages Left 0
Volumes 2
Medianame BackPages2
Location /space/sdb/data/cert1/files/pipe_mem4
Errortext
Label PAG_000000004
Is Consistent true
First LOG Page 32999
Last LOG Page
DB Stamp 1 Date 20101202
DB Stamp 1 Time 00233730
DB Stamp 2 Date
DB Stamp 2 Time
Page Count 4055
Devices Used 2
Database ID sapclient.company.com:CERT1_20101202_231525
Max Used Data Page 0
Converter Page Count 20

Staging AutoLog Version Files to PIPES

First, verify the log sequence order before you perform a backup on the logs. For example, If the logs generated were 2,3,4,5,6 (2 to 6), the auto log backup starts 5 backup jobs. The software normally initiates 1 job for each log version file

Type the command for staging log version files and perform an Auto log backup.

Note: When to use the VERIFY and NOVERIFY options

When you select the VERIFY option, the SAP software starts the restore before it finishes the “config” phase in the backup. A restore that SAP starts will not be able to acquire the resources. The restores are held up by the backup and can therefore hang.

Best Practice: Use the NOVERIFY option for backups that go to the Tape Library. You can use the VERIFY option for backups that go to the Magnetic Disk Library.

[root@sappg54 data]# cd cert1/files
[root@sappg54 files]# pwd
/space/sdb/data/cert1/files
[root@sappg54 files]# ls
archive_stage log_version.002 log_version.003 log_version.004 log_version.005 log_version.006

[root@sappg54 files]# dbmcli -d CERT1 -u dbm,dbm
dbmcli on CERT1>archive_stage BackLog AutoLog FNL 2-6 NOVERIFY
OK
Processed Stage Files 5
Bytes processed 177274880
Deleted Stage Files 5
Remaining Stage Files 0

---
dbmcli on CERT1>quit

Incremental Backups While the Database Is in a Warm Mode

Type the command to perform an incremental Auto log backup while the database is in a warm mode.

Append some more data:
[root@sappg54 files]# sdbfill CERT1 append 1000000 2000000 10000 0 a DBA DBA
2000000, final commit at 1999999
1000000 rows inserted successfully.

Run Incremental Backup
[root@sappg54 files]# dbmcli -d CERT1 -u dbm,dbm -uUTL -c backup_start BackPages2 Recovery
OK
Returncode 0
Date 20101203
Time 00003409
Server sapclient.company.com
Database CERT1
Kernel Version Kernel 7.7.04 Build 028-123-194-355
Pages Transferred 8368
Pages Left 0
Volumes 2
Medianame BackPages2
Location /space/sdb/data/cert1/files/pipe_mem4
Errortext
Label PAG_000000005
Is Consistent true
First LOG Page 43902
Last LOG Page
DB Stamp 1 Date 20101203
DB Stamp 1 Time 00003409
DB Stamp 2 Date
DB Stamp 2 Time
Page Count 8324
Devices Used 2
Database ID sapclient.company.com:CERT1_20101202_231525
Max Used Data Page 0
Converter Page Count 20

Performing Full Backups While the Database Is in Online (Warm) Mode

Type the command to perform a full Auto log backup in warm status:

[root@sappg54 files]# dbmcli -d CERT1 -u dbm,dbm -uUTL -c backup_Start BackData2 Recovery
OK
Returncode 0
Date 20101203
Time 00003741
Server sapclient.company.com
Database CERT1
Kernel Version Kernel 7.7.04 Build 028-123-194-355
Pages Transferred 8608
Pages Left 0
Volumes 2
Medianame BackData2
Location /space/sdb/data/cert1/files/pipe_mem2
Errortext
Label DAT_000000006
Is Consistent true
First LOG Page 43903
Last LOG Page
DB Stamp 1 Date 20101203
DB Stamp 1 Time 00003741
DB Stamp 2 Date
DB Stamp 2 Time
Page Count 8574
Devices Used 2
Database ID sapclient.company.com:CERT1_20101202_231525
Max Used Data Page 0
Converter Page Count 20

Staging Auto Log Version Files to PIPES

Backup of Logs:

Now the Logs that need to be backed up were only 7 & 8.

[root@sappg54 files]# pwd
/space/sdb/data/cert1/files
[root@sappg54 files]# ls
archive_stage log_version.007 log_version.008

[root@sappg54 files]# dbmcli -d CERT1 -u dbm,dbm
dbmcli on CERT1>archive_stage BackLog AutoLog FNL 7-8 NOVERIFY
OK
Processed Stage Files 2
Bytes processed 70909952
Deleted Stage Files 2
Remaining Stage Files 0

---
dbmcli on CERT1>

Staging AutoLog version files to PIPES

Backup Logs again
Now Log files generated were 9, 10 ,11. so the syntax would need 9-11

[root@sappg54 files]# pwd
/space/sdb/data/cert1/files
[root@sappg54 files]# ls
archive_stage log_version.009 log_version.010 log_version.011 pipe_mem6_out
[root@sappg54 files]# dbmcli -d CERT1 -u dbm,dbm
dbmcli on CERT1>archive_stage BackLog AutoLog FNL 9-11 NOVERIFY
OK
Processed Stage Files 3
Bytes processed 106364928
Deleted Stage Files 3
Remaining Stage Files 0

--- dbmcli on CERT1>

Managing Jobs

Once you initiate the backup operation, a backup job is generated in the Job Controller on CommCell Console. A single job ID will be generated in Job Controller. You can view the progress and details of the job through Job Controller.

You can view the specific historical information about the job once the job is completed from the client computer, iDataAgent, or instance level in the CommCell Console.

Control Jobs

The Kill control option to terminate a job is available for this iDataAgent in the Job Controller window:

This control can be applied to:

  • All jobs in the Job Controller.
  • All selected jobs in the Job Controller providing you have the correct security associations at the proper level for each job selected.
  • All data protection operations running for a particular client or client/agent.
  • All data protection operations running for a particular MediaAgent.

You can Kill a job from the Job Controller of the CommCell Console.

  1. Right-click the job and select Kill.
  2. Click Yes when the confirmation prompt appears if you are sure you want to kill the job. The job status may change to Kill Pending for a few moments while the operation completes. Once completed, the job status will change to Killed and it will be removed from the Job Controller window after five minutes.