Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Fast Server Assessment Script - Critique?

Author  Topic 

readysetstop
Posting Yak Master

123 Posts

Posted - 2007-06-08 : 10:07:40
I'm in a new position, and have a lot of servers to get familiar with in a hurry. I came up with this to just get a quick assessment of what kind of shape the server is in. Any comments regarding other things to check, or better ways to implement the following are appreciated.

As always, thanks for your help.


/* Initial server status and configuration check script
D Maxwell, June 2007
*/

-- Get the product version and revision level.
-- If the Edition is "Desktop Engine", upgrade.
SELECT SERVERPROPERTY('ServerName') Server_Name,
SERVERPROPERTY('productversion') Revision,
SERVERPROPERTY('productlevel') Service_Pack,
SERVERPROPERTY('edition') Edition
go

-- Make sure the correct DBs are there.
select name Databases
from master..sysdatabases
where name not in('master', 'model', 'msdb', 'tempdb')
go

-- See what jobs are scheduled.
select name JobName
from msdb..sysjobs
where name like '%maintenance plan%' --These need to GO...
and enabled = 1 --The jobs actually run... right?
order by JobName
go


-- Check for job failures, getting frequency and most recent failure.
select count(*) Fail_Count, j.name Job_Name, max(jh.run_date) Run_Date, max(jh.run_time ) Run_Time
from msdb..sysjobhistory jh inner join msdb..sysjobs j
on jh.job_id = j.job_id
where jh.message like '%the job failed%'
group by j.name
order by j.name
go

-- Get the length of the job history.
select min(run_date) History_Starts, max(run_date) Current_History from msdb..sysjobhistory
go

-- Before we get the config, make sure we get the WHOLE config.
sp_configure 'show advanced options', 1
reconfigure
go

-- Get the configuration.
sp_configure


EDIT: 2007.06.14 - Kind of tweaking this as I go, here...
____________________________________________________________________________________
"Believe in those who are seeking the truth. Doubt those who say they have found it." -Andre Gide

Kristen
Test

22859 Posts

Posted - 2007-06-14 : 10:55:43
"select name Databases"

I would add: ORDER BY [name] ...

"-- See what jobs are scheduled."

Add the most-recent-run-age? Plus a "**" if its more than 24 hours ago, and "***" if its more than a week ago perhaps. And how long it took?

"sp_configure"

We show the Factory Defaults and Our Personal Preference next to the values, for comparison, on our "What shape is the server" script.

We also look at all columns, in all tables. We have "***" for columned that are defined much wider than they are used, columns where all the values are Distinct but there is no UNIQUE constraint. Tables that have no PK, which columns are indexed, and so on.

Also, have a look on SQL Server Performance .COM - there is a good article on "Server audit" or somesuch, which has a whole worked example of things to look for.

Put it all in an SProc and then advertise yourself as a consultant!

Kristen
Go to Top of Page
   

- Advertisement -