About Me

My photo
Mumbai, Maharastra, India
He has more than 7.6 years of experience in the software development. He has spent most of the times in web/desktop application development. He has sound knowledge in various database concepts. You can reach him at viki.keshari@gmail.com https://www.linkedin.com/in/vikrammahapatra/ https://twitter.com/VikramMahapatra http://www.facebook.com/viki.keshari

Search This Blog

Sunday, December 14, 2014

Database bakup with PDF extension

Yes, I know you drag your buttock to the edge of your chair, be aware don’t let it fall on ground, they are precious, handle it with care :D. SQL Server does not have problem with the file extension as long as the file is a valid file. So you can name you bakup extension with any type.

But general industry standard says .BAK for full bakup, .DIFF for Differential and .TRN for transactional backup.

Let try out with .PDF extension.

BACKUP DATABASE [TestDB] TO  DISK = N'D:\SQL Server\myDatabaseBakup.pdf'
WITH FORMAT,  MEDIANAME = N'MyTest1',  NAME = N'TestDB-Full Database Backup'
GO
Processed 11432 pages for database 'TestDB', file 'TestDB' on file 1.
Processed 2 pages for database 'TestDB', file 'TestDB_log' on file 1.
BACKUP DATABASE successfully processed 11434 pages in 5.080 seconds (17.582 MB/sec).

Lets now try to restore it.

USE [master]
RESTORE DATABASE [MyTest101] FROM  DISK = N'D:\SQL Server\myDatabaseBakup.pdf'
WITH  FILE = 1,  MOVE N'TestDB' TO N'D:\SQL Server\Log\MyTest101.mdf',  MOVE N'TestDB_log' TO N'D:\SQL Server\Log\MyTest101_log.ldf'
GO
Processed 11432 pages for database 'MyTest101', file 'TestDB' on file 1.
Processed 2 pages for database 'MyTest101', file 'TestDB_log' on file 1.
RESTORE DATABASE successfully processed 11434 pages in 4.236 seconds (21.086 MB/sec).

Conclusion: SQL Server does not have problem with the file extension as long as the file is a valid file.

For coders world is colorful, this is just because of you SQL Server :) Ah! You are evergreen!!!

Post Reference: Vikram Aristocratic Elfin Share

No comments:

Post a Comment