Posts Tagged ‘daily_check’

Missing SQL Server Perfmon Counter 1 – WOW

2011/06/19

Perfmon counter is handy tool for DBA to glance what happening in OS/Instance level. As DBA, you’d better to make sure related perfmon counters exist daily. Rebuild missing counter may request restart instance or reboot server, you may have difficulty to do so when you operating a critical system during business hour.

Today we share case 1: You can’t find the perfmon counter when you install 32bit SQL Server on 64bit OS. (We call it WOW- Windows on Windows).

Uhhhh, the best practice is to install 64bit SQL Server instead of 32bit on 64bit hardware. But if you have no choice or this is a legacy system..

1. Stop Performance Logs & Alerts services.
2. Run regedit. Find HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysmonLog, change ImagePath from “%SystemRoot%\System32\smlogsvc.exe” to “%SystemRoot%\SysWow64\smlogsvc.exe”.
3. Start Performance Logs & Alerts services.
4. Run perfmon from %systemroot%\SysWOW64\perfmon.exe.
5. Create the log.

 

Check the Space Usage and Next Growth

2011/06/19

—- script to check each database’s space usage and size of next growth(MB)

—- for sql 2005 and later version

 

exec
sp_msforeachdb
‘USE[?];exec sp_spaceused’

—- here we use the undocumented sp_msforeachdb

go

 

select
db_name(database_id)
as DB_NAME,

name as
File_Name,

case is_percent_growth

when 1

then size * growth / 100.0 /128

—-use 100.0 to trigger the implicit data conversion

when 0

then growth /128.0

end
as Next_Growth_MB

from
sys.master_files

go