Site icon IT Tutorial

SQL Server 2017 Backup -3

Hi,

In this article, I will continue to explain you backup types in the SQL Server 2017.

 

Read previous article before this.

SQL Server 2017 Backup -2

 

You can Differential back up SQL Server database like following, using SQL Server Management Studio ( Right Click related database—> Tasks–> Back up )

 

Or you can Differential back up in SQL Server database using T-SQL Code like following.

BACKUP DATABASE [TEST] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\Differential.bak' WITH DIFFERENTIAL , NOFORMAT, NOINIT, NAME = N'TEST-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

 

 

 

In order to take Transaction Log backup in SQL Server, Recovery Model must be full. To do this, right-click on our database, click Properties and click on the Options tab in the menu that appears. As shown in the image below, change the Recovery Model from Simple mode to Full mode.

 

If database’s Recovery model is full, then You can back up of Transaction log SQL Server database like following, using SQL Server Management Studio ( Right Click related database—> Tasks–> Back up )

 

 

Or you can back up of Transaction log in SQL Server database using T-SQL Code like following.

BACKUP LOG [TEST] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\TransactionlogBackup.trn' WITH NOFORMAT, NOINIT, NAME = N'TEST-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

 

Compression is very important for storage utilization, You can back up database compressed in the SQL Server like following.

 

 

 

 

Or you can  back up Full Compressed in SQL Server database using T-SQL Code like following.

BACKUP DATABASE [TEST] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\CompressedFullBackup.bak' WITH NOFORMAT, NOINIT, NAME = N'TEST-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO

 

SQL Server Backup is completed, I will explain the Restore and Recover in the SQL Server in the next post.

  

Do you want to learn Microsoft SQL Server DBA Tutorials for Beginners, then read the following articles.

https://ittutorial.org/sql-server-tutorials-microsoft-database-for-beginners/

Exit mobile version