views:

234

answers:

4

Hi all!

I'm looking for some help/suggestions for backing up two large databases to one server dedicated to reports. The situation is;

My company has two databases for its internal website. One for the UK and one for Europe. Both are mirrored for DR.

I have a server based in Europe which is dedicated to Microsoft Reporting Services, where we run reports based on the data collected in those two databases.

We do not want to point reporting services to the live databases for performance/security reasons so we currently backup both databases on a daily basis and restore them to our Reporting Services server.

However this means we are putting a strain on our networks by backing up the entire databases, and also the data is only up-to-date by midnight yesterday.

Our aim is to have the data up to date by at least 15 minutes, it has been suggested to look at Log Shipping so I wondered if anyone had any experience in setting this up and what are the pros and cons and whether there is a better alternative?

Any help would be greatley appreciated, Thanks

+1  A: 

You should look at replication as an alternative to backups.

John Nolan
Thanks John I'll look into this!
HighlyEvolved
+2  A: 

Log shipping is a great solution for this. We've got articles about it over at SQLServerPedia's Log Shipping section, and I've got a video tutorial on there talking you through your different options. One thing to keep in mind about log shipping is that when the restores happen, your users will be kicked out of the reporting database.

Replication doesn't have that problem, but replication is nowhere near "set-it-and-forget-it" - it's time-intensive to manage, and isn't quite as reliable as you'd like it to be. In addition, you may have to make schema modifications in order to use replication. Log shipping is more automatic & stable, but at the cost of kicking users out at restore time.

You can minimize that by having two log shipping schedules - one for daytime during business hours, and one for the rest. During business hours, you only restore the data once per hour (or less), and the rest of the time you do it every 15 minutes.

Brent Ozar
Thanks Brent that's really helpful, when you say kicking users out, does this mean they would simply lose access to the database for a certain period of time every hour? or would it in fact kick them out of a terminal services session on our Report Server? Apologies if this is a dumb question I'm new to SQL Server : )
HighlyEvolved
Not a dumb question at all! They would lose access to the database - the database will kill connections and wait while the transaction log is restored.
Brent Ozar
Apologies for the late response...I've set up the log shipping on a test database between two 2005 sql servers and its working really well! However (and this is my fault for not mentioning it in my initial question!) I am not allowed to log ship from SQL 2005 to a 2008 server which is running our reports. I didn't realise there would be compatibilty issues between the two until I came to setting up the transaction logs. I assumed 2008 would be compatible. Do you know if there is a way around this? Thanks
HighlyEvolved
You can set up manual log shipping between SQL 2005 and 2008 by writing your own T-SQL scripts, or use third party products to do it. It's not generally a good idea because you can't really use the SQL 2008 box as a failover method - once you fail over to 2008, you can't go back. To make a long story short, yes, you can do it but no, it's not easy or a good idea.
Brent Ozar
Thanks Brent. I attempted doing an automatic log ship from 2005 to 2008, the problem I came across was that when a file was shipped it had to be converted to 2008, this meant the database recieving the files on the 2008 server was always in a restoring state and couldn't be accessed for reporting purposes. The only way I could access was to disable the log shipping task.
HighlyEvolved
+2  A: 

We developed a similar environment. We used Mirroring to get the data off to our reporting server and created an automated routine to create Snapshots of the database every 15 min. These snapshots only take 1 to 2 seconds to create in our environment and give us a read only copy of the database. Let me know if you would like me to go into deeper detail.

Note we are running Enterprise on both servers.

jgardner04
How difficult is this to set-up and maintain? We are also running Enterprise edition on our servers.
HighlyEvolved
It is not very difficult for either. Once the mirroring was set up I created a routine that dumps the snapshot and recreates it every 15 minutes. Everything is automated so I have set it up and not had to mess with it in a couple of months.
jgardner04
I've have set this up on both our UK and European mirrors and it's working really well, the snapshots are created in a matter of seconds and we are able to access data within the last 15 mins, this is a really good solution, thanks Jonathon!
HighlyEvolved
This is an excellent solution for simple database platforms. It is however worth noting that on very large databases (VLDB) this may not provide adequate performance for the reporting platform. Replication in such case comes into it's own because you can tweak the replicated database i.e. add indexes to specifically service reporting queries without making the same modifications at the Publisher (thereby mitigating detrimental effects to the OLTP platform).
John Sansom
John is very correct about VLDBs. Thanks for adding that point John
jgardner04
+1  A: 

Hi,

I would recommend that you look into using Transactional Replication.

It sounds as though you are looking to implement a scenario that is similar to what we are currently implementing ourselves.

We use Transaction Replication (albeit real time, you would most likely wish to synchronize your environment on a less frequent schedule) to offload a copy of our live production database to another server for reporting purposes.

Offloading reporting data is a common replication scenario and is described here in the Microsoft Replication documentation.

http://msdn.microsoft.com/en-us/library/ms151784.aspx

Brent is right in that there is indeed an element of configuration required with Replication, along with security considerations that would need to be addressed however, there are a number of key advantages to using Replication in my opinion, including:

  • Reduced latency in comparison to log shipping.
  • The ability to Publish only the Articles (tables) that are required for reporting.
  • Reduced storage requirements.
  • Less data being published means less network traffic.
  • Access to your reporting data/database at all times.

For example, in our environment, we decided to replicate only the specific tables (articles) from our production database that we actually require for reporting.

I hope what I have described is clear and makes sense but please do feel free to contact me if you have any queries.

John Sansom
Thanks John that was very clear and very helpful! I've got a fair bit of reading to do from you guys and will test these methods and let you know how I get on.
HighlyEvolved
You're welcome. Be sure to let us know how you get on or if you need any further assistance.
John Sansom
Hi John, I've looked into this method and while it would work in most scenarios (and it is also Microsofts preferred recommendation) it wouldn;t be suitable for us just yet, only because it would mean altering our database schema. But this is something we will be looking at in the future when we improve our structure for definite
HighlyEvolved
Thanks again for your help!
HighlyEvolved
You're welcome. One point to note, it is only Merge Replication that would require schema changes to be applied to your database. Transactional Replication does not make any schema changes.
John Sansom
Thanks John I didn;t realise that, that's good to know.
HighlyEvolved