Database Simplified Headline Animator

Database Simplified

Friday 28 October 2011

Password Protected Backup In SQL Server

Password protected database backup : Setting backup media password are important and useful for securing misuse of data. If database backup is password protected then one will not be able to restore and see details from backup file using RESTOREFILELIST or HEADERONLY command.

How to take password protected database backup?

Create A Database



If DB_ID('DBS_Test') Is null
Create Database DBS_Test
Go

Backup Database Backup With Password



Backup Database DBS_Test To Disk ='D:\DBS_Test.BAK' With MediaPassword='password'
Go

Drop The Existing Database



Drop Database DBS_Test
Go

Try To Get FileList Info From Backup



Restore FILELISTONLY  From Disk='D:\DBS_Test.BAK'

Output :

Msg 3279, Level 16, State 6, Line 1
Access is denied due to a password failure
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.

Throws error since no password has been supplied with query.

Try To Get DB Info From Backup



Restore HEADERONLY  From Disk='D:\DBS_Test.BAK'

Output:

Msg 3279, Level 16, State 6, Line 1
Access is denied due to a password failure
Msg 3013, Level 16, State 1, Line 1
RESTORE HEADERONLY is terminating abnormally.

Same as above throws error since no password has been supplied with query.

Now Try To Restore Database With Backup File



Restore Database DBS_Test From Disk='D:\DBS_Test.BAK'

Output:

Msg 3279, Level 16, State 6, Line 1
Access is denied due to a password failure
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

So, you have seen that no details or info can be taken from password protected database backup.

How to Get Info and Restore Password Protected Database Backup ?

Get File List Info From Password Protected Database Backup



Restore FILELISTONLY  From Disk='D:\DBS_Test.BAK'
With MEDIAPASSWORD='password'
Output: See Here

Get Database Info From Password Protected Database Backup



Restore HEADERONLY  From Disk='D:\DBS_Test.BAK'
With MEDIAPASSWORD='password'

Output : See Here

Restore Database From Password Protected Database Backup



Restore Database DBS_Test From Disk='D:\DBS_Test.BAK'
With MEDIAPASSWORD='password'

Output :

Processed 168 pages for database 'DBS_Test', file 'DBS_Test' on file 1.
Processed 2 pages for database 'DBS_Test', file 'DBS_Test_log' on file 1.
RESTORE DATABASE successfully processed 170 pages in 0.214 seconds (6.197 MB/sec).

13 comments:

  1. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. Free Folder Lock Apps For PC - Don't Waste Moment Browsing, Study About Cellular Desktops In this article how to encrypt a backup

    ReplyDelete
  2. PLEASE i need help
    i have protected db i don't know the PASSWORD how can i restore it ????
    the db link https://goo.gl/gKBwWm
    please FIX it and send it back
    NOTE:you can read it with notepad and find this( user:sa password:hm12345678)

    ReplyDelete
  3. Hi! I just wanted to ask if you ever have any issues with hackers? My last blog (WordPress) was hacked and I ended up losing months of hard work due to no backup. Do you have any methods to protect against hackers? Get More Info: How To Password Protect Folder In 15 Minutes And Still Look Your Best

    ReplyDelete
  4. Unlocking different types of documents is a little more complex, but your VBA passwords may fit to unlock these documents as well, as according to statistics. reset windows 10 password

    ReplyDelete

  5. Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you Get for more information STEM Education

    ReplyDelete
  6. Someone sometimes with visits your blog regularly and recommended it in my experience to read as well.
    Software Testing Tools Training in Hyderabad

    ReplyDelete
  7. The Crack at this point in the software turns a page that shows user potential way all time. It provides very powerful results and is one of the most popular software of it’s kind in the world. Cash Register Express Download

    ReplyDelete
  8. Adobe XD CC Keygen is the powerful new version is working through the drawing areas and the user work through one or many of work point it does not way of the problem can sure on the result. Adobe XD Crack Download

    ReplyDelete
  9. Quotes to assist You Cope once Losing a husband those we tend to care regarding ne’er absolutely abandon U.S.A.. Loss Of A Husband Quotes

    ReplyDelete
  10. Here I saw several articles and posts published on this site, I am more interested in some of them, will provide more information on these topics in future articles.Manual Testing training onlineManual Testing Online TrainingQA training OnlineSoftware testing Online Courseselenium training online courseqa testing online coursepython training in hyderabad

    ReplyDelete