Re: Starting up database 'customers' every minute or so in SQL LOG

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dinesh T.K (tkdinesh_at_nospam.mail.tkdinesh.com)
Date: 05/13/04


Date: Fri, 14 May 2004 04:08:44 +0530

Sunny,

>>Do you know a query can do this?

One way would be to write a cursor and traverse through master..sysdatabases
and execute EXEC sp_dboption '<databasename>','autoclose',False aagainst
each one.Since this is a one time job and since I assume you are not going
to make it part pf production code, you can use the undocumented call -
sp_msforeachdb.
Thus the below command would run against all databases and turn 'Auto close'
off for each.Do note that, since 'Auto close' cannot be set in database
'master' and
'tempdb', you will get the corresponding error messages.You can ignore that.

EXEC sp_msforeachdb @command1= "PRINT '?' EXEC sp_dboption @dbname =
'?',@optname = 'autoclose',@optvalue = False"

>>Any thought on this?
Did you check the initial few lines of the sql log as I mentioned?If you are
unable to find the location of the error log, then execute the below command
in Query Analyzer and check for a line like this: "SQL Server is starting at
priority class 'normal'(n CPU detected) " where n indicates the number.

EXEC sp_readerrorlog

On other way would be to check in Enterprise manager.Right click on sql
server | properties and in the 'Processor' tab, look in the parellilism
block.Is it letting you to select more than 2 processors?

May be there is a easy way or a command that I might be missing but these
are also options for you to check.

--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"SangHun" <anonymous@discussions.microsoft.com> wrote in message
news:88C8B771-1BD0-4335-BD31-B759D040A3FD@microsoft.com...
> Thanks Dinesh!  I should set them all OFF.  Do you know a query can do
this?
>
> I looked at the server using Task Manager, it shows me 4 CPUs and when I
execute backup query, SQL personal edition seems like to uses all 4 cpu
(According to SQL DBA book, personal edition can use CPU up to 2).  If this
is true, than I don't have to upgrade in hurry.  I reported to manager and
he thinks that we can do this some time next month....  Any thought on this?


Relevant Pages

  • Re: aspnet_wp.exe Grabs All CPU
    ... The App is a simple Get Data from SQL server (code defined, ... DS and Adaptors, using the Higher performance SQL db classes, and Stored ... Server timed out the last request, but still very high CPU usage. ... the SPROC 's name to call, with slight business rule logic where required. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: try...catch execution issue
    ... If I execute a procedure, an error occurs, call the ... But I would suggest that when you use TRY-CATCH, you don't care about the ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.programming)
  • Re: Problem with bulk load security.
    ... go back read my previous post about using EXECUTE AS ... you need to impersonate a *server login*. ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.security)
  • Re: Problems with Full Text Index Population
    ... I suspected the SQL 2000 FTS Deployment whitepaper was what you were reading ... As for your current FTI problems with SQL Server 2000, ... In the meanwhile, and relative to setting the MSSearch service CPU affinity, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Processing queries simultaneously
    ... Any way SQL Server will use multiple CPU's on ... CPU you probably have a bottle neck in one of two paces or both. ... Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.programming)