Posted by Chris Presley on Nov 4, 2009
This is the first post in a series dedicated to exploring the backup and availability options in SQL Server 2005 and 2008. It is aimed at anyone unfamiliar with the database backup options in SQL Server 2005 and 2008. I’m not going to explore every single option or scenario, the goal is to give you the language and the tools to do deep dives where you need to.
SQL Server 2005 has several DBA-job-saving options available to the would-be administrator. Think of a Database Backup as the technology to save data and Database and Availability as the technology to keep it online and available to it’s consumers.
A very brief introduction to SQL Server databases
Its important to have a few SQL Server database basics in order to understand the backup options. If you know what a recovery model is, and the difference between an .ldf and .mdf file, you can skip this section. If this is as good as a foreign language to you, read on.
Read the rest of this entry . . .
Posted by Chris Presley on Jan 12, 2009
Let’s say for you want to move a database from one environment (possibly production) to another (possibly development) on a semi-regular basis. After about the 10th time doing it manually, you’re ready to automate the process. But how?
That’s what I intend to help with in this post. For this example, I’m running two Virtual servers, both running Windows Server 2003 and SQL Server 2005 SP2. We’ll use the AdventureWorks OLTP database, available for download from http://www.codeplex.com/SqlServerSamples. I’m running SQL Server and SQL Agents with local users that have permissions on both machines. This should work for SQL Server 2005 or 2008, and the Windows version level isn’t important.
There are a couple ways you could go about this task. One way would be to write stored procedures and call them with a batch file using osql.exe and SQL Agent job or your enterprise scheduler. There’s nothing wrong with that approach, but I think that for this task, SSIS packages give more options, flexibility, and simplicity for ongoing management.
At a high level, the SSIS package we are about to create will do the following:
Read the rest of this entry . . .
Posted by Michelle Gutzait on Aug 11, 2008
I am often asked what ways are there to minimize downtime when upgrading from SQL Server 2000 to SQL Server 2005, or when moving databases to a new (probably bigger and stronger) environment.
Well, if you can afford having both–old environment and new environment in parallel–this task can be very easy and straightforward . . .
Options
First, let’s see what are the options to copy a database from one server to the other.
- Detaching and re-attaching the database.
- Using backup and restore.
- Using the database copy wizard.
- Manually (creating schemas + transferring data), probably by using DTS/SSIS packages.
- And here is another cute method: use the snapshot creation and delivery part of the replication.
I am not fond of the third method — the wizard never works very well for me. The fourth method? — nah, I am too lazy. Attaching and detaching database files? — the original database goes offline until the files are moved to the new location; it’s not what we want.
If the database is small to medium size, the replication snapshot can be used. If the database is larger, backing and restoring the databases might be the best solution. In these methods, the original database can stay on line while the secondary database is being built.
If you have large databases
What are the tasks that usually take the most time when moving large databases using backup and restore?
Read the rest of this entry . . .