cancel
Showing results for 
Search instead for 
Did you mean: 

Few questions about backing up

Former Member
0 Kudos

Hi,

i'm new to SAP and MaxDB and i have some questions:

1) When i perform a Complete Backup, does the data from log volumes archived automatically to this backup?

I did a test. I have created a new database, then in SQL Studio i have created a new table and added there some records. I saw, that after this log area is used in 30%. Then i did complete backup. Nothing has changed. Next, i did a recovery for this Complete backup with initialization (to delete the entries from log volumes). After this, i could see all records and tables that i have created before - i thought it will be lost. Why it happen like this?

2) Let's assume this situation:

I have backups:

10.07.2010 Complete1

11.07.2010 Log1

12.07.2010 Complete2

13.07.2010 Log2

And on 14th i have a database crash. So, if i wan't to recover db to 13.07.2010 do i need Log1 backup, or only Complete2 and Log2? Can i delete Log1 after i do Complete2?

What's is in case that i have mirrored log volumes and i have actuall log volumes files? Can i import it somehow? Or should i import Complete2, Log2 and then replace Log Volumes Files?

3) How can i check Log backup using DB13? Every day on 08.00 i have scheduled log backup, files are created without errors, but when i'm trying to check them, i recieve error wrong_hostfile. I checked permissions to that file, all looks good.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If you could also answer those two more questions:

1) Assume this situation:

15.07.2010 04:00 Complete Backup

15.07.2010 15:00 Log Backup

16.07.2010 04:00 Complete Backup

16.07.2010 15:00 Log Backup

And now question:

- If I wan't to recover the DB on 16.07 to the state it was on 15.07 16:00. If i do recovery using Complete Backup and Log Backup will i have the db in state as it was on 15.07 15:00? What happen with the log that actually are in log area (on 16.07)??

Second sitiuation:

I'm installing new SP to the system. Before this, i'm makeing only complete backup when db is in admin state. Last log backup is done 1 week earlier. Now, the installation of SP failed. If i do a recovery using complete backup will i loose information that are in log area?

I think no, because complete backup include information that are in data area and log area (but it's not doing log backup). So database after the recovery should have all information in state it were when doing complete backup. But what happen do log area after recovery? Will it be cleared?

lbreddemann
Active Contributor
0 Kudos

> If you could also answer those two more questions:

>

> 1) Assume this situation:

> 15.07.2010 04:00 Complete Backup

> 15.07.2010 15:00 Log Backup

> 16.07.2010 04:00 Complete Backup

> 16.07.2010 15:00 Log Backup

>

> And now question:

> - If I wan't to recover the DB on 16.07 to the state it was on 15.07 16:00. If i do recovery using Complete Backup and Log Backup will i have the db in state as it was on 15.07 15:00? What happen with the log that actually are in log area (on 16.07)??

The data in the log area will always be used if we need it.

So, depending on the size of the log area and the amount of log created since the last log backup you may not even need to use the log backup.

Since we don't delete the log data when we back it up, it may well be that the log area contains all necessary information for the complete recovery.

>

> Second sitiuation:

> I'm installing new SP to the system. Before this, i'm makeing only complete backup when db is in admin state. Last log backup is done 1 week earlier. Now, the installation of SP failed. If i do a recovery using complete backup will i loose information that are in log area?

No. Why should you loose it?

> I think no, because complete backup include information that are in data area and log area (but it's not doing log backup). So database after the recovery should have all information in state it were when doing complete backup. But what happen do log area after recovery? Will it be cleared?

Wrong.

The data backup never contains log data.

Never.

You cannot recover from a data backup. It's static data.

It just contains the point in time of data from when it was taken.

The log area contains all change information that can be applied to this state of data.

When we fully recover the database, nothing happens to the log area.

We can continue the log sequence.

Only when a point in time recovery is done the log area will be invalidated and a new backup history is started.

Hmm...

Based on your questions I really don't see that you've read the documentation or the training material on http://maxdb.sap.com/training.

Please do this.

regards,

Lars

Former Member
0 Kudos

Hi again

Second sitiuation:

I'm installing new SP to the system. Before this, i'm makeing only complete backup when db is in admin state. Last log backup is done 1 week earlier. Now, the installation of SP failed. If i do a recovery using complete backup will i loose information that are in log area?

No. Why should you loose it?

Well, i should clear the information that are in log are. If there will be some failure, i don't want this information. But it still be in log area, so even if i restore the DB to the time just before implementing SP, information that are in log area brings the db to the state it was after failure. So ind that case i need to do recovery with initialization?

My main mistake was, that i thought that every data we input to DB is written to LOG AREA, and the, while backup up we insert this data to DATA AREA. Now i understand my mistake.

Log area is space where we keep change information. When DB do savepoint DATA AREA is "refreshed". And a savepoint is being made just before every backup - so that way we have all information backed up.

Thanks a lot Lars!

PS. Could you please tell me on more thing. Is this LOG mechanism works on every DB as i wrote before? Or in particular databases it is different?

lbreddemann
Active Contributor
0 Kudos

> Well, i should clear the information that are in log are. If there will be some failure,

???

>i don't want this information.

Sure, you DO want this. You need it for recovery.

> But it still be in log area, so even if i restore the DB to the time just before implementing SP, information that are in log area brings the db to the state it was after failure. So ind that case i need to do recovery with initialization?

You seem to be talking about a point in time recovery scenario...

Anyhow, implementing and testing out a SP is the use case for a SNAPSHOT (and the documentation is full of information about this as well...)

> PS. Could you please tell me on more thing. Is this LOG mechanism works on every DB as i wrote before? Or in particular databases it is different?

Yes, I could do that.

You may also just get some general DB primer training.

I volunteer in this forum to help people to help themselves.

Not to provide free and private training.

Sorry mate.

Wrong guy to ask for that!

lbreddemann
Active Contributor
0 Kudos

> i'm new to SAP and MaxDB and i have some questions:

>

> 1) When i perform a Complete Backup, does the data from log volumes archived automatically to this backup?

> I did a test. I have created a new database, then in SQL Studio i have created a new table and added there some records. I saw, that after this log area is used in 30%. Then i did complete backup. Nothing has changed. Next, i did a recovery for this Complete backup with initialization (to delete the entries from log volumes). After this, i could see all records and tables that i have created before - i thought it will be lost. Why it happen like this?

Why wouldn't it?

We run a savepoint before we take a backup.

PLUS we note down which transactions are open when the backup is taken.

So on restore time we have all information we need to have to:

- figure out which transaction to recover or rollback (depending on whether the available log ever contains a Commit for the open transactions)

- actually perform the rollback if necessary (the UNDO information are part of the data backup)

- open the database in a transactional consistent state.

So, when you INSERT, COMMIT and take a backup then the data will be there after restore for 100%!

> 2) Let's assume this situation:

> And on 14th i have a database crash. So, if i wan't to recover db to 13.07.2010 do i need Log1 backup, or only Complete2 and Log2? Can i delete Log1 after i do Complete2?

You DON'T want to perform a point in time recovery.

Not with a SAP database.

see [Point-in-time-recovery considered harmful|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8636] [original link is broken] [original link is broken] [original link is broken]; !

Understand what a PiT-Recovery does to your application first - then you may think about to actually learn it.

Way more important: learn and practice hard to perform a FULL recovery.

Do restore drills on "naked" machines.

Regularly.

Over and over.

THAT'S what'll save time and money on that day when your server goes down!

> What's is in case that i have mirrored log volumes and i have actuall log volumes files? Can i import it somehow? Or should i import Complete2, Log2 and then replace Log Volumes Files?

Don't mistake the files of the log area with the log backup - these are simply totally different types of files.

If you really go for mirrored log area files these days, then: yes, you can recreate one broken part of the mirror from the good part.

But that's not about recovery - so leave this aside for now and check the documentation on this later!

> 3) How can i check Log backup using DB13? Every day on 08.00 i have scheduled log backup, files are created without errors, but when i'm trying to check them, i recieve error wrong_hostfile. I checked permissions to that file, all looks good.

You may open a support message and we'll look into this then. OK?

The forum is a terrible place for analysing CCMS stuff...

regards,

Lars

p.s.

as you seem to think "Oracle" ... you may want to read these blogs as well:

[SDN search 'mind the gap'|http://www.sdn.sap.com/irj/scn/advancedsearch?query=%22mindthegap%22#sdn_content_category_value_blogs]

Edited by: Lars Breddemann on Jul 15, 2010 11:20 PM

Former Member
0 Kudos

i'm new to SAP and MaxDB and i have some questions:

1) When i perform a Complete Backup, does the data from log volumes archived automatically to this backup?

I did a test. I have created a new database, then in SQL Studio i have created a new table and added there some records. I saw, that after this log area is used in 30%. Then i did complete backup. Nothing has changed. Next, i did a recovery for this Complete backup with initialization (to delete the entries from log volumes). After this, i could see all records and tables that i have created before - i thought it will be lost. Why it happen like this?

Why wouldn't it?

We run a savepoint before we take a backup.

PLUS we note down which transactions are open when the backup is taken.

So on restore time we have all information we need to have to:

- figure out which transaction to recover or rollback (depending on whether the available log ever contains a Commit for the open transactions)

- actually perform the rollback if necessary (the UNDO information are part of the data backup)

- open the database in a transactional consistent state.

So, when you INSERT, COMMIT and take a backup then the data will be there after restore for 100%!

Ok, i thought that when we insert/delete sth from db, it's first written to LOG AREA. And when we do a complete backup we actually backup only a DATA AREA.

So, could you please confirm me, that if I do a complete backup, I will have all data backed up? Even if my log area haven't been backed up for f.e. 3 weeks?

2) Let's assume this situation:

And on 14th i have a database crash. So, if i wan't to recover db to 13.07.2010 do i need Log1 backup, or only Complete2 and Log2? Can i delete Log1 after i do Complete2?

You DON'T want to perform a point in time recovery.

Not with a SAP database.

see Point-in-time-recovery considered harmful !

Understand what a PiT-Recovery does to your application first - then you may think about to actually learn it.

Way more important: learn and practice hard to perform a FULL recovery.

Do restore drills on "naked" machines.

Regularly.

Over and over.

THAT'S what'll save time and money on that day when your server goes down!

So LOG BACKUPS are only used for PiT Recovery? Do i have to backup it regulary or can i just erease them? I don't wan't to correct someones mistakes, i just wan't to be sure, that in case of crash i will have all data.

What's is in case that i have mirrored log volumes and i have actuall log volumes files? Can i import it somehow? Or should i import Complete2, Log2 and then replace Log Volumes Files?

Don't mistake the files of the log area with the log backup - these are simply totally different types of files.

If you really go for mirrored log area files these days, then: yes, you can recreate one broken part of the mirror from the good part.

But that's not about recovery - so leave this aside for now and check the documentation on this later!

Ok, i admit, that i thought backuping log files is essential.

lbreddemann
Active Contributor
0 Kudos

> >So, when you INSERT, COMMIT and take a backup then the data will be there after restore for 100%!

>

>

> Ok, i thought that when we insert/delete sth from db, it's first written to LOG AREA. And when we do a complete backup we actually backup only a DATA AREA.

??? And where did I write something different?

> So, could you please confirm me, that if I do a complete backup, I will have all data backed up? Even if my log area haven't been backed up for f.e. 3 weeks?

No, you haven't. And I didn't wrote that.

All *committed !!!! * data will be in the data backup.

Because we take a SAVEPOINT.

For open transactions we need to have the log date.

> So LOG BACKUPS are only used for PiT Recovery? Do i have to backup it regulary or can i just erease them? I don't wan't to correct someones mistakes, i just wan't to be sure, that in case of crash i will have all data.

Nope - did not write that either.

Log backups will be required if:

- there were more data changes to the database AFTER the data backup had been taken.

AND

- the required log data is not available in the LOG AREA anymore.

In that case we of course need to have the log backups.

From where should we know about the changed data if not from the log backups then?

> Ok, i admit, that i thought backuping log files is essential.

It is essential.

Maybe it's a tiny bit less critical not to have log backups as it is with Oracle, but it's really just a tiny, tiny bit then.

Based on a data backup you will always be able to restore and open a MaxDB database.

This is not the case with Oracle.

But you still loose all the data changes that happened after the backup was taken.

You loose data when you don't have the log backups ready for recovery.

regards,

Lars

Edited by: Lars Breddemann on Jul 16, 2010 6:56 AM

Former Member
0 Kudos

Hi,

at first - very thanks for your answers - but unfortunetly i still don't have the information I need.

You wrote:

So, when you INSERT, COMMIT and take a backup then the data will be there after restore for 100%!

What would not be included in data backup if i don't make log area backup? Any examples?

I think that you mean, when user is f.e. adding new customer in SAP, he moves in some screens in SAP, then the data are not commited at DB level, but it exist in log area. Am I right?

I do not undestand what information are stored in Log Backup. If i can schedule incremental backups, do i really need Log Backups? If one of log volume will be corrupted, i can resotre DB with initialization, and retrieve all information from the last Incremental Backup. What am I missing?

lbreddemann
Active Contributor
0 Kudos

> You wrote:

>

> So, when you INSERT, COMMIT and take a backup then the data will be there after restore for 100%!

>

>

> What would not be included in data backup if i don't make log area backup? Any examples?

??? Did you think through what I've already written?

Every change of data that happened after the data backup was taken will be missing if you don't have the log data either in the log area or in the log backup.

> I think that you mean, when user is f.e. adding new customer in SAP, he moves in some screens in SAP, then the data are not commited at DB level, but it exist in log area. Am I right?

Nope - this is database recovery. And that's what I was writing about.

Don't make the mistake to think that a COMMIT writes data down to the data volumes.

It doesn't.

But as soon as a savepoint is written, all 'dirty' pages will be written out to the data area and the it will be noted down, which transactions are open and which are committed.

> I do not undestand what information are stored in Log Backup. If i can schedule incremental backups, do i really need Log Backups? If one of log volume will be corrupted, i can resotre DB with initialization, and retrieve all information from the last Incremental Backup. What am I missing?

You're missing that the log contains change information.

It describes how to get from database at moment A to database at moment B - continuously.

Every single data change is captured.

With that you can recover the database up to the very last COMMIT that the application issued.

That way both the application and the database have the same state again after the recovery.

Just taking data backups (incremental or full doesn't matter right now) can not give you this.

You take a data backup at 12.00.

Your application keeps on running.

At 12.15 the server crashes.

If you don't have the log data, your db will be back at 12.00 after recovery.

But your application would still be at 12.15.

Maybe it will re-print some invoices based on the old data.

Or re-issue some orders via internet.

It wouldn't be consistent anymore.

regards,

Lars