How to shrink a MS SQL 2008 Log file in MyLittleAdmin
- 13/06/2014 8:54 AM
I have a MS SQL 2008 database, the log file has grown too big, how can i delete the log?
1) Login to MyLittleAdmin by clicking Browse Database next to the MS SQL 2008 database
2)Expand user databases and click on your database name. (as shown in red below)
3) Click the properites icon (as shown in blue below)
4) on the properties page click the FILES Tab at the top centre
you will see two files, the first one is your DB name, the second one is the Log name. make a note of the full log name ie user_db_log
5) on the left of mylittleadmin click the tools menu, then click New query.
6) The new query window will load. select your database from the list, also make a note of the database name, As shown in green below:
7) In the white box Below paste the following in, Replace DATABASENAME with your database name as shown above. and replace YOUR_LOG_NAME_log with your log name taken earlier in step 4
Alter Database DATABASENAME Set Recovery Simple
Alter Database DATABASENAME Set Recovery Full
DBCC SHRINKFILE ('YOUR_LOG_NAME_log', 1)
8) on the next page click submit. a query box will load, click submit or continue. This will clear your transaction log to 1mb.