Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 truncate detached log?

Author  Topic 

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2007-06-29 : 15:58:51
Are there any tricks or tools that let you shrink a log file that's part of a backup (e.g. .bak) file? In other words, is there any way to work around a database having to be attached to SQL Server in order to truncate the log?

Haywood
Posting Yak Master

221 Posts

Posted - 2007-06-29 : 17:56:37
Not really.

What's the core problem/issue?
Go to Top of Page

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2007-06-29 : 19:35:03
Just low on space and hoping I wouldn't have to restore the databases before I shrunk them.
Go to Top of Page

Haywood
Posting Yak Master

221 Posts

Posted - 2007-06-29 : 20:33:30
Well, you can do the old (and reaaaaaly risky IMO) trick of detach the database, delete the log and then reattach with sp_attach_single_file_db. It's a really risky operation to reclaim logspace - but it's a common solution in the forums for someone who's mistakenly (*cough*) deleted a t-log without understanding the implications.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-30 : 05:22:25
You'd need to MDF for that though, rather than a BAK file.

If you want to restore on a target machine with insufficient space you have to shrink the database before making the backup - which is not a good idea for a production database, of course

Alternatively create a new, empty, database and then DTS the data across.

Kristen
Go to Top of Page
   

- Advertisement -