views:

34

answers:

5

i have a sql server that has a test pp i have written, this thing is gaining traction and i am worried about loosing data (and the time it took users to enter the data) if the SQL server gets corrupted or someone does something dumb.

i am thinking of what options i have that would do a nightly backup as a maintenance plan, and what i can do as far as replicate the DB to another SQL server box.

what are the pros and cons, whats the best practice here?

A: 

If you only need to preserve the structure and contents of the database, then the database backup is best.

If you have a need to work with a replica of the database, then consider replication. Replication takes more work to maintain, and doesn't provide an easy recovery capability if it's there only for backup reasons.

bobs
any word on how i can get a daily job to backup the DB and all its data twice daily?
kacalapy
You can create an SQL Server scheduled job that launches the backup. There are a couple of ways to schedule this job twice a day. For example, you can schedule it to run every 12 hours and set the time it first runs.
bobs
A: 

Automated backups answered here.

Bernard
A: 
  1. I guess you should combine full backups + transation log backups.
  2. This kind of question should be made on serverfault.com - In fact there is a similar question here.
rsenna
A: 

Daily full backup is the Best. If the database size is small, you dont need to keep a replica, since the restore time is less. If its a large database you can consider logshipping or mirroring . For these you need to have the database in full recovery model and have to setup transaction log backup at regular interval. Replication is useful only if you are interested only few tables and not the entire database and it will be transactional replication int his case. Maintenance plan wizard is helpful to set up regular full backup as well as transaction log backup.

Gigs
A: 

You can try Web Deploy tool, which is free and powerful for a lot of tasks.

All you need to do is to use DbFullSql provider and specify a connection string for a source and a file for destination. Web Deploy will use SMO to script your database to a file:

Backup db schema and data:
>msdeploy.exe -verb:sync -source:DbFullSql="Server=.\SQLExpress;Database=MyDatabase;Integrated Security=true" -dest:dbfullsql="d:\DbBackup.sql"

Backup just data (set ScriptData properties as shown in this article):
>msdeploy.exe -verb:sync -source:DbFullSql="Server=.\SQLExpress;Database=MyDatabase;Integrated Security=true",ScriptSchema=false,ScriptData=true,ScriptDrops=false -dest:dbfullsql="d:\DbBackup.sql"

kateroh