Shrink Database Files and how to make MSDE not eat up all of your memory.

This is mainly for my reference, but if anyone else needs it, it is here as well.

If you do not know, by default MSDE 2000 (which is installed with a lot of applications) will by default eat up all of your available memory (up to 2gb). This is a very serious problem if you install an application with MSDE on an Exchange server, or other similarly shared servers. You’re best off limiting the memory. Some perfect examples are, on-box Anti-Spam Software, McAfee EPO, Blackberry BES Server, etc. So be aware.

DBCC SHRINKFILE(pubs_log, 2)

BACKUP LOG pubs WITH TRUNCATE_ONLY

BACKUP LOG pubs TO pubslogbackup

DBCC SHRINKFILE(pubs_log,2)

And if/when that does not work, you can also use…

DBCC OPENTRAN (database_name) – to check for open transactions.

DBCC SHRINKFILE (file_name, target_size)
DBCC SHRINKDATABASE (database_name, target_percent) – This works when shrinkfile hasn’t been working.

And to limit MSDE

Save as a .SQL File

USE master
EXEC sp_configure ‘show advanced options’, 1
RECONFIGURE WITH OVERRIDE USE master
EXEC sp_configure ‘max server memory (MB)’, MaxServerMemory
RECONFIGURE WITH OVERRIDE

USE master
EXEC sp_configure ‘show advanced options’, 0
RECONFIGURE WITH OVERRIDE

osql -E -S ServerComputerName\msfw -i Path\setchecksqlmemory.sql

*Update*

In the event that you need to do it all by hand using OSQL as a trusted connection, perform the following – Set to change it to 64mb of memory

————————————-

OSQL -E

USE master
EXEC sp_configure ‘show advanced options’, 1
RECONFIGURE WITH OVERRIDE

GO

USE master
EXEC sp_configure ‘max server memory’, 64
RECONFIGURE WITH OVERRIDE

GO

USE master
EXEC sp_configure ‘show advanced options’, 0
RECONFIGURE WITH OVERRIDE

GO

————————————-

That will drop the memory usage from 2gb down to 64MB almost immediately.
Disclaimer: the ‘max server memory’ keeps replacing the first single quote incorrectly, so it may need to be typed manually. Working on correcting.
INF: How to Shrink the SQL Server 7.0 Transaction Log

http://support.microsoft.com/kb/256650/

INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE

http://www.support.microsoft.com/?id=272318

You may experience high memory usage on an ISA Server 2004-based computer that logs messages to an MSDE database

http://support.microsoft.com/?id=909636

OSQL Syntax

http://www.di-mgt.com.au/osqlUtility.htm

Christopher Kusek

*Updated this post to appear in 2007 as it’s been used more often than I did in September when I first posted this*

Technical Offerings – CWUG Slide Deck

As Promised, here is the Slide Deck from my recent (Thursday, May 17th – 2007) CWUG Presentation on Technical Offerings.

Changes from what was presented – Added the VHD slide which wasn’t available in the presented form, updated the links for each of the resources.

Technical Offerings PDF

Technical Offerings PPT 97-2003

Technical Offerings PPTX 2007

Any questions, comments, concerns, feedback, etc.

Do not hesitate to let me know! Comment here, or feel free to email me.

Thanks

Christopher Kusek

I’ve been elected! President Elect at Toastmasters Club #983 in Woodridge (district 30)

This coming June 14th I will be installed as the new President of the Toastmasters in Woodridge, IL (Club #983, District #30)

Anyone interested in coming see me in action, or also in coming to check out what Toastmasters is about, and especially why I’m interested in this particular Toastmasters out of all of the ones available, I urge you to come on down as a guest one of these days.

This Toastmasters meets every 2nd and 4th Thursdays, at 7:30PM – 9:30PM.

It is a very educational, warm and accepting group, and we always embrace guests when they come (Which is quite often).

For those interested, the address is:

*Woodridge Resource Center
8274 Janes Avenue
Woodridge, IL 60517

I’ve included links to my local Toastmasters, the local District as well as the main site on the side. If you do not use them, like all of my links, I will. :)

Take care, and if you’re interested in visiting one of these times and want some more details about it, feel free to give me a call. Before hand, or even the night of (before 7:30 ofcourse :)) 630.362.1320

Christopher Kusek

Woodridge Toastmasters Club #983

District #30 Toastmasters

Toastmasters International