RSS

Monthly Archives: January 2019

Method to Backup and Restore SQL Database

If you are an SQL user, you must back up your SQL database to save your business-critical data from getting lost/ deleted permanently. Only regular data backup can safeguard your data from various mishaps like end-user error, hardware issues, etc. Just by knowing the importance of backup is not suffice: users need to know the procedure in detail. This post will tell you some of the trusted methods to backup and restore database in SQL Server.

How to Backup and Restore Database in SQL Server

We will be providing you with a step-by-step guide to both the processes: SQL database backup and restore. Read the following segments to know more about it.

  • How to Backup SQL Database

Using this method of SQL Server Management Studio (SSMS), users can back up the database that can be used at any crucial moment.

a. Open SSMS and go to Object Explorer. Select the Servername and expand it.

b. Expand Databases to choose a user database. Or you can expand System Databases to choose any system database.

c. Right-click and hover your cursor on Tasks>> click Back up to get the Back Up Database dialog box.

d. Confirm the name of the database from the drop-down list of Database. If you want, choose another database from the list.

e. Choose Full from the drop-down list of Backup type. (You can also choose SIMPLE or BULK_LOGGED)

f. To create the copy-only backup, select the checkbox beside the same option.

g. Select the radio button beside Database under Backup component.

h. Under Destination section, choose your destination for backup from the Back up to drop-down list. Click Add to include extra backup objects and/or their destinations. You can also remove a mistakenly added backup destination by selecting it and clicking on Remove.

Note: To back up a transaction log, run this script. In this example,l get created in AllSalesWorks_FullRM_log1.

  • How to Restore SQL Server Database from Backup File

If the SQL database encounters some issues that cannot be resolved, the last good backup of the database can be restored to fix the problem. In this section, we will describe the process to restore SQL database from the backup file.

For Full Database Restoration

a. To execute this process, start SQL Server Management Studio (SSMS), select the option Databases.

b. Right-click on it and choose Restore Database to open a window.

c. Click on the radio button select From Device under Source for restore section and then click on the Browse icon.

d. Specify Backup window will open. Click on Add and go to the location where the flat files are stored. Select the first backup file from the list as it is the Full backup file.

e. Click on OK. The file will get added to the Specify Backup window. Click on OK again.

f. Choose the target database where you want to restore the backup file by going to the section “Destination for restore.” Under “Select the backup sets to restore” section, check mark the database file chosen earlier.

g. Select Options from the left pane and then do these steps:

  • Check the box beside Overwrite the existing database (WITH REPLACE) under ‘Restore potions’ section.
  • Under ‘Recovery state’ section, choose Leave the database non-operational, and do not roll back uncommited transactions. Additional transaction logs can be restored. (RESTORE WITH NORECOVERY)” radio button.

h. Click OK and the restoration will be done.

I. Perform these steps for every incremental backup file, which includes the .tm file. When you reach a point when you have to restore the point-in-time file, follow this second method after “Restoring” message appears.

For Point-in-Time File Restoration

These steps need to be performed for the restoration of last incremental file that contains the point-in-time:

a. Start SQL Server Management Studio to right-click on Databases>> click Restore Database.

b. Choose From Device option under Source for restore section and click Browse.

c. On the next window, click on Add to go to the location of the incremental backup file with the point-in-time that you want to restore. Select that file and click OK.

d. Click on OK again. Select the added backup file in Select the backup sets to restore segment.

e. Choose the destination database in Destination for restore section. Click on Browse button next to “To a point in time” to make ‘Point in time restore’ window appear.

f. Enable ‘a specific date and time’ option and select the date and time.

g. Click on OK>> Options (left panel)>> Overwrite the existing database>> Leave the database ready to use by rolling back uncommitted transactions. Additional transaction logs can be restored. (RESTORE WITH RECOVERY)

h. Click OK to perform the process. In the restored database, you will only view the changes done to a particular point-in-time.

SQL Backup Recovery: The Ultimate Way to Restore Healthy and Corrupt BAK File

As we can see, the manual restoration process is a long one. Moreover, this process does not support restoring data from corrupt BAK file. To avoid these problems, SQL bak File Repair is a reliable solution. In some easy steps, users can restore their corrupt or healthy .bak file to SQL database.

a. Launch the tool and Add BAK file.

b. The software will resolve all the issues and offer full Preview. Click on Export.

c. You can export as SQL Server Database or as .csv script.

Concluding Words

In case you are wondering about the process to backup and restore SQL database, here are some of the approaches you can follow. All the methods mentioned here have been tested and users can execute them without any worry. If your backup file is damaged or you prefer an easy way of restoration, you must go for SQL Backup Recovery Tool.

 
Leave a comment

Posted by on January 8, 2019 in General topics