looking for best practice of sync sql database on 2 different server

here is my requirement.
1. both server run 2003 R2 XP.  p-server runs 2005 SQL work group, backup server using SQL express.
2. we have up to 30 minutes to start the backup server if prod. srv failed, and it is ok to use bcp utility to reload the data.

looks for best practices or examples.

Who is Participating?
dbidbaConnect With a Mentor Commented:
You don't say what your requirement is for allowable data loss. To minimize data loss in the event of the failure of the primary instance, I recommend that you do full backups nightly plus differential backups every hour or two. Also do transaction log backups on a frequent interval. Perhaps as frequent as every five minutes. All of these backups should be written to a disk NOT located on the primary database server to avoid losing them if the server becomes unavailable. It is most convenient to map a drive and write them directly to a folder on the backup server. When the primary fails, on the backup instance you then restore the most recent full backup, followed by the most recent differential backup, followed by the transaction log backups taken since the restored differential. Your data will then be within five minutes of what is was when the primary failed. You should have restore scripts prepared in advance of the failure. (Look up restore with norecovery.) If you care make a little larger investment in coding, you can implement manual log shipping (express doesn't support automated log shipping), or implement replication to keep your backup instance up to date and quick to bring on-line.
chapmandewConnect With a Mentor Commented:
You're better off just Restoring a full backup to your express instance  
QPRConnect With a Mentor Commented:
I agree.
We take a backup of our production database (obviously) nightly and copy this backup file to the test server where it is used to restore the test database. We do this for testing/development purposes but there is nothing stopping you from doing the same for DR purposes. Having the backups copied and restored overnight will save time should stuff hit the fan.

The script below is used to find the most recent .bak file and perform the restore. Obviously you need to change the paths/names/files to suit.

Don't forget to have your windows and/or SQL users already resident on the backup database server to again save time in getting back up online.
declare @address varchar(200)

select top 1  @address =  '\\servername\SQLBkup\dbname\' + right(M.physical_device_name,28)
FROM [servername].msdb.dbo.backupset S 
	INNER JOIN [servername].msdb.dbo.backupmediafamily M
 		ON M.media_set_id = S.media_set_id
WHERE S.database_name = 'dbname'
	 AND DATEDIFF(DAY,S.backup_start_date,GETDATE()) < 2
	 and right(physical_device_name,3) = 'bak'
order by S.backup_start_date desc

Restore Database dbname
	From Disk = @address 
		with  move 'dbname_Data' to 'D:\Microsoft SQL Server\Databases\MSSQL\Data\dbname_Data.MDF'
		, move 'dbname_Log' to 'D:\Microsoft SQL Server\Databases\MSSQL\Data\dbname_Log.LDF'

Open in new window

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

QPRConnect With a Mentor Commented:
I should add that the entire above process is automated... nobody sits there at night doing this :)
SimpsonThePhilConnect With a Mentor Commented:

If this is a high availability situation then I suggest that you upgrade your MSDE edition and implement transaction log shipping.  This will enable both servers to be pretty much identical depending on the shipping schedule.  It will also provide a higher degree of protection and reduce your exposure to server failure.

mshox1Author Commented:
1st thank you much for useful input and comments.  I have 1 questions,  I think that is I did not know where to find the sql admin step-by-step manual, so I can turn this wonderful ideal into practices.

is this part of sql 2005 studio management tools?   please advice.  thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.