November 28, 2004 at 8:35 am
Hi,
I was told recently there's a couple of commands that you can issue to SQL Server that have the same net result as rebooting your server - stupidly I didn't write them down and now can't remember what they are. The advantage obviously being you don't have to reboot. This would be invaluable for performance testing when you want to empty the cache.
Does anyone know what the commands are? I know there's 2 of them which need to be executed in sequence.
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
November 28, 2004 at 12:20 pm
1. You can go to Services.msc and restart MSSQLServer and SQLServerAgent Services.
2. In ISQL type SHUTDOWN.
3. On a command prompt, type NET STOP MSSQLSERVER /y and Hit Enter. Once done, type NET START MSSQLSERVER and hit enter
This should get you what you need.
-Nitin
November 28, 2004 at 1:05 pm
Sorry Nitin, I worded my original post badly. The methis I was shown makes it possible to do this without even shutting down SQL.
The commands are a couple of T-SQL commands. [This is great cos you can put it into a QA keyboard shortcut].
Thanks for the reply anyway Nitin.
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
November 29, 2004 at 5:51 am
DBCC DROPCLEANBUFFERS -- Clears the data cache
DBCC FREEPROCCACHE -- Clears the procedure cache
November 29, 2004 at 5:56 am
That's not ringing any bells but then...why would it?
Appreciate the help! Thanks Craig. I'll be using that alot.
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply