One of the basics of a database system is to ensure the "durabality" (ACID).
This means that changes of a transaction ended with "commit" is under all 
circumstances persistent.
This is realized by the Log. All changes are written to the log area (redo log).
So your four commands to insert a record can be found in the log area.
If you recover your data area your log exists like before (containing inserts of four 
records).
After you have recovered the data area (containing three records) your restarted the 
database.
The database checks if the data- and the log- area belong to each other. This is the 
case in your example.
The database restart takes the data area and finds more on the log area (your insert 
of the fourth record)
the log is re done and when the database is online you find all four records because 
you have
"committed" the inserts.

If you want to avoid this (normal) behaviour and if you really only want to see the 
changes included
in the data backup then you have to clear the log area before restarting the database.
This can be done in two ways. Either you do a reinstallation with data recovery or you 
use the command
"util_execute clear log" after you have recovered the data backup.

I hope this explains the "strange" behaviour and wipes out your confusion.

kind regards
uwe

> -----Original Message-----
> From: Martin Cordova S. [mailto:[EMAIL PROTECTED]
> Sent: Samstag, 29. M�rz 2003 00:40
> To: [EMAIL PROTECTED]
> Subject: Really confused about restore
> 
> 
> Hi, after reading multiple SAPDB docs and trying to understand the
> backup/restore concepts, I tried a little test:
> 
> 1) created a new table, added 3 records (autolog is on)
> 2) made full data backup using a script.
> 3) inserted a 4th record
> 4) stopped the DB; deleted the data file
> 5) restored the db using this commands:
> 
> >dbmcli -d MYDB -u dbm,dbm
> >db_cold
> >util_connect dbm,dbm
> >recover_start data DATA
> >util_release
> >db_warm
> 
> database restored OK, but: I restored a database that 
> contains 4 records,
> but my data backup only contained 3 records. What happened???
> 
> Another issue: the same commands executed in a .bat script 
> don't run. I
> receive this error:
> dbmcli on PORTAL>ERR
> -24992,ERR_NOUTILSESSION: no utility session available
> 
> Here is the script:
> 
> @echo off
> 
> rem ** sapdb bin path **
> set PATH=c:\sapdb\indep_prog\bin;c:\sapdb\indep_prog\pgm;%PATH%
> 
> rem ** name of the database **
> set SID=PORTAL
> 
> rem ** backup database **
> echo db_cold
> echo util_connect dbm,dbm
> echo recover_start data DATA >> param.tmp
> echo util_release
> echo db_warm
> type param.tmp | dbmcli -d %SID% -u dbm,dbm >> restore_log.txt
> 
> del param.tmp
> 
> -----
> 
> It would be so great to have 2 sample scripts for these tasks: one for
> regular full data backups, and another for restore of the 
> data and last
> transactions, just as the db_create and db_drop sample 
> scripts included in
> the distribution.
> 
> Regards,
> Martin
> 
> 
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to