Microsoft SQL Server: различия между версиями

Материал из Документация Ключ-АСТРОМ
(Новая страница: «Расширьте видимость, чтобы улучшить мониторинг работоспособности и производительности...»)
 
 
Строка 22: Строка 22:


УВЕДОМЛЕНИЕ ОБ ОБНОВЛЕНИИ . При обновлении конфигураций мониторинга до версии ''1.2.0+'' необходимо включить наборы функций, чтобы мониторинг мог продолжаться.
УВЕДОМЛЕНИЕ ОБ ОБНОВЛЕНИИ . При обновлении конфигураций мониторинга до версии ''1.2.0+'' необходимо включить наборы функций, чтобы мониторинг мог продолжаться.
=== Активация ===
* Если ваш сервер баз данных MS SQL работает непосредственно на виртуальной машине, вам потребуется установить ЕдиныйАгент.
* Активируйте удаленное расширение MS SQL Server, чтобы получить дополнительные метрики и события (см. ниже).
* Активируйте локальное расширение MS SQL Server
Убедитесь, что у вас включен лог мониторинга
=== Действия по активации удаленного мониторинга (версия 1.257+) ===
* Активируйте расширение в хабе, перейдя по ссылке:
* Управление → Ключ-АСТРОМ Hub → SQL Server → Добавить в среду
* Добавить новую конфигурацию мониторинга
=== Разрешения, необходимые для удаленного мониторинга ===
* Требуются разрешения, указанные в документации Microsoft для <code>sys.dm_os_performance_counters</code>DMV, <code>msdb.dbo.backupset</code>и .<code>master.dbo.sysdatabases</code>
* Важно : Чтобы отслеживать показатели для логических баз данных, таких как <code>master</code>, <code>tempdb</code>и базы данных, созданные пользователями, <code>msdb.dbo.backupset</code>представление должно присутствовать и быть доступным. В настоящее время он не поддерживается в базе данных SQL Azure (PAAS).
* Требуются следующие разрешения: <code>VIEW SERVER STATE</code>, <code>VIEW DATABASE STATE</code>, <code>VIEW ANY DEFINITION</code>, <code>VIEW ANY DATABASE</code>(или <code>CREATE DATABASE</code>разрешение в базе данных master).
* Для целей службы базы данных SQL Basic, S0 и S1, а также для баз данных в эластичных пулах требуется учетная запись администратора сервера или учетная запись администратора Azure Active Directory.
УВЕДОМЛЕНИЕ ОБ ОБНОВЛЕНИИ . При обновлении конфигураций мониторинга до версии ''1.2.0+'' необходимо включить наборы функций, чтобы мониторинг мог продолжаться.
== Метрики ==
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|Log files size
|sql-server.databases.log.filesSize
|KiloByte
|Cumulative size of all the transaction log files in the database
|-
|Log files used size
|sql-server.databases.log.filesUsedSize
|KiloByte
|The cumulative used size of all the log files in the database
|-
|Log flush waits
|sql-server.databases.log.flushWaits.count
|Count
|Number of commits waiting for the log flush
|-
|Log growths
|sql-server.databases.log.growths.count
|Count
|Number of times the transaction log for the database has been expanded
|-
|Log shrinks
|sql-server.databases.log.shrinks.count
|Count
|Number of log shrinks for this database
|-
|Log truncations
|sql-server.databases.log.truncations.count
|Count
|Number of times the transaction log has been truncated (in Simple Recovery Model)
|-
|Percent log used
|sql-server.databases.log.percentUsed
|Percent
|Percantage of space in the log that is in use
|-
|Transactions
|sql-server.databases.transactions.count
|Count
|Number of transactions started for the database
|-
|Database state
|sql-server.databases.state
|State
|Database state
|}
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|CPU Count
|sql-server.host.cpus
|Unspecified
|Detected CPU Count
|}
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|Release number
|sql-server.releaseNumber
|Unspecified
|Release number of SQL Server
|-
|Physical memory
|sql-server.memory.physical
|KiloByte
|Total amount of physical memory on the machine
|-
|Virtual memory
|sql-server.memory.virtual
|KiloByte
|Total amount of virtual address space available to the process in user mode
|-
|Total server memory
|sql-server.memory.total
|KiloByte
|Amount of memory the server has committed using the memory manager
|-
|Target server memory
|sql-server.memory.target
|KiloByte
|Amount of memory that can be consumed by memory manager
|-
|Time spent in kernel mode
|sql-server.cpu.kernelTime.count
|MilliSecond
|Time spent by all threads in kernel mode
|-
|Time spent in user mode
|sql-server.cpu.userTime.count
|MilliSecond
|Time spent by all threads in user mode
|-
|Free list stalls
|sql-server.buffers.freeListStalls.count
|Count
|Number of requests that had to wait for a free page
|-
|Page reads
|sql-server.buffers.pageReads.count
|Count
|Number of physical database page reads that are issued
|-
|Page writes
|sql-server.buffers.pageWrites.count
|Count
|Number of physical database page writes that are issued
|-
|Checkpoint pages
|sql-server.buffers.checkpointPages.count
|Count
|Number of pages flushed to disk by a checkpoint or other operations that require all dirty pages to be flushed
|-
|Page life expectancy
|sql-server.buffers.pageLifeExpectancy
|Second
|Number of seconds a page will stay in the buffer pool without references
|-
|Logins
|sql-server.general.logins.count
|Count
|Number of logins started, excluding pooled connections
|-
|User connections
|sql-server.general.userConnections
|Count
|Number of users currently connected to SQL Server
|-
|Processes blocked
|sql-server.general.processesBlocked
|Count
|Number of currently blocked processes
|-
|Lock timeouts
|sql-server.locks.timeouts.count
|Count
|Number of lock requests that timed out, including requests for NOWAIT locks
|-
|Deadlocks
|sql-server.locks.deadlocks.count
|Count
|Number of lock requests that resulted in a deadlock
|-
|Lock waits
|sql-server.locks.waits.count
|Count
|Number of lock requests that required the caller to wait
|-
|Lock wait time
|sql-server.locks.waitTime.count
|MilliSecond
|Wait time for locks
|-
|Latch waits
|sql-server.latches.waits.count
|Count
|Number of latch requests that could not be granted immediately
|-
|Average latch wait time
|sql-server.latches.averageWaitTime.count
|MilliSecond
|Average latch wait time for latch requests that had to wait
|-
|Batch requests
|sql-server.sql.batchRequests.count
|Count
|Number of Transact-SQL command batches received
|-
|SQL compilations
|sql-server.sql.compilations.count
|Count
|Number of SQL statement compilations
|-
|SQL re-compilations
|sql-server.sql.recompilations.count
|Count
|Number of SQL statement re-compilations
|-
|Connection memory
|sql-server.memory.connection
|KiloByte
|Total amount of dynamic memory the server is using for maintaining connections
|-
|Memory grants outstanding
|sql-server.memory.grantsOutstanding
|Count
|Number of processes that have successfully acquired a workspace memory grant
|-
|Memory grants pending
|sql-server.memory.grantsPending
|Count
|Number of processes waiting for a workspace memory grant
|-
|Buffer cache hit
|sql-server.buffers.cacheHitRatio
|Percent
|Percentage of pages found in the buffer cache without having to read from disk
|}
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|Availability mode
|sql-server.always-on.ar.availabilityMode
|State
|The availability mode of the replica
|-
|Failover mode
|sql-server.always-on.ar.failoverMode
|State
|The failover mode of the replica
|-
|Is replica local
|sql-server.always-on.ar.isLocal
|State
|Whether the replica is local
|-
|Replica role
|sql-server.always-on.ar.role
|State
|Current groups role of a local replica or a connected remote replica
|-
|Operational state
|sql-server.always-on.ar.operationalState
|State
|Current operational state of the replica
|-
|Recovery health
|sql-server.always-on.ar.recoveryHealth
|State
|Rollup of the database_state column
|-
|Synchronization health
|sql-server.always-on.ar.synchronizationHealth
|State
|Rollup of the database synchronization state of all joined replicas and the availability mode of the replica
|-
|Connected state
|sql-server.always-on.ar.connectedState
|State
|Whether a secondary replica is currently connected to the primary replica
|}
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|Hours since last backup
|sql-server.databases.backup.hoursPassed
|Hour
|Number of hours passed since last backup
|}
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|Automated backup preference
|sql-server.always-on.ag.automatedBackupPreference
|State
|Preferred location for backups in this availability group
|-
|Primary recovery health
|sql-server.always-on.ag.primaryRecoveryHealth
|State
|Indicates the recovery health of the primary replica
|-
|Secondary recovery health
|sql-server.always-on.ag.secondaryRecoveryHealth
|State
|Indicates the recovery health of a secondary replica
|-
|Synchronization health
|sql-server.always-on.ag.synchronizationHealth
|State
|Reflects a rollup of the synchronization health of all replicas the group
|}
{| class="wikitable"
! colspan="1" |Имя
! colspan="1" |Ключ метрики
! colspan="1" |Единицы
! colspan="1" |Описание
|-
|Synchronization state
|sql-server.always-on.db.synchronizationState
|State
|Data-movement state
|-
|Synchronization health
|sql-server.always-on.db.synchronizationHealth
|State
|Intersection of the synchronization state of a database that is joined to the group on the replica and the availability mode of the replica
|-
|Database state
|sql-server.always-on.db.state
|State
|State of the availability database
|-
|Log send queue size
|sql-server.always-on.db.logSendQueueSize
|KibiByte
|Amount of log records of the primary database not sent to the secondary databases
|-
|Log send rate
|sql-server.always-on.db.logSendRate
|KiloBytePerSecond
|Average rate at which primary replica instance sends data
|-
|Redo queue size
|sql-server.always-on.db.redoQueueSize
|KiloByte
|Amount of log records in the log files of the secondary replica that has not yet been redone
|-
|Redo rate
|sql-server.always-on.db.redoRate
|KiloBytePerSecond
|Average Rate at which the log records are being redone on a given secondary database
|-
|Filestream send rate
|sql-server.always-on.db.filestreamSendRate
|KiloBytePerSecond
|The rate at which the filestream files are shipped to the secondary replica
|}

