Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Automated Backups [closed]

What are the recommendations of software products for creating automated backups of SQL Server 2008 databases?

The backup should happen without taking the database offline/detatching.

like image 696
blu Avatar asked Jan 29 '09 23:01

blu


People also ask

How do you stop a SQL database backup?

From the Windows Control Panel, select Administrative Tools, then Services. Find the SQL Backup Agent service for the relevant instance of SQL Server, for example SQL Backup Agent-<instance name>. The SQL Backup Agent service for the local instance is called SQL Backup Agent. Right-click the service and select Stop.

How can I check SQL backup schedule?

Go to the Object Explorer window (located on the left) and make sure that your SQL Server Agent is running. Enter the name of the Maintenance Plan you are going to create. Press on the calendar icon on the top-right highlighted section on the job schedule screen. It will bring up the job schedule screen.


2 Answers

If you are using SQL Server Express, you won't find a UI to run periodic backups.
In this case you have to run a batch using Windows Scheduled Tasks or something similar.

Don't forget to use a user with enough privileges to access SQL Server.

In the batch file

"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S  (local)\SQLExpress -i D:\dbbackups\SQLExpressBackups.sql 

In SQLExpressBackups.sql

BACKUP DATABASE MyDataBase1 TO  DISK = N'D:\DBbackups\MyDataBase1.bak'  WITH NOFORMAT, INIT,  NAME = N'MyDataBase1 Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10  BACKUP DATABASE MyDataBase2 TO  DISK = N'D:\DBbackups\MyDataBase2.bak'  WITH NOFORMAT, INIT,  NAME = N'MyDataBase2 Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10  GO 
like image 173
Eduardo Molteni Avatar answered Oct 25 '22 17:10

Eduardo Molteni


I would recommend just creating a maintenance plan in SQL Server to handle the backups, it can be configured to backup to a specified location at specified times, without taking the databases offline, and will handle your incremental backup cleanup.

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

like image 25
cmsjr Avatar answered Oct 25 '22 19:10

cmsjr