cancel
Showing results for 
Search instead for 
Did you mean: 

Safe way to restore until a certain point of time

Former Member
0 Kudos

Hello everyone,

today we made a mistake and lost the last version of one of the thousand sources of our product on our development machine.

It's nothing we can solve via SAP version management. Because we had to deliver a fix for a customer based on an older version of that source, we thought it would be a good idea to just save a user version of the source, go back to the version the customer has, fix it and go back to the current version. What we did not consider is, that releasing a tp containing the source removes all user versions... so don't do that 🙂

In my eyes, the only way to get the source back is to restore the database.

We got a backup created in september 2012 and automatic log backups from that point of time until today (yes, i know, we should do regular backups more often). To have everything from the logspace as backup, i additionally created a manual log backup for the filled log space today. Also, i created a full backup to avoid making the situation worse.


My idea now is to restore the full backup from september and, after that, import all auto log backups + the last log backup with the "restore until" option and set the until date to yesterday.

My questions now are:

- will this work?

- will the combination of auto log and manual log backup lead to any problem?

- do i have to restore every log backup separately or is there some logic in database studio, which determines, what files have to be restored?

- do you know a better way?

Database version is 7.7.06.10

Best regards,

Robert

Accepted Solutions (1)

Accepted Solutions (1)

former_member188883
Active Contributor
0 Kudos

Hi Robert,

In your case since you have backup as well as logs until current working day , database restore is good option. Incase you know the time when you delete the piece of code, you may restore the logs to the timestamp before that.

How to Restore until a specific date and time

It is possible to restore to a specific point in time. For example you know date and time of an unwanted bigger change to the database which you want to make undone. So you can recover the database to a point in time just before this unwanted change was done. After restoring the last data backup before the particular point in time the following command can be used:

dbmcli on DB1> recover_start <medium_name> <backup_type> <nnn> UNTIL <date> <time>

for the example above:

dbmcli on DB1> recover_start Log01 log 001 until 20081104 173000

In this example the log will be restored until November 04, 17:30:00 and the database is switching to mode ONLINE afterwards automatically. Please note that the time has to be entered in 24-hour mode (5:30pm -> 17:30).

For different options on database restore refer the link below.

http://wiki.sdn.sap.com/wiki/display/MaxDB/HowTo+-+SAP+MaxDB+recovery+with+Database+Manager+CLI

Regards,

Deepak Kori

Former Member
0 Kudos

In addition: i just found out that MaxDB has got a command autorecover, which should do the job to find complete and / or log backups to recreate the db state at the desired time. So i don't have to restore each of the > 15 log files manually.

I now entered:

autorecover until 20130128 080000

via dmbcli and at least i can see via lsof that the correct data backup from september has been chosen and is read. I will tell, if it worked or not.

Former Member
0 Kudos

It worked well!

Answers (0)