Текущая версия на 18:05, 1 июня 2023

Расширьте видимость, чтобы улучшить мониторинг работоспособности и производительности ваших серверов Microsoft SQL Server.

Обзор

Мониторинг базы данных Microsoft SQL Server основан на удаленном мониторинге, реализованном в виде расширения Кюч-АСТРОМ АктивныйШлюз. Расширение запрашивает базы данных MS SQL для ключевых показателей производительности и работоспособности, расширяя видимость и позволяя ИИ обнаруживать аномалии и анализировать проблемы.

Случаи Использования

  • Поймите все зависимости ваших приложений от базы данных, какие операторы базы данных выполняются и их производительность.
  • Повысьте производительность вашего приложения, уменьшив или оптимизировав типичные шаблоны базы данных, такие как проблема запроса 1+N.
  • Поймите влияние ресурсов, которое ваши приложения оказывают на вашу базу данных.
  • Узнайте, как нехватка ресурсов, блокировки или другие проблемы с базой данных влияют на ваше приложение, наблюдая за самим сервером базы данных.
  • Отслеживайте работоспособность и производительность серверов MS SQL
  • Ускорьте диагностику проблем приложений, если они вызваны базой данных.

Информация О Совместимости

Поддерживаемые типы SQL Server

SQL Server, База данных SQL Azure, Управляемый экземпляр Azure SQL.

