cancel
Showing results for 
Search instead for 
Did you mean: 

MaxDB 7.8 backup_start / backup_finish

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

wei_henning
Explorer
0 Kudos

Does anyone know a solution for a Windows System?

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

stefan_dietz
Explorer
0 Kudos

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

former_member218672
Active Contributor
0 Kudos