Long story short - their SQL log file grew to gargantuan proportions, and yours truly had to whip them back into shape. Here's how it went down!
- Run the following stored procedure: "use your_db_name"
- Followed by: "exec sp_helpfile". This will return the physical names and attributes of files associated with your DB. Record the DB and log filenames, without the path and extension
- Enter the folowwing commands
- USE your_db_name
- GO
- BACKUP LOG your_db_name WITH TRUNCATE_ONLY
- GO
- DBCC SHRINKFILE (your_dblog_filename, 1)
- GO
- DBCC SHRINKFILE (your_db_filename, 1)
- GO
- exec sp_helpfile
You might get an error "Cannot shrink log file because all logical log files are in use". In that case you can follow the instruction here to resolve. I've detailed the steps below, if you're too lazy to follow the link.
- Open SQL Enterprise Manager
- Right-click on the database you want to shrink and click Properties
- from the Data Properties go to Options.
- Set the Recovery Model to Simple and click OK and try to shrink the database
No comments:
Post a Comment