# Performing a SAP MaxDB Automatic Archive Log Backup

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

## Procedure

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.

   Note: if you enable Auto log backups, you cannot perform regular log backups. Disable the Auto log backups when you need to perform regular log backups.

       dbmcli on cert1>autolog_on AutoLog
        OK

#### Offline Full Backups

Type the following 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 and 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>

×

Loading...