Sql-server – transaction log after restore

sql-server-2008

Can you let me know why a transaction log would be a lot smaller in size after restoring from a full backup. Currently we have a massive log file on the live server, but after a restore to a test / development server the log file is considerably smaller. Im guessing this is because the log was truncated as part of the backup however why would the original log file still be so huge.

Best Answer

but after a restore to a test / development server the log file is considerably smaller

Because when you're creating a full backup you're creating a backup of the data (as it is physically and as it is materialized from the log). Restoring it somewhere else restores it as data, not log.

Im guessing this is because the log was truncated as part of the backup however why would the original log file still be so huge.

The original log file might be truncated so the space can be reused, but it's size might stay the same.