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)
 Automation of admin stats

Author  Topic 

SMerrill
Posting Yak Master

206 Posts

Posted - 2005-07-25 : 14:52:42
Is there a way to automate the gathering of the following statistics from each of my SQL Server computers? I know this is a lot of statistics, so either point me in the right direction for an off-the-shelf product, or something similar.

HARDWARE STATISTICS
Server Name
Manufacturer
Model
Processor Count
Processor Speed
Processor Cache Size
NIC Count
NIC Speed
RAM
Controller Count
Physical Drive Count
Controller Dedicated to Drive?
Fault Tolerance by Drive
Speed of Drives
Size of Drives
Count SAN Drives
Size SAN Drives
Count of Local Drives

OPERATING SYSTEM STATISTICS
Version
Service Pack
Hot Fix
MDAC
MDAC Hotfix
Paging File Location
Partition per Physical Drive
Location of O.S.
What scheduled tasks
Frequency of scheduled tasks

DATABASE STATISTICS
Logical Name
Database ID
Database Collation
Physical Name
Data File Location
Log File Location
File Group Name
File ID
File Size
Auto Grow On/Off
Auto Grow MB/%
Auto Grow Allocation
Recovery Model
Application Supported
Vendor
Vendor Contact
Vendor Contact Info
Business Owner
Business Contact Info
Category of Information Stored

SECURITY STATISTICS
Account used by SQL Server
Account used by SQL Server Agent
Account used by Backups jobs
Are Role Based Groups Used?
Are Single Accounts Used?
Fixed Server Roles Used?
Fixed Database Roles Used?
Database Roles Defined?
What Accounts are using What Roles?
What Accounts and/or Roles have what access to which objects?
What authority do the groups/accounts have in each database?
What authority do the groups/accounts have in the RDBMS?
What authority do the groups/accounts have at the OS level?
Business Function Definition
Application Requirements
Application Accounts



~ Shaun Merrill
Seattle, WA

SQLServerDBA_Dan
Aged Yak Warrior

752 Posts

Posted - 2005-07-25 : 16:18:05
SQL DIAG gives you some of that info.

Run it from the command prompt like this:

sqldiag -Usa -Ppassword -Oc:\SDOUT.TXT


Daniel
SQL Server DBA
www.dallasteam.com
Go to Top of Page

SMerrill
Posting Yak Master

206 Posts

Posted - 2005-07-26 : 22:04:49
Thanks. Now, I'm going to limit the question to security statistics only. Any further help there?

SECURITY STATISTICS
Account used by SQL Server
Account used by SQL Server Agent
Account used by Backups jobs
Are Role Based Groups Used?
Are Single Accounts Used?
Fixed Server Roles Used?
Fixed Database Roles Used?
Database Roles Defined?
What Accounts are using What Roles?
What Accounts and/or Roles have what access to which objects?
What authority do the groups/accounts have in each database?
What authority do the groups/accounts have in the RDBMS?
What authority do the groups/accounts have at the OS level?

Any help for me on these items?

~ Shaun Merrill
Seattle, WA
Go to Top of Page

SMerrill
Posting Yak Master

206 Posts

Posted - 2005-08-03 : 15:53:53
Look what I found for starters. This is a script-generating script.
However, I still need more scripts than this...
Take a look:

-- Script to generate grants from SQL Server 7.0 databases.
-- change to use correct database for script and save output.
use master
go
declare @Servername varchar(32)
select @Servername = (select @@servername)
PRINT '-- '+@Servername
go
set nocount on
go
use [ABACUS]
print 'use ABACUS'
print 'go'
go
print ' '
print '-- Execute grants for stored procedures'
print ' '
select 'Grant Execute on ' + o.name + ' to '+ u.name
from sysusers u,syspermissions p,sysobjects o
where p.grantee = u.uid
and p.id = o.id
and (u.issqlrole = 1 or u.issqlrole = 0)
and (32 = (p.actadd&32))
order by u.name,o.name
go
print ' '
print '-- Select grants for Tables and Views'
print ' '
select 'Grant Select on ' + o.name + ' to '+ u.name
from sysusers u,syspermissions p,sysobjects o
where p.grantee = u.uid
and p.id = o.id
and (u.issqlrole = 1 or u.issqlrole = 0)
and (1 = (p.actadd&1))
order by u.name,o.name
go
print ' '
print '-- Update grants for Tables and Views'
print ' '
select 'Grant Update on ' + o.name + ' to '+ u.name
from sysusers u,syspermissions p,sysobjects o
where p.grantee = u.uid
and p.id = o.id
and (u.issqlrole = 1 or u.issqlrole = 0)
and (2 = (p.actadd&2))
order by u.name,o.name
go
print ' '
print '-- Insert grants for Tables and Views'
print ' '
select 'Grant Insert on ' + o.name + ' to '+ u.name
from sysusers u,syspermissions p,sysobjects o
where p.grantee = u.uid
and p.id = o.id
and (u.issqlrole = 1 or u.issqlrole = 0)
and (8 = (p.actadd&8))
order by u.name,o.name
go
print ' '
print '-- Delete grants for Tables and Views'
print ' '
select 'Grant Delete on ' + o.name + ' to '+ u.name
from sysusers u,syspermissions p,sysobjects o
where p.grantee = u.uid
and p.id = o.id
and (u.issqlrole = 1 or u.issqlrole = 0)
and (16 = (p.actadd&16))
order by u.name,o.name
go
print ' '
print '-- end of grants'
print ' '
go
print '-- DRI set for Tables and views'
print ' '
print ' DRI'
select 'Grant DRI on ' + o.name + ' to '+ u.name
from sysusers u,syspermissions p,sysobjects o
where p.grantee = u.uid
and p.id = o.id
and o.id = 117575457
and (4 = (p.actadd&4))
order by u.name,o.name
go


~ Shaun Merrill
Seattle, WA
Go to Top of Page
   

- Advertisement -