Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore database using sqb files in SQL SERVER

Tags:

sql-server

I have a file with sqb extension(e.g: clark.sqb),how should i to restore database using the sqb file.thanks!

like image 295
user83450 Avatar asked May 14 '09 02:05

user83450


People also ask

How do I restore a database from a BAK file?

Restore the database from a BAK fileRight-click on the database server in the left navigation pane, click Tasks, click Restore. The name of the restoring database appears in the To database list box. To create a new database, enter its name in the list box. Select 'From device'.

Can we restore database from MDF file?

In that case, use DBCC CHECKDB with repair options or a specialized MDF file repair tool to fix the corrupted file and restore database from mdf file. Following are the two methods to attach SQL database using an . mdf file: Attach a Database using SQL Server Management Studio (SSMS)

How do I restore a SQL database from a BAK file to a new database?

Connect to the appropriate instance of the SQL Server Database Engine, and then in Object Explorer, select the server name to expand the server tree. Right-click Databases, and then select Restore Database. The Restore Database dialog box opens. Select the database to restore from the drop-down list.


2 Answers

SQB files are created using RedGate's SQL Backup Tool. They supply a command line tool called sqb2mtf that can be used to convert to a native SQL backup that can then be easily restored.

  • CMD line tool: http://downloads.red-gate.com/labs/sqb2mtf.zip
  • usage: sqb2mtf inputfile outputfile [password]
  • e.g. sqb2mtf "d:\backups\pubs.sqb" "e:\data\pubs.bak"
like image 123
Nick Sturgess Avatar answered Sep 30 '22 13:09

Nick Sturgess


SQB files are a SQL Server backup format created by Red Gate's SQL Backup Pro software.

As mentioned in Nick Sturgess' answer, there are command line and GUI tools available for converting SQB files into regular SQL Server backup files that can then be restored normally.

Additionally, if you have SQL Backup Pro's server components installed on your SQL Server, you can restore a database from SQB files directly using a stored procedure call like the following:

EXEC master..sqlbackup '-sql "RESTORE DATABASE [MyDatabase] FROM DISK = [C:\backups\*.sqb] LATEST_ALL WITH RECOVERY"' 

That command will restore the latest possible backup of the MyDatabase database from all of the SQB files in C:\backups\. So, if you have a handful of full backups, differential backups, and transactional backups all kept in C:\backups, this command will automatically calculate the latest backup that can be restored without you having to select the correct files manually and without having to convert the SQB files to another format.

There are a number of different options that can be used to restore your database from SQB files directly, including:

  • Restoring to a database with a different name than that of the database in the backup
  • Relocating where the MDF and LDF files should be stored (useful if the server you're restoring to is different from the server where the backup was taken)

All of these options (and more) are outlined on Red Gate's syntax example page.

like image 38
Dane B Avatar answered Sep 30 '22 14:09

Dane B