Thursday, April 28, 2011

Shrink/truncate [log] file while restoring?

alias "Restoring only used space"

Basically...you can't...but...


Source:
How to restore a SQL Server database and shrink its files at the same time?
http://serverfault.com/questions/183588/how-to-restore-a-sql-server-database-and-shrink-its-files-at-the-same-time

Restore Database w/Large Transaction Log File
www.sqlmonster.com/Uwe/Forum.aspx/sql-server/18930/Restore-Database-w-Large-Transaction-Log-File

...there is alternative using commercial product...mounting your backup file:

redgate SQL Virtual Restore
www.red-gate.com/products/dba/sql-virtual-restore/
idera SQL virtual database
www.idera.com/Products/SQL-toolbox/SQL-virtual-database/
ApexSQL Restore

Related article(s)
Brad's Sure Guide to SQL Virtual Restore
www.simple-talk.com/sql/sql-tools/brads-sure-guide-to-sql-virtual-restore-/

...and yet another one (also commercial prod): restoring to compressed format:
The only difference from a regular restore operation is that we specify that we want the .mdf and .ldf files of the restored database to be compressed. This is achieved by restoring to .mdfx and .ldfx file formats.

www.red-gate.com/products/dba/sql-storage-compress/walkthrough

No comments:

Post a Comment