Поддерживаемая версия SQL Server

Microsoft SQL Server с основной или расширенной поддержкой Microsoft. Подробную информацию об окончании срока службы см. в  документации Microsoft .

УВЕДОМЛЕНИЕ ОБ ОБНОВЛЕНИИ . При обновлении конфигураций мониторинга до версии 1.2.0+ необходимо включить наборы функций, чтобы мониторинг мог продолжаться.

Активация

  • Если ваш сервер баз данных MS SQL работает непосредственно на виртуальной машине, вам потребуется установить ЕдиныйАгент.
  • Активируйте удаленное расширение MS SQL Server, чтобы получить дополнительные метрики и события (см. ниже).
  • Активируйте локальное расширение MS SQL Server

Убедитесь, что у вас включен лог мониторинга

Действия по активации удаленного мониторинга (версия 1.257+)

  • Активируйте расширение в хабе, перейдя по ссылке:
  • Управление → Ключ-АСТРОМ Hub → SQL Server → Добавить в среду
  • Добавить новую конфигурацию мониторинга

Разрешения, необходимые для удаленного мониторинга

  • Требуются разрешения, указанные в документации Microsoft для sys.dm_os_performance_countersDMV, msdb.dbo.backupsetи .master.dbo.sysdatabases
  • Важно : Чтобы отслеживать показатели для логических баз данных, таких как master, tempdbи базы данных, созданные пользователями, msdb.dbo.backupsetпредставление должно присутствовать и быть доступным. В настоящее время он не поддерживается в базе данных SQL Azure (PAAS).
  • Требуются следующие разрешения: VIEW SERVER STATE, VIEW DATABASE STATE, VIEW ANY DEFINITION, VIEW ANY DATABASE(или CREATE DATABASEразрешение в базе данных master).
  • Для целей службы базы данных SQL Basic, S0 и S1, а также для баз данных в эластичных пулах требуется учетная запись администратора сервера или учетная запись администратора Azure Active Directory.

