Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 318
  • Last Modified:

SQL Backup

Is it possible for the SQL backup file will be override each time rather than appending to the existing one ? Where can I modify this setting ?

Is it possible to send out an notification email after each backup ?

Tks
SQLBackup.png
0
AXISHK
Asked:
AXISHK
4 Solutions
 
ste5anSenior DeveloperCommented:
Right click on the backup task and change it..

Sure. But you must correctly setup Database Mail first.
0
 
AXISHKAuthor Commented:
Can you show the setting through a screenshot ?

How can the Database mail linked to my SQL Backup job ?

Tks
0
 
Vikas GargBusiness Intelligence DeveloperCommented:
Hi,

You can use property window to change from Append to Overwrite
as shown in the image

Backup
and for mail notification you can configure DBMAIL as shown in below link

http://nideesh.wordpress.com/2012/10/24/how-to-setup-sql-server-20082008r2-maintenance-plan-and-email-notifications/

Hope this will help
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ste5anSenior DeveloperCommented:
Please read the Database Mail documentation first. Otherwise even with a cooking receipt it's later hard to understand and modify.
0
 
AXISHKAuthor Commented:
Tks. How to link the job to a email alert ?

Tks again.
0
 
ste5anSenior DeveloperCommented:
0
 
David ToddSenior DBACommented:
Hi,

Take a look at what Ola Hallengren's script does. It adds the datetime etc to the backup filename, so each backup creates a separate unique file.
http://ola.hallengren.com/

I no longer write my own backup routines. Instead I use Ola's.

HTH
  David

PS What the others said about using Database mail, adding that to the SQL Agent profile, then adding operators and getting a notification on a job that fails.

Brent Ozar's sp_Blitz checks for enabled scheduled jobs that don't have a failure notification.
0
 
nemws1Database AdministratorCommented:
If you ever do a backup via SQL, add the "INIT" option (and make sure you don't have "NOINIT" set) and it will overwrite the previously existing backup.  I agree with others though - use Ola Hallengren's maintenance script - it is excellent.

BACKUP DATABASE [AdventureWorks2008R2]
	TO DISK = N'F:\Backup\AdventureWorks2008R2_FULL.bak'
	WITH NOFORMAT
	, COPY_ONLY
	, INIT
	, NAME = N'AdventureWorks2008R2-Full Database Backup'
	, SKIP
	, COMPRESSION
	, NOREWIND
	, NOUNLOAD
	, STATS = 5
;

Open in new window

0
 
Steve WalesSenior Database AdministratorCommented:
Just be aware that if you are overwriting the previous backup ... and that's ALL you are doing, you are exposing yourself to a serious failure.

Say you start your backup at 8PM and it takes 45 minutes.

Each night you overwrite your backup.

What happens if you have a critical failure at 8:30 PM?

You've overwritten your last good backup and your current backup hasn't finished yet.

Be aware of that.   You can set up maintenance plans to clean up old backups and set up your backups to write a new file very night with date and time appended (or use Ola Hallengren's scripts as a base as indicated by David Todd above).
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now