블로그 이미지
보미아빠

카테고리

보미아빠, 석이 (528)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2025.8
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

공지사항

최근에 올라온 글


SQL Server 의 thread Stack 사이즈 모니터링이 해당 툴로 가능하다.
Sysinternals.com 의 VMMap


다음은 SQL Server 의 Thread Stack 사이즈를 모니터링 한 결과 이다.

그래서 Thread Stack 은 Virtual Memory 즉 BPool 영역 외 영역에 있고 모니터링 가능하다.


Posted by 보미아빠
, |

오 ~ 멋지다...

More on DMV changes in SQL 2008 R2 SP1


Following our last post by Mehmet about new support and troubleshooting DMV’s, here are additional details on supportability DMV changes in SQL 2008 R2 SP1 and how you might use them. These changes are also available in “Denali”, the upcoming major release of SQL Server. With SQL 2008 R2 SP1 coming up soon, please give them a try and let us know what you think.

We’ll take a peek at these DMV changes as well as talk about in what circumstances these DMVs would come in handy. Note that all DMVs/DMF documented below require VIEW SERVER STATE permission.

1. Extended sys.dm_exec_query_stats with 4 new columns (total/last/min/max_row)

sys.dm_exec_query_stats is a very widely used DMV that provides  useful information in analyzing query performance. To troubleshoot long running queries, it is also helpful to have total/min/max/last row counts information in order to separate queries that are simply returning a large number of rows from those problematic ones due to, say, a missing index or  a bad query plan.

 2. sys.dm_os_volume_stats(f.database_id, f.file_id)

This is a new DMF (Dynamic Management Function) that helps check the free space on the partitions the SQL server instance resides on. The catalog view sys.database_files provides stats such as size per database file, however, without information about free space on the partition, the information is less actionable – a database file cannot autogrow even when the size is small if there is not sufficient space left on the partition.

For example, you can use the following T-SQL statements to get the stats for the current database.

select database_id, f.file_id, total_bytes, available_bytes from sys.database_files as f cross apply sys.dm_os_volume_stats(DB_ID(), f.file_id)

DMF definition:

Column

Type

Description

database_id

int, not null

ID of the database

file_id

int, not null

ID of the file

volume_mount_point

nvarchar(512)

Mount point at which the volume is rooted

volume_id

nvarchar(512)

OS volume ID

logical_volume_name

nvarchar(512)

Logical volume name

file_system_type

nvarchar(512)

Type of file system volume (e.g., NTFS, FAT, RAW)

total_bytes

bigint

Total size in bytes of the volume

available_bytes

bigint

Available free space on the volume

supports_compression

bit

Does this volume support OS compression?

supports_alternate_streams

bit

Does this volume support alternate streams

supports_sparse_files

bit

Does this volume support sparse files?

is_read_only

bit

Is this volume currently marked read_only?

is_compressed

bit

Is this volume currently compressed?

3. sys.dm_os_windows_info

This new DMV provides information on the OS the SQL Server instance is running on, specifically including the following:

  • Windows Release
  • Windows Service Pack Level
  • Windows SKU
  • OS language version

DMV definition:

Column name

Column type

windows_release

nvarchar (256)

windows_service_pack_level

nvarchar(256)

windows_sku

int

os_language_version

int

 Without this DMV, it is very difficult to get such information without calling into Windows APIs.

It’s also worth pointing out that a related change we made to existing DMV sys.dm_os_sys_info is to add two new columns (virtual_machine_type, virtual_machine_type_desc) to provide information when the SQL Server instance is running in a virtual machine environment.

 4. sys.dm_server_registry

This DMV provides registry key information related to the overall configuration/installation of the SQL Server instance.

DMV definition:

Column name

Column type

registry_key

nvarchar (256)

value_name

Nvarchar (256)

value_data

sql_variant

 The following groups of registry keys are covered in this DMV:

1)      To help find out what SQL Server services are available on the host machine

  • HKLM\SYSTEM\CurrentControlSet\Services\MSSQLServer\ObjectName
  • HKLM\SYSTEM\CurrentControlSet\Services\MSSQLServer\ImagePath
  • HKLM\SYSTEM\CurrentControlSet\Services\MSSQLServer\Start