УВЕДОМЛЕНИЕ ОБ ОБНОВЛЕНИИ . При обновлении конфигураций мониторинга до версии 1.2.0+ необходимо включить наборы функций, чтобы мониторинг мог продолжаться.

Метрики

Имя Ключ метрики Единицы Описание
Log files size sql-server.databases.log.filesSize KiloByte Cumulative size of all the transaction log files in the database
Log files used size sql-server.databases.log.filesUsedSize KiloByte The cumulative used size of all the log files in the database
Log flush waits sql-server.databases.log.flushWaits.count Count Number of commits waiting for the log flush
Log growths sql-server.databases.log.growths.count Count Number of times the transaction log for the database has been expanded
Log shrinks sql-server.databases.log.shrinks.count Count Number of log shrinks for this database
Log truncations sql-server.databases.log.truncations.count Count Number of times the transaction log has been truncated (in Simple Recovery Model)
Percent log used sql-server.databases.log.percentUsed Percent Percantage of space in the log that is in use
Transactions sql-server.databases.transactions.count Count Number of transactions started for the database
Database state sql-server.databases.state State Database state
Имя Ключ метрики Единицы Описание
CPU Count sql-server.host.cpus Unspecified Detected CPU Count
Имя Ключ метрики Единицы Описание
Release number sql-server.releaseNumber Unspecified Release number of SQL Server
Physical memory sql-server.memory.physical KiloByte Total amount of physical memory on the machine
Virtual memory sql-server.memory.virtual KiloByte Total amount of virtual address space available to the process in user mode
Total server memory sql-server.memory.total KiloByte Amount of memory the server has committed using the memory manager
Target server memory sql-server.memory.target KiloByte Amount of memory that can be consumed by memory manager
Time spent in kernel mode sql-server.cpu.kernelTime.count MilliSecond Time spent by all threads in kernel mode
Time spent in user mode sql-server.cpu.userTime.count MilliSecond Time spent by all threads in user mode
Free list stalls sql-server.buffers.freeListStalls.count Count Number of requests that had to wait for a free page
Page reads sql-server.buffers.pageReads.count Count Number of physical database page reads that are issued
Page writes sql-server.buffers.pageWrites.count Count Number of physical database page writes that are issued
Checkpoint pages sql-server.buffers.checkpointPages.count Count Number of pages flushed to disk by a checkpoint or other operations that require all dirty pages to be flushed
Page life expectancy sql-server.buffers.pageLifeExpectancy Second Number of seconds a page will stay in the buffer pool without references
Logins sql-server.general.logins.count Count Number of logins started, excluding pooled connections
User connections sql-server.general.userConnections Count Number of users currently connected to SQL Server
Processes blocked sql-server.general.processesBlocked Count Number of currently blocked processes
Lock timeouts sql-server.locks.timeouts.count Count Number of lock requests that timed out, including requests for NOWAIT locks
Deadlocks sql-server.locks.deadlocks.count Count Number of lock requests that resulted in a deadlock
Lock waits sql-server.locks.waits.count Count Number of lock requests that required the caller to wait
Lock wait time sql-server.locks.waitTime.count MilliSecond Wait time for locks
Latch waits sql-server.latches.waits.count Count Number of latch requests that could not be granted immediately
Average latch wait time sql-server.latches.averageWaitTime.count MilliSecond Average latch wait time for latch requests that had to wait
Batch requests sql-server.sql.batchRequests.count Count Number of Transact-SQL command batches received
SQL compilations sql-server.sql.compilations.count Count Number of SQL statement compilations
SQL re-compilations sql-server.sql.recompilations.count Count Number of SQL statement re-compilations
Connection memory sql-server.memory.connection KiloByte Total amount of dynamic memory the server is using for maintaining connections
Memory grants outstanding sql-server.memory.grantsOutstanding Count Number of processes that have successfully acquired a workspace memory grant
Memory grants pending sql-server.memory.grantsPending Count Number of processes waiting for a workspace memory grant
Buffer cache hit sql-server.buffers.cacheHitRatio Percent Percentage of pages found in the buffer cache without having to read from disk
Имя Ключ метрики Единицы Описание
Availability mode sql-server.always-on.ar.availabilityMode State The availability mode of the replica
Failover mode sql-server.always-on.ar.failoverMode State The failover mode of the replica
Is replica local sql-server.always-on.ar.isLocal State Whether the replica is local
Replica role sql-server.always-on.ar.role State Current groups role of a local replica or a connected remote replica
Operational state sql-server.always-on.ar.operationalState State Current operational state of the replica
Recovery health sql-server.always-on.ar.recoveryHealth State Rollup of the database_state column
Synchronization health sql-server.always-on.ar.synchronizationHealth State Rollup of the database synchronization state of all joined replicas and the availability mode of the replica
Connected state sql-server.always-on.ar.connectedState State Whether a secondary replica is currently connected to the primary replica
Имя Ключ метрики Единицы Описание
Hours since last backup sql-server.databases.backup.hoursPassed Hour Number of hours passed since last backup
Имя Ключ метрики Единицы Описание
Automated backup preference sql-server.always-on.ag.automatedBackupPreference State Preferred location for backups in this availability group
Primary recovery health sql-server.always-on.ag.primaryRecoveryHealth State Indicates the recovery health of the primary replica
Secondary recovery health sql-server.always-on.ag.secondaryRecoveryHealth State Indicates the recovery health of a secondary replica
Synchronization health sql-server.always-on.ag.synchronizationHealth State Reflects a rollup of the synchronization health of all replicas the group
Имя Ключ метрики Единицы Описание
Synchronization state sql-server.always-on.db.synchronizationState State Data-movement state
Synchronization health sql-server.always-on.db.synchronizationHealth State Intersection of the synchronization state of a database that is joined to the group on the replica and the availability mode of the replica
Database state sql-server.always-on.db.state State State of the availability database
Log send queue size sql-server.always-on.db.logSendQueueSize KibiByte Amount of log records of the primary database not sent to the secondary databases
Log send rate sql-server.always-on.db.logSendRate KiloBytePerSecond Average rate at which primary replica instance sends data
Redo queue size sql-server.always-on.db.redoQueueSize KiloByte Amount of log records in the log files of the secondary replica that has not yet been redone
Redo rate sql-server.always-on.db.redoRate KiloBytePerSecond Average Rate at which the log records are being redone on a given secondary database
Filestream send rate sql-server.always-on.db.filestreamSendRate KiloBytePerSecond The rate at which the filestream files are shipped to the secondary replica