[Show all top banners]

the_hareeb
Replies to this thread:

More by the_hareeb
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 SQL server backup question
[VIEWED 2392 TIMES]
SAVE! for ease of future access.
Posted on 07-19-10 3:42 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Hi, I am new to SQL server administration. Got a question about backups.

If I am on Full recovery mode. Here is the scenario.

1. Fullbackup @ 12am on Saturday
2. Disaster occures @1pm on monday

I HAVE NOT made any transaction log backups after I did my fullbackup @12am on saturday. I am still able to recover my database at the state it was @12:50pm Monday right? So why do i need to make periodical transaction log backups (DBAs suggest every 15 mins after full backup), if i can restore to any point in time after full backup without making any periodical transaction log backups.

Your help appriciated.




 
Posted on 07-19-10 3:58 PM     [Snapshot: 6]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

How can you recover your database @12:50 PM Monday if your last full backup is at 12:00 AM on Saturday and with no T-Logs ? How much space have you provided to the T-Log of your database ? Coz if your DB is in Full mode then your T-Log gonna fill up until you take backup and you are screwed.
 
Posted on 07-19-10 4:08 PM     [Snapshot: 15]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

To your question,


So why do i need to make periodical transaction log backups (DBAs



suggest every 15 mins after full backup), if i can restore to any point in time after full backup without making any periodical transaction log backups.


You can restore to that point in time ( in your case the last full backup as you do not have any T-log backups). So, if you do not have any T-log backups then you can restore only to that point ( last full back ) and you lost all the valuable data from that point. I think you are smart enough to know the value of data. :)


 
Posted on 07-19-10 4:11 PM     [Snapshot: 13]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I am doing all this on test environem=ent btw.

I made a full backup.I have not made any tlog backups since then. Then I go ahead and delete some rows. I go to restore and it lets me choose the time in the middle(if i want as recent as possible, i need to make tail log backup, but since I want say 1 hour from the deletion, i did not have to make tail log backup). After the restore, I checked the table, and it had sucessfully restored the rows i deleted earlier.

Another quesiton, if i make t-log backups, does SQl server stop adding entry to my original transaction logs? Why else do i need to make transaction logs backups? because it seems like i dont need it to make point in time restores.



 
Posted on 07-19-10 4:28 PM     [Snapshot: 20]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

So, you are saying restoring the DB with the Full Backup ( taken saturday) , the changes you made afterwards was also seen - undoubtedly impossible.


You have to have T-Logs backups taken if you want a point in time recovery - Period..


 


 
Posted on 07-19-10 4:32 PM     [Snapshot: 23]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

My understanding is that enabling a full recovery mode is enabling the transaction log. In your case the data got restored looking from the transaction log.


You are right, you don't have to make a transaction log backup. If you don;t your ldf files keeps on growing. If that is not a concern then you don't need that to be backed up.


No, if you take sql t-log backup, it will continue writing to your log files, its just the check point was reset. If you have mutiple transaction log backups, you cannot miss anyone of those to restore them up to the point of failure.


 


 
Posted on 07-19-10 4:36 PM     [Snapshot: 28]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

another scenario...

1.take full backup at 4:20pm
2.delete rowid=2 from dtabase @4:22pm
3.delete rowid=3 from dtabase @4:24 pm
4. I realize i should not have deleted rowid=3
5.make tail log backup @4:26pm and restore databse @4:23pm (I have both rowid=2 and rowid=3)

notice I have not made any t-log backups until step 5 where i made backup of tail log.

 

 
Posted on 07-19-10 4:40 PM     [Snapshot: 36]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

yes khaiurey, thats what i think too. it looked at the original transaction log ! I just had to make the tial log backup right before restore and it allowed me to do restore to any point of time between full backup and point of failure.

so, if i make periodical backups of tlogs, could you please explain the benifits of doing that? I am not understading this truncating, check point stuff. thanks for the input stylish and khairey. Stylish, please correct me if we are assuming things that is wrong.

 
Posted on 07-19-10 8:34 PM     [Snapshot: 81]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I think, still you are getting those record restored from the log even though it was backed up.  If you have deleted the transaction log backup and try to restore it, then, I think they wont reappear.


 
Posted on 07-19-10 8:54 PM     [Snapshot: 86]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

In other words, sql is taking all your transaction log files as a single chunk while you are restoring. It is not just referring to the current log file. If you delete any one of the log backup in the sequence then you will not be able to recover anything after that sequence.
e.g
4:05 PM - Full_backup.bak, and your transaction log resets
4:10 PM - transaction log backup -log1.trn
4:11 PM - delete record 1
4:15 PM - transaction log backup - log2.trn
4:16 PM - restore at point 4:12 PM (record 1 will get restored), but if you have deleted log1.trn or log2.trn and try to restore at point 4:12 PM then record 1 will not get restored (you will not have option to restore at that point or it will error out or simply you can't restore).

So the concept you are thinking is right. Its just SQL is making a 'smart' decision to take into consideration all the transaction log backup while restoring.

I am not sql dba, just have worked little on its backup and log shipping/mirroring. I may be totally wrong. So please verify yourself.

And benefits of transaction log backup looks obvious to me. If you hadn't backed up transaction log and your single transaction log is corrupted then you will loose all the data after the last full backup. But if you have multiple file, then you wont loose the data until you loose the sequence of trn log. If your tail is corrupted, you can restore up to the last trn backup which could be just few minutes earlier. So you can restore up to any point your trn files are fit. Further trn backup is completed in much less time compared to full backup. So it is usually done every few minutes. The previous trn backup after the full backup is not needed. This way you are also preventing your log file from increasing indefinitely.
Hope I made you clear.

Last edited: 19-Jul-10 09:14 PM

 
Posted on 07-19-10 9:50 PM     [Snapshot: 115]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thanks khairey. could you also explain 'resetting the transaction log' part. Does it resets after full backup or periodic transaction log backups. So after I take my full backup, it truncates the transaction log? whats this truncating? some scenarious would be helpful
 
Posted on 07-19-10 11:08 PM     [Snapshot: 122]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

read this and other articles of transaction logs / truncation of transaction logs/ transaction logs architecture etc.
http://technet.microsoft.com/en-us/library/ms189085.aspx


 
Posted on 07-19-10 11:31 PM     [Snapshot: 133]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thanks khairey. i am getting more hang of this.
 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 60 days
Recommended Popular Threads Controvertial Threads
What are your first memories of when Nepal Television Began?
निगुरो थाहा छ ??
TPS Re-registration case still pending ..
Basnet or Basnyat ??
मन भित्र को पत्रै पत्र!
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
TPS Work Permit/How long your took?
Guess how many vaccines a one year old baby is given
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
चितवनको होस्टलमा १३ वर्षीया शालिन पोखरेल झुण्डिएको अवस्था - बलात्कार पछि हत्याको शंका - होस्टेलहरु असुरक्षित
Travelling to Nepal - TPS AP- PASSPORT
Nepali doctors future black or white usa ?
Doctors dying suddenly or unexpectedly since the rollout of COVID-19 vaccines
Morning dharahara
nrn citizenship
Another Song Playing In My Mind
TPS Renewal Reregistration
WHAT DO YOU GUYS THINK ABOUT THIS?
हेर अमेरिकामा नेपालीहरुको बेज्जत
Informatica consultancy share
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters