Sql-server – How to create a SQL Server 2008 backup without logs with mirroring

backupsql serversql-server-2008

How do I create a backup of a SQL Server 2008 in a mirrored setup without any logs?

We need to do this so that when we restore our local development databases, we would have the most up to date data, but we don't necessarily have the space for all the transaction logs. (we're all using ssd's).

Currently, because it is mirrored, I can't create simple backups, it must be full backups.

Best Answer

Backing up a database (BACKUP DATABASE ...) backs up the pages from all of the database files (data and log) and upon restore those files will be recreated as a result.

A full database backup does just that: It backs up the database in its entirety. There is no way to get around not backing up the transaction log file. If you are in full recovery mode, then you should ensure you are doing the proper transaction log backups so the log doesn't grow out of control. Outside of that, you are constrained with a full backup. A database consists of data file(s) and log file(s).

A workaround to this could be just to generate scripts from you database. When you right-click your database to generate scripts, you can script out the entire database. There is an option to script out both Schema and Data. Then on your other machine/instance you can run this script. It's not a traditional "backup" by any means, but it should get you what you want and you'll just have a script file as a result. Mind you, when the CREATE DATABASE portion of the script runs, a log file will be created. You can't have an RDBMS database without a log file (or at least not on SQL Server that I know of).