Skip to main content

Backup & Recovery

In SQL Server, there are three types of backups:

  • Full Backup: Full backup means it will take the backup of the total .mdf file.

  • Differential Backup: Differential backup means it will take the backup of the extent's (8 pages= 1 extent) data which has been changed since last full backup. It is cumulative in nature and so is also called cumulative backup. cumulative means it will take backup from last full backup.

  • T-log Backup: T-log backup means it will backup the transaction log file. It is not cumulative in nature.
Now, there are three Recovery models in SQL server which are defined as:

  • Simple Recovery Model: In this recovery model, we can only have full backup and differential backup. If the data needs to be restored for the database having simple recovery model then last full backup will be restored first and after that the last differential backup. There will be no point in time recovery in this case.

  • Full Recovery Model: In this recovery model, we can have full backup, differential backup and T-log backup. If the data needs to be restored for the database having full recovery model then last full backup will be restored first then based on the requirement we can have differential or T-log restored. Point in time recovery is possible in this case. If we need circular property of the transaction log, we should take Tail log backup which also like T-log only. The only difference is that it will have the transactions upto the last time when database crashed.

  • Bulk Logged: When database is kept in bulk recovery model, it considers the data to be a single transaction. Modified extents will be there in log backup. Recovery for a point in time is possible in bulk logged if the transaction kept in bulk logged has already happened.
Note: You should always leave the database non operational while restore if you want to restore further differential or log backups. Otherwise, it will not allow you to do so.


Comments

Popular posts from this blog

SQL Server Upgrade Issues

Pre-Requisites We usually think of SQL Server simply as a database engine, while it is a data platform which supports data warehousing, reporting, data integration and data analytics. An in-depth planning is required when upgrading from one version of SQL Server to a newer version along with the features that SQL Server offers. Upgrading these extensive number of features can be remarkably complicated and time-consuming than just upgrading the database engine alone.   Below mentioned are few of the “lessons learned” that help reduce risks of data losses etc.: 1.        Application compatibility: Before planning for upgrade activity, make sure that you discuss the compatibility of SQL Server and the associated application with your application vendor.  2.        Preparation for migration: In case your upgrade activity fails due to some reason and there is no solution possible other than migration,...

Data Compression - Row & Page ( Sketch notes)

Just some notes on compression... something helpful for a beginner.

Windows Operating System

T o learn SQL Server the first most important thing is to learn about Windows Operating System. Here is a basic overview of what you should know about windows to learn SQL Server. Client and server: First of all we need to understand what are Clients and Servers. As the name suggests, clients are meant for requesting services and servers for providing services. It is not necessary to have separate hardware for residing client and server, it can be on the same hardware. When they are on different hardware they communicate with the help of network which can be either cable or wireless media. Components of Computer: Among the different components of a computer there are four components which you need to know before learning SQL Server as these are components that play a great role in the working of SQL Server. These components are: CPU RAM Hard disk Network CPU:  In CPU we basically mean processor whose speed is measured in GHz(Giga Hertz). If we talk about pr...