Backing up SQL Server database is a good precautionary move against SQL server disasters that can happen due to various reasons such as media failures, user mistakes, hardware damages etc. This is a widely used SQL Server Recovery method. It is possible to backup and restore SQL Server databases using the SQL Server Management Studio. Follow the steps given below to backup SQL Server database. Here we assume that you are using SQL Server 2012.
Full Database Backup – Using SQL Server Management Studio
Source Section
Note: - Check media set name and backup set expiration is an additional option. It verifies the expiry information of the backup set. You can optionally provide the media set name in the Media set name text box.
Reliability Section
Select the required options from the three:
It has two options:
Restore SQL Server Databases Using SQL Server Management Studio
Select appropriate option from the three:
There is no need to modify the settings in this section. However, you can
- Check the checkboxes:
Server connections Section
Full Database Backup – Using SQL Server Management Studio
-
In the Object Explorer, expand databases, select a user database (or expand system databases and select a system database).
-
Right-click the database, click Tasks > Backup.
-
Enter details (as described below) when the Databases dialogue box appears (by default General in the Select a page pane is selected).
Source Section
-
Check the Database list box and verify the database name (change the database name if required).
-
Enter the recovery model (FULL, BULK_LOGGED, or SIMPLE) in the Recovery model text box.
-
Select the backup type as Full in the Backup type list box.
-
Choose Database as the Backup component.
-
Enter a Name for the backup set (you can use the default name suggested the software).
-
Enter description in the Description text box (this step is optional).
-
Enter the backup set expiry information: choose After / On and enter the required values.
-
Choose Disk or Tape as the destination, and click Add; use the Select Backup Destination dialogue box to select the required destination. The added destination appears in the Back up to list box.
-
Click Options in the Select a page pane on the left of the dialogue box. This page shows the advanced options. Enter the details (as described below) as required.
-
Select an Overwrite media option:
-
Backup to the existing media set
Note: - Check media set name and backup set expiration is an additional option. It verifies the expiry information of the backup set. You can optionally provide the media set name in the Media set name text box.
-
Back up to a new media set, and erase all existing backup sets.
Reliability Section
Select the required options from the three:
-
Verify backup when finished
-
Perform checksum before writing to media
-
Continue on checksum error
It has two options:
-
Unload the tape after backup
-
Rewind the tape before unloading
-
SQL Server 2012 supports backup compression. You can select the required options in the Set backup compression list box. The options are shown below.
-
Now, click General in the Select a page pane on the left of the dialogue box. Click OK.
-
Click OK when a message appears after the completions of the database backup.
Restore SQL Server Databases Using SQL Server Management Studio
Backing up SQL databases is a routine process in organizations, owing to the criticality of data carried by them. After events of data losses, users can restore the lost data from the backups. Users can use SQL Server Management Studio for restoring a full backup. The steps for SQL Server Recovery are given below (for SQL Server 2012):
-
In the Object Explorer, expand databases, select a user database (or expand system databases and select a system database).
-
Right-click the database, click Tasks > Restore > Database.
-
Enter the details (as described below) when the Restore Databases dialogue box appears (by default General in the Select a page pane is selected); click OK.
-
Select the source database from the Database list box.
-
Click the browse button (…). Enter the details when the Select backup devices dialogue box appears. Select device type from the list in the Backup media type box (you can use Add to add more devices); click OK.
-
Select the database to be restored in the Database list box (it is available only after the selection of Device in the previous step).
-
Verity the name of the database to be restored in the Database box (you can change the name if required).
-
Click the Timeline button.
-
Enter the details (as described below) when the Backup Timeline dialogue box appears.
-
Click Specific date and time. Enter the time and date using the Date and Time boxes (you can also use the slider bar for it); click OK.
-
Backup set to restore grid now displays the backups (that are necessary to perform the restore action).
-
Click Options in the Select a page pane on the left of the dialogue box. The Options page shows the advanced options. Enter the details (as described below) and click OK.
Select appropriate option from the three:
-
Overwrite the existing database (WITH REPLACE)
-
Preserve the replication settings (WITH KEEP_REPLICATION)
-
Restrict access to the restored database (WITH RESTRICTED_USER)
-
RESTORE WITH RECOVERY
-
RESTORE WITH NORECOVERY
-
RESTORE WITH STANDBY
There is no need to modify the settings in this section. However, you can
- Check the checkboxes:
-
Take tail-log backup before restore
-
Leave source database in the restoring state
Server connections Section
-
Check the checkbox Close existing connections to the database.
- Optionally, you can check the checkbox Prompt before restoring each backup.
- Click OK when the confirmation message appears after restoring the database.
Thanks for this blogger which helped me repaired and recovered corrupted SQL database files. This Blog post provide very easy solution to repair MS SQL database files with the help of third party SQL Database Recovery Tool.
ReplyDeleteVery helpful tool to recover data
ReplyDeleteThis is the right method to backup and restore SQL Server database. Apart from this, to restore SQL Server database to Live SQL Server you can use SQL Database Repair tool. Visit https://www.datarepairtools.com/sql-recovery.html to check out the SQL Repair tool features and download the demo software to check its working and effective user interactive interface.
ReplyDelete