all groups > sql server new users > february 2006 >
You're in the

sql server new users

group:

config question


config question Troy
2/23/2006 7:10:13 AM
sql server new users: hello,

we have a dual xeon box with 4 Gb of RAM running windows 2003 sp1 and sql
2000 sp4. The database is 200 Mb and will probably max out at 400 Mb. Is
there any way to keep the entire database in memory? Any issues with doing
this?

thanks

Re: config question Andrew J. Kelly
2/23/2006 12:18:46 PM
As long as SQL Server has enough memory devoted to it at all times the data
should stay in cache after the first time you access it. It only gets pushed
out of cache if it needs the memory space for other data. With 4GB on the
machine this should not be an issue at all. Of coarse each time you restart
the server or SQL Server the cache gets flushed. That's a lot of machine
for a 200MB db so it leads me to believe you have other apps running on the
box as well. If so and they use up a LOT of memory you can set SQL Server
to a fixed amount of memory or a MIN size that will ensure SQL Server keeps
x many MBs at all times.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

Re: config question Troy
2/23/2006 10:35:18 PM
thanks for responding. The box is dedicated SQL server and nothing else. How
do I keep the db in memory?



[quoted text, click to view]

Re: config question Mike Hodgson
2/24/2006 12:00:00 AM
Every page in the database that SQL server has accessed will stay in
memory until it needs to be swapped out due to lack of memory (unlikely
in your case - a 4GB box with a 200MB database and nothing else vying
for memory) or the SQL Server service is stopped (like when you reboot
the server for example).

You cannot pre-load the entire database into RAM, but every time you
access a page it'll stay in RAM (ie. cache aka. the buffer pool). You
don't need to do anything special, that's just the default behaviour of
SQL Server.

--
*mike hodgson*
http://sqlnerd.blogspot.com



[quoted text, click to view]
Re: config question Andrew J. Kelly
2/24/2006 12:00:00 AM
My first sentence answered that, cache is memory.


--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

Re: config question Troy
2/24/2006 8:22:59 AM
what about dbcc pintable?

[quoted text, click to view]

Re: config question Andrew J. Kelly
2/24/2006 1:06:14 PM
That was originally meant to keep a particular table and it's indexes in
memory when there wasn't enough for everything. In your case (and most
others) it is useless. It often hurt more than it helped since SQL Server
is usually smart enough to know which data it should keep in memory if there
isn't enough for all of it. Once again you have more than enough so unless
you restart it should all stay in memory once it gets there. And FYI DBCC
PINTABLE is being depreciated and is a no-op in SQL2005.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

Re: config question Troy
2/24/2006 9:11:33 PM
cool - thanks

[quoted text, click to view]

AddThis Social Bookmark Button