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).

22 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
    Replies
    1. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
      Cyber Security Projects for Final Year

      JavaScript Training in Chennai

      Project Centers in Chennai

      JavaScript Training in Chennai

      Delete
  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. I really enjoyed reading your blog. It was very well written and easy to understand. Unlike other blogs that I have read which are actually not very good. Thank you so much!

    Data Science Training in Bangalore

    ReplyDelete
  7. Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such amazing content for all the curious readers who are very keen on being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in the future too.

    Digital Marketing Training in Bangalore

    ReplyDelete
  8. Truly incredible blog found to be very impressive due to which the learners who go through it will try to explore themselves with the content to develop the skills to an extreme level. Eventually, thanking the blogger to come up with such phenomenal content. Hope you arrive with similar content in the future as well.

    Machine Learning Course in Bangalore

    ReplyDelete
  9. A good blog always contains new and exciting information, and reading it I feel like this blog really has all of these qualities that make it a blog.

    Artificial Intelligence Training in Bangalore

    ReplyDelete
  10. I will very much appreciate the writer's choice for choosing this excellent article suitable for my topic. Here is a detailed description of the topic of the article that helped me the most.

    Artificial Intelligence Course in Bangalore

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

    ReplyDelete
  12. 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
  13. 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
  14. 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
  15. It was a good experience to read about dangerous punctuation. Informative for everyone looking on the subject.
    Software Testing Tools Training in Hyderabad

    ReplyDelete