That's the log file, you don't need it.

Delete the new database, create a new empty database with exactly the same name 
and filenames, take it off line. now copy the mdf in place of the newly created 
databases mdf. And put the db back online. You should have a working db without 
the massive logfile you get from restoring from a backup.

Only do this if your working on a dev machine though. let a dba worry about 
shrinking the log file after a restore ;-)

Davy

Hexed into a portable ouija board. 

-----Original Message-----
From: Wallace Turner <wallacetur...@gmail.com>
Sender: ozdotnet-boun...@ozdotnet.com
Date: Mon, 23 Apr 2012 13:22:09 
To: ozDotNet<ozdotnet@ozdotnet.com>
Reply-To: ozDotNet <ozdotnet@ozdotnet.com>
Subject: [OT] the magic of LDF

I have an SQL 2008 express database that when backed up produces a BAK 
file of 44 Meg, zips to just under 4Meg.

When restoring the database on another machine the resulting mdf is 40 
meg (good) and the ldf is 1.6 *Gb*!

Yes, i know I can shrink the ldf and also disable the LDF (SET RECOVERY 
SIMPLE) but how on earth does it decide to create an LDF that is as 
large as the original but clearly doesnt have the contents of the 
original  (unless I have unearthed the worlds most fantastic compression 
secret)

Wal

Reply via email to