0% found this document useful (0 votes)
67 views

Perform Database Backups

This document provides instructions for performing database backups using Transact-SQL scripts or the SQL Server Management Studio GUI. It describes the basic T-SQL syntax for a full database backup, listing the database to backup and backup devices. It also explains how to perform a full database backup using the Management Studio by selecting the backup type, destination file, and option to overwrite existing backup sets before running the backup.

Uploaded by

arya bunny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Perform Database Backups

This document provides instructions for performing database backups using Transact-SQL scripts or the SQL Server Management Studio GUI. It describes the basic T-SQL syntax for a full database backup, listing the database to backup and backup devices. It also explains how to perform a full database backup using the Management Studio by selecting the backup type, destination file, and option to overwrite existing backup sets before running the backup.

Uploaded by

arya bunny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

Purpose: - Perform Database Backups

Author TIRUMALESH YADAV.B


Contact [email protected]
Date 07--02-2013
Version 1
Last Modified Date

Approved by
Approved Date
Perform Database Backups

Scope: - This document will provide the ways to take the database backup.

Description: -

We can perform the database backup through query analyzer or GUI.

By using the below script we can perform the db backup.

The basic Transact-SQL syntax for a full database backup is:

BACKUP DATABASE database TO backup_device [ ,...n ] [ WITH with_options [ ,...o ] ] ;

Option Description

database Is the database that is to be backed up.


Specifies a list of from 1 to 64 backup devices to use for the backup operation.
You can specify a physical backup device, or you can specify a corresponding
logical backup device, if already defined. To specify a physical backup device,
use the DISK or TAPE option:
backup_device [
,...n ]
{ DISK | TAPE } = physical_backup_device_name

For more information, see Backup Devices (SQL Server).

WITH
Optionally, specifies one or more additional options, o. For information about
with_options [
some of the basic with options, see step 2.
,...o ]

 Optionally, specify one or more WITH options. A few basic WITH options are described here.
For information about all the WITH options, see BACKUP (Transact-SQL).

 Basic backup set WITH options:

{COMPRESSION | NO_COMPRESSION}

In SQL Server 2008 Enterprise and later only, specifies whether backup compression is
performed on this backup, overriding the server-level default.

DESCRIPTION = { 'text' | @text_variable }


Specifies the free-form text that describes the backup set. The string can have a maximum of
255 characters.

NAME = { backup_set_name | @backup_set_name_var }

Specifies the name of the backup set. Names can have a maximum of 128 characters. If NAME is
not specified, it is blank.

Basic backup set WITH options:

By default, BACKUP appends the backup to an existing media set, preserving existing backup
sets. To explicitly specify this, use the NOINIT option. For information about appending to
existing backup sets, see Media Sets, Media Families, and Backup Sets (SQL Server).

Alternatively, to format the backup media, use the FORMAT option:

FORMAT [ , MEDIANAME= { media_name | @media_name_variable } ] [ , MEDIADESCRIPTION =


{ text | @text_variable } ]

Use the FORMAT clause when you are using media for the first time or you want to overwrite all
existing data. Optionally, assign the new media a media name and description.

By using the below GUI process, we can pe

Once connected to your database server, you will need to browse to your database in the left
window pane of Management Studio.

Right Click on your database, and under "Tasks" choose "Back Up..."
A new window will open where we will configure where to save the database backup file.

You will want to ensure that the "Backup type" is set to "Full" to get a Full backup of your
database.
Now, highlight the Destination file that is already in the list by clicking on it, and Click "Remove".

Now, Click "Add..." to specify where to save the backup file.

A window will pop up, asking you where to save the backup file. Enter a location of your choice.
For this example, we will save it to "C:\Backup\backmeup-Full-041608.bak".

Note that this is the entire actual file path.


Now, we have to make sure that the backup you are creating overwrites all existing backup sets,
as appending it to an existing set can cause conflicts when attempting to perform a restore. On
the left-hand side of the window, click on 'Options', and then click on 'Overwrite all existing
backup sets'.
Once this option is in place, all that is left to do is to run the backup! Click "OK" to begin the
database backup.

If the database backed up successfully, you should receive a message as pictured below.

You might also like