2)      To help find out what SQL Agent services are available on the host machine

  • HKLM\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT\ObjectName
  • HKLM\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT\ImagePath
  • HKLM\SYSTEM\CurrentControlSet\Services\ SQLSERVERAGENT\Start
  • HKLM\SYSTEM\CurrentControlSet\Services\ SQLSERVERAGENT\DependOnService

3)      To find out the current version of SQL Engine

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ CurrentVersion

4)      To help with instance detectability, etc. the following registry keys are helpful

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ Parameters

5)      To help troubleshoot connectivity issues (intermittent connections, high latency, etc.) that may be a result of misconfiguration

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ SuperSocketNetLib\ AdminConnection\TCP
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ SuperSocketNetLib\ Np
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ SuperSocketNetLib\ Sm
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ SuperSocketNetLib\ TCP\ IP1… IPAll
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ MSSQLServer\ SuperSocketNetLib\ Via

6)      To help troubleshoot application issues due to incorrect settings in SQLServerAgent

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ SQLServerAgent\ErrorLoggingLevel
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ SQLServerAgent\JobHistoryMaxRows
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ SQLServerAgent\JobHistoryMaxRowsPerJob
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\ SQLServerAgent\WorkingDirectory

 5. sys.dm_server_services

This DMV provides information about three services related to SQL Server, namely SQL Server, SQL Agent and Fulltext (only available as of Denali). The DMV includes the following information about the current SQL instance:

Column name

Column type

service

nvarchar (256)

startup_type

int

startup_type_desc

nvarchar(256)

status

int

status_desc

nvarchar(256)

process_id

nvarchar (256)

last_startup_time

datetimeoffset

service_account

nvarchar (256)

filename

nvarchar (256)

is_clustered

nchar

cluster_nodename

nvarchar (256)

6. sys.dm_server_memory_dumps

This DMV provides information on memory dumps that have been generated as a result of a recent crash, for instance. Dump type may be minidump, all-thread dump or full dump.

DMV definition:

Column name

Column type

 filename

nvarchar (256)

size_in_bytes

bigint

creation_time

datetimeoffset

 

Thanks for reading this far. We’d love to hear your feedback once you get a chance to try them out.

 

-Xin Jin

Posted by 보미아빠
, |

memtoleave

카테고리 없음 / 2011. 11. 15. 02:03

    1. Use of Linked Servers – You can find out the linked servers that being used in your environment using the sysservers system catalog.
    2. Use of XML documents – You would have to find out if any queries or procedures perform any kind of XML data manipulation or use sp_xml_preparedocument.
    3. Extended Stored Procedures or sp_OAcreate calls
      1. Extended stored procedure usage can be identified by inspecting the SQL Server Errorlog and searching for the word using. The first XSP calls is logged in the Errorlog in the following manner: Using ‘<dll name>’ version ‘<version>’ to execute extended stored procedure ‘<XSP name>’.
      2. If you are using sp_OAcreate, then this information would be logged in the SQL Errorlog for the first invocation of sp_OAcreate using the same pattern mentioned above. The only difference would be that the DLL name would be odsole70.dll.
    4. Query Plans which are larger than 8 KB in size
      1. If you are using SQL Server 2000, query syscacheobjects and search for entries which have values greater than 1 for the pagesused column.
      2. If you are using SQL Server 2005, search for plans greater than 8KB using the DMV sys.dm_exec_cached_plans. Inspect the size_in_bytes column value and search for entries which have values greater than 8192 bytes.
    5. Use of SQLCLR (Applicable to SQL Server 2005 and above) – Check the memory usage for SQLCLR clerk using DBCC MEMORYSTATUS.
    6. Backups using larger MAXTRANSFERSIZE parameter – In such a case find out BACKUP DATABASE/LOG commands and inspect the MAXTRANSFERSIZE parameter value. The lowest size that can be provided is 65536 bytes.
    7. Using Network Packet Size higher than 8192 bytes. You can find all connections on SQL Server 2005 that use more than 8KB of connection using the following DMV: select * from sys.dm_exec_connections:

 

memtoleave region viewer

http://blogs.msdn.com/b/sqlosteam/archive/2010/10/24/mapping-virtual-address-space-in-t-sql.aspx

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함