67828

How to read the meta data out of SQL Server backup files directly?

Question:

Generally to get the meta data from SQL Server backup files, we need to use TSQL commands like restore headeronly or restore filelistonly. However, there are some third party tools can read this information directly from the backup files, like this one <a href="http://www.yohz.com/sqlbakreader_details.htm" rel="nofollow">http://www.yohz.com/sqlbakreader_details.htm</a>. Since this tool don't have a command line version, which makes it less useful. I want to know whether there are some ways that I can read this data directly.

Thanks.

Answer1:

The .bak file is a Microsoft Tape Format file. Here's a <a href="http://laytongraphics.com/mtf/MTF_100a.PDF" rel="nofollow">PDF</a> that contains the format.

Of interest to you will be:

<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/zLKNF.png" data-original="https://i.stack.imgur.com/zLKNF.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

For a quick dump (if you are on the SQL Server in question that created the backup), you can do select from the [msdb].[dbo].[backup*] tables.

See this <a href="http://www.mssqltips.com/sqlservertip/1601/script-to-retrieve-sql-server-database-backup-history-and-no-backups/" rel="nofollow">article</a> for more info.

Answer2:

I think you may be able to use SQL Servers SMO libraries and write your own in .net or Powershell. If you take a look at this page <a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.restore.readbackupheader.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.restore.readbackupheader.aspx</a> there are code samples in VB.Net and Powershell.

Recommend

  • why cant vcredist_x86.exe installed quietly?
  • How to get the current console command in Laravel
  • Convert pandas multiindex dataframe to nested dictionary
  • (UIView *)hitTest problem?
  • How can i use marquee in my Application?
  • Create calendar event using Microsoft Graph: ErrorAccessDenied
  • Why is my Cassandra Prepared Statement Ingest of Data so slow?
  • Don't understand rounding behavior in sql server when using division operator
  • Matlab - resizing figure
  • java.nio.charset.IllegalCharsetNameException: 'ISO-8859-1'
  • Update value of list item on button click in Angular 2
  • AttributeError: 'UserManager' object has no attribute 'create_superuser'
  • Silent installation of Apache Tomcat
  • How to set the linear layout width in a HorizontalScrollView?
  • Create my own classList object when the browser does not implement it itself
  • Zero downtime deployment Nodejs application
  • Does anyone know about Kephas?
  • SSRS Subscription to an email group (distribution list) is not working
  • Objects Sorting With date ,Time Problem in Array(Iphone Development)
  • Window-select multiple artists and drag them on canvas
  • Salesforce consuming XML and display data in Visualforce report
  • PHP Append to Excel file
  • async GET request with body from browser
  • Misplaced CAGradientLayer on iPhone 6s
  • How to put an object in the air?
  • I need a PHP mySQL Login script that directs user to specific URL based on username and password
  • Showing image on a acro text field position
  • Sample deviceQuery cuda program
  • Android studio import problems. (Apktool)
  • Why do you need 2 Javascript files for cross-platform Cordova plugin?
  • Building JavaFX 2.0 App on Mac, deploying on Windows
  • Ember.js + JQuery-UI Tooltip - Tooltip does not reflect the model / controller changes
  • When to use the tag in the head and body section of a html page? [duplicate]
  • Annotate objects in a queryset with next and previous object ids
  • Create an average of multiple excel chart without the data source
  • How to split wav file into two or more parts using c#
  • Content-Type alternative in MQTT
  • How to encrypt Connectionstring written in web.config from codebehind?
  • Call Microservice from another Microservice within Docker