473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Backup Help

I am implementing the following backup strategy

Sunday 2AM: Full Backup
Monday-Saturday 2AM: Differential Backup
Every 10 minutes: Transaction Log Backup

I have set this up on my production database and am now trying to
prepare my self for disaster when it strikes. I am copying the log and
database backups to a test server and attempting to make the the test
server just like the production server was at the time of the last
transaction log backup. I restore the full backup, then the
differential backups with no problems, since there are only up to 6
differential backups to restore.

The problem comes when I want to restore my transaction logs. I could
have around 100 logs to restore to get back to the point of the last
transaction log backup. Is there an interface in Enterprise Manager
that I can say restore Transaction Log x thru z?

Jul 23 '05 #1
6 1515
Ty,

If you are trying to mimic production as test, you may want to look into
log shipping (if you have SQL 2000 Enterprise) or replication.

There is no interface that I know of to apply all those transaction log
backups.

You would have to generate a sql script to apply them and with the file
number changing this could be more time consuming.

Can you just restore test to the last full/differential backup?

Jeff

--
Message posted via http://www.sqlmonster.com
Jul 23 '05 #2
This is an accounting system so I only can lose 10 minutes of data. I
am trying to prepare for worst case scenario, in which everything is
toasted and I need to get back to that state the system was in during
the last 10 minutes before the disaster. I'd rather figure this out now
when all is peachy.

Thanks for the suggestion on log shipping, I will research it more.
Other than log shipping, does anyone out there have any suggestions for
automating the application of these transaction logs?

Ty

Jul 23 '05 #3
There probably aren't any radically different ways to do it - by
definition, "log shipping" means the process of copying and restoring
transaction log backups in sequence. There are a number of articles on
the web which describe log shipping and how to implement it, or as
Jeffrey said, if you have Enterprise Edition then it's already built
in.

Depending on how big your company is, and how expensive downtime/lost
data in the accounting system would be, there are other options you
could look at, such as replication and clustering. But they are rather
more complex to plan and implement, so if log shipping will cover your
requirements (at least for now), then it's probably the best option.
There's some useful related information here:

http://www.microsoft.com/sql/techinf...ailability.asp

Simon

Jul 23 '05 #4
Let's throw log shipping and clustering out of the conversation. Is
there no automated way for me to restore a transaction log. Lets say a
company only does one full backup a week on Sunday at midnight, but
backs up the transaction log every 10 minutes. The database farts and
dies on Saturday. That means there are approximately 6 logs/hr x 24
hr/day x 6 days =864 logs to restore. Microsoft provided no way to
apply these logs? The only way I can see to accomplish this is using
RESTORE HEADERONLY to find the base LSN from the db backup, then using
RESTORE HEADERONLY on the log backup and iterating through each record
in the result set that has an LSN usable based upon the backup LSN.

Sounds like multiple days of coding and tinkering to get that script
working. Does anyone have a script already written? Does good 'ol
Mircosoft provide one?

Regards,

Ty

Jul 23 '05 #5
(Ty******@gmail.com) writes:
Let's throw log shipping and clustering out of the conversation. Is
there no automated way for me to restore a transaction log. Lets say a
company only does one full backup a week on Sunday at midnight, but
backs up the transaction log every 10 minutes. The database farts and
dies on Saturday. That means there are approximately 6 logs/hr x 24
hr/day x 6 days =864 logs to restore. Microsoft provided no way to
apply these logs? The only way I can see to accomplish this is using
RESTORE HEADERONLY to find the base LSN from the db backup, then using
RESTORE HEADERONLY on the log backup and iterating through each record
in the result set that has an LSN usable based upon the backup LSN.

Sounds like multiple days of coding and tinkering to get that script
working. Does anyone have a script already written? Does good 'ol
Mircosoft provide one?


Since I rarely have to restore transaction logs, I might be missing
something, but there is a screen in Enterprise Manager which looks
spot on target. Right-click databases, select All tasks, and then
Restore. In the dropdown "Show all backups for all databases". Select
the database you want to restore backups for. In the box below, the
full backups and the log backups will appear (and I assume the
differential.)

I will have to admit never having tried it, but I'm pretty sure that
I did something like this in 6.5 days, and I can't see why MS would
drop such a feature.

If you want to look at scripts, this could be a starter:
http://www.karaszi.com/SQLServer/uti...ll_in_file.asp
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #6

<Ty******@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Let's throw log shipping and clustering out of the conversation. Is
there no automated way for me to restore a transaction log. Lets say a
company only does one full backup a week on Sunday at midnight, but
backs up the transaction log every 10 minutes. The database farts and
dies on Saturday. That means there are approximately 6 logs/hr x 24
hr/day x 6 days =864 logs to restore. Microsoft provided no way to
apply these logs? The only way I can see to accomplish this is using
RESTORE HEADERONLY to find the base LSN from the db backup, then using
RESTORE HEADERONLY on the log backup and iterating through each record
in the result set that has an LSN usable based upon the backup LSN.
I don't know why you'd care about the LSNs at this point. Simply grab the
first log file after the DB backup has completed.


Sounds like multiple days of coding and tinkering to get that script
working. Does anyone have a script already written? Does good 'ol
Mircosoft provide one?
Replace the database_name and \\remote_drive\share1 with your own database
name and the disk where transaction log backups are stored.

This will generate a table with them listed in order with the restore syntax
added in, etc.

Simply cut and paste from the point you need forward.

Works great.

Bill is in the mail :-)
-- update dbname and directory and this will generate a quick list of
commands to restore backups.

create table #log_table
(
backupfile varchar(512)
)

create table #command_table
(
restore_commands varchar(1024)
)
go

declare @dbname sysname
declare @directory sysname
declare @cmdshellstring varchar(512)
select @dbname='Database_name'
select @directory='\\remote_drive\share1'
select @cmdshellstring = 'dir ' + @directory + @dbname + '\*.trn /od /b'
insert #log_table execute master..xp_cmdshell @cmdshellstring
select 'restore log '+ @dbname + ' from
disk='''+@directory+@dbname+'\'+backupfile +''' with norecovery' from
#log_table
select * from #command_table

select * from #log_table where backupfile like '%.bak' order by backupfile

drop table #log_table
drop table #command_table

Regards,

Ty

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: deprins | last post by:
Hello, I have run into some problems with logfiles and backup logfiles (MS SQL server). I have read much about them but uptil now I dont seem to grasp how it works. Specially the part of working...
2
by: anton.aleksandrov | last post by:
Hello, First of all - sorry for may be stupid question, but as I am not a Win* administrator and my field is *nix, I am a little bit stuck with a problem, presented to me by one of the customers....
6
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API...
6
by: Uthuras | last post by:
Greetings, We have DB2 V 8.1 with FP 4 on AIX 5.2. Our database backup is done using TSM v 4.1.2. However, we notice TSM make use of only one session even though we defined 4 sessions for...
1
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1",...
14
by: johnm | last post by:
Hello All, I appreciate all of the help with my previous posts. It's nice having such a knowledgeable group to draw upon for help. I have taken all of your previous suggestions to heart and...
2
by: | last post by:
Hi all, continued from yesterday's posting... I still haven't found a solution to this issue. I put a breakpoint in private void SqlBackupPercentComplete(string message, int Percent) {...
1
by: | last post by:
Hi all I am posting this to check if anyone could help me. The problem still persists. I am beginner in C#. Thanks. Subject: SQLDMO.Backup and ProgressBar - help please From: ...
0
by: vhernz | last post by:
Hi, I am new in MSSQL and recently encountered a problem in backing up the database. Here is the scenario 1. There is an schedule backup everyweek which overwrite the backup file everytime...
5
by: smoi | last post by:
Hi all, My manager ask me to do backup for 3 database and restore them in a new server. I did the backup for the 3 database into BAK file. Then in the new server, when I did the restore in SQL...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.