I'm trying to restore a SAPDB database using automatic
logs.

For backing up the DB, I use this script:

> # $1 : database
> # $2 : node
> # $3 : user,password (admin)
> # $4 : path for log files
> # clear actual log state
> dbmcli -uUTL -d $1 -n $2 -u $3 util_execute clear
log
>
> # define "completeF" as the medium for complete data
backup
> dbmcli -d $1 -n $2 -u $3 medium_put completeF
$4/complete FILE DATA 0
8 YES
>
> # write complete data backup to file
> dbmcli -d $1 -n $2 -u $3 -uUTL -c backup_start
completeF RECOVERY

> # define "autosave" as the medium for automatic logs
backup
> dbmcli -d $1 -n $2 -u $3 medium_put autosave
$4/autolog FILE AUTO 0 8
YES
>
> # remove old logs
> ls $4/autolog.* | grep "autolog[.][0-9]*" | rm -f
>
> # set the log backup as automatic
> dbmcli -d $1 -n $2 -u $3 autolog_on


It works well. My data backup is created where I want
it created.

Then I do some stuff on the database so as to have
several logs created.
(I mainly run a script putting several thousands of
tuples in the db and
call load_systab, both operations filling the log
segment quite quickly)
When I have 2 or 3 logs created, I try to restore the
whole thing using:

> # $1 : database
> # $2 : node
> # $3 : user,password (admin)
> # $4 : path for log files
> # database must be in cold state
> dbmcli -uUTL -d $1 -n $2 -u $3 db_cold
>�������� 
> # Restore original database 
> echo "Restoring initial data"
> dbmcli -uUTL -d $1 -n $2 -u $3 recover_start
completeF
> 
> # Restore successive changes written to logs
> echo "Restoring logs"
> dbmcli -uUTL -d $1 -n $2 -u $3 recover_start
autosave 001
>�������� 
> # foreach log after the first
> for i in `ls $4/ | grep "autolog[.][0-9]*" | grep -v
autolog.001`
> do
> dbmcli -uUTL -d $1 -n $2 -u $3 recover_replace
autosave $4/autolog
`echo $i | cut -c9-11`
> done
>�������� 
> #finish recovery phase if last log has no successor
> dbmcli -uUTL -d $1 -n $2 -u $3 recover_ignore
>�������� 
> # set db in warm state
> dbmcli -uUTL -d $1 -n $2 -u $3 db_warm


Recovering the data backup works well.

But when I recover the first log file, I am returned a
0 source code,
which means "ok! finished!". I thought it was supposed
to return a -8020
return code, meaning that successive logs are
expected, then wait for a
recover_replace.
Consequently, my "recover_replaces"s don't do
anything.


Can someone tell me what's wrong in what I do?


Gwen

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran�ais !
Yahoo! Mail : http://fr.mail.yahoo.com
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to