Skip to Content
avatar image
Former Member

MaxDB 7.8 backup_start / backup_finish

Hello,

i have a problem.

We want to use the backup_start for filersnapshot.

When i open one session

dbmcli -d TST -u dbadmin,dbadmin -uUTL

dbmcli -> backup_start backupmedium

dbmcli -> backup_finish backupmedium externalbackupid 0

it's ok.

When i use

dbmcli -d TST -u dbadmin,dbadmin -uUTL -c backup_start backupmedium

dbmcli -d TST -u dbadmin,dbadmin -uUTL -c backup_finish backupmedium externalbackupid 0

-24984,ERR_MENOVALID: Invalid medium definition

i become an errormessage.

how can i make a script ?

dbmcli -d TST -u dbadmin,dbadmin -uUTL -c backup_start backupmedium

wait 120

dbmcli -d TST -u dbadmin,dbadmin -uUTL -c backup_finish backupmedium externalbackupid 0

i have also tested with shell-script

cmd=`cat <<EOF | dbmcli -d $DB_NAME -U c_J2EE -uUTL 2>&1

......

but in dbmcli there no sleep or wait.

When i leave the session i become the error "Invalid medium definition".

Thanks.

Rainer

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Dec 23, 2010 at 02:16 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 03, 2011 at 03:50 PM

    Hi Rainer,

    yes you are right. When the dbmcli session ends the underlying maxdb snapshot is automatically removed, so the backup is not successfully finished.

    Some days ago i got 3 hints from SAP side to address this:

    1) Open a pipe to the dbmcli command so that you can read and write to/from dbmcli to execute commands. Maybe perl with the IPC::Open2 module can manage that.

    2) dbmcli is able to execute os commands with the exclamation mark. So you might be able to trigger your external filercommands within dbmcli.

    3) Maybe the use of schedule commands can address your requirements. See dbmcli documentation

    Hope that helps, regards

    Stefan

    Edited by: Stefan Dietz on Jan 3, 2011 4:51 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 15, 2011 at 05:13 PM

    Hi Rainer

    i have the same problem. I could solved them the following way:

    Preparation:

    1. create a backup medium snapshot_medium type EXTERNAL

    2. create a file "start_backup" with the following 2 lines:

    backup_start snapshot_medium DATA

    !snapshot_script.sh

    3. create a script "snapshot_script.sh" where you make the external backup (like tar, cp, snap create a.s.o)

    In this script you check the saving and depending of the returncode

    you write to the pipe the appropiated backup_finish command like "backup_finish snapshot_medium FAILED WITH ERROR 4" or "backup_finish snapshot_medium EXTERNALBACKUPID MONDAY 0".

    In this script you must also write the "exit" command for dbmcli

    4. create a pipe: mknod pipe p

    Execution:

    1. start dbmcli reading a pipe:

    dbmcli -u control,control-pwd -d SID -uUTL control,control-pwd -ics pipe &

    2. write to the pipe:

    cat start_backup > pipe

    Now the dbmcli start and first it start the backup_start command. After this, the external script "snapshot_script.sh" will be started. Here, the data will be saved and depending of the return code a backup_finish command will be generated and written to the pipe "pipe". Also the "exit" command must be written to the pipe.

    With this method, all actions occurs in the same dbmcli-session

    I hope, it helps

    Greeze

    Thomas

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2011 at 02:27 PM

    Hello Thomas,

    it would be great, if you would add an example for the line "create a backup medium".

    I tried some different dbmcli commands, but all of them failed "-24984,ERR_MENOVALID: invalid medium definition".

    thank you,

    Reinhard

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Reinhard

      to create a backup_medium try this:

      dbmcli -d <DBID> -u control,<pwd> backup_template_create <XXXX> TO EXTERNAL SNAPSHOT

      Where <XXXX> is the name of your medium.

      Regards,

      Thomas

  • Oct 08, 2015 at 03:39 PM

    Does anyone know a solution for a Windows System?

    Add comment
    10|10000 characters needed characters exceeded