sp_monitor (Transact-SQL)sp_monitor (Transact-SQL)
SQL Server
Banco de Dados SQL do Azure
Azure Synapse Analytics (SQL DW)
Parallel Data Warehouse
SQL Server
Azure SQL Database
Azure Synapse Analytics (SQL DW)
Parallel Data Warehouse
Exibe estatísticas sobre MicrosoftMicrosoft SQL ServerSQL Server.Displays statistics about MicrosoftMicrosoft SQL ServerSQL Server.
Convenções de sintaxe de Transact-SQL
Transact-SQL Syntax Conventions
SintaxeSyntax
sp_monitor
Valores do código de retornoReturn Code Values
0 (êxito) ou 1 (falha)0 (success) or 1 (failure)
Conjuntos de resultadosResult Sets
Nome da colunaColumn name | DescriçãoDescription |
---|---|
last_runlast_run | Tempo sp_monitor foi executado pela última vez.Time sp_monitor was last run. |
current_runcurrent_run | Tempo sp_monitor está sendo executado.Time sp_monitor is being run. |
segundosseconds | Número de segundos decorridos desde sp_monitor foi executado.Number of elapsed seconds since sp_monitor was run. |
cpu_busycpu_busy | Segundos durante os quais a CPU do computador servidor está executando o trabalho do SQL ServerSQL Server.Number of seconds that the server computer's CPU has been doing SQL ServerSQL Server work. |
io_busyio_busy | Segundos durante os quais o SQL ServerSQL Server executou operações de entrada e saída.Number of seconds that SQL ServerSQL Server has spent doing input and output operations. |
Ociosoidle | Segundos durante os quais o SQL ServerSQL Server ficou inativo.Number of seconds that SQL ServerSQL Server has been idle. |
packets_receivedpackets_received | Número de leituras de pacotes de entrada feitas pelo SQL ServerSQL Server.Number of input packets read by SQL ServerSQL Server. |
packets_sentpackets_sent | Número de pacotes de saída gravados pelo SQL ServerSQL Server.Number of output packets written by SQL ServerSQL Server. |
packet_errorspacket_errors | Número de erros encontrados pelo SQL ServerSQL Server ao ler e gravar pacotes.Number of errors encountered by SQL ServerSQL Server while reading and writing packets. |
total_readtotal_read | Número de leituras feias pelo SQL ServerSQL Server.Number of reads by SQL ServerSQL Server. |
total_writetotal_write | Número de gravações feias pelo SQL ServerSQL Server.Number of writes by SQL ServerSQL Server. |
total_errorstotal_errors | Número de erros encontrados pelo SQL ServerSQL Server durante a leitura e gravação.Number of errors encountered by SQL ServerSQL Server while reading and writing. |
Conexõesconnections | Número de logons ou tentativas de logon no SQL ServerSQL Server.Number of logins or attempted logins to SQL ServerSQL Server. |
ComentáriosRemarks
O SQL ServerSQL Server controla, através de várias funções, a quantidade de trabalho realizada.SQL ServerSQL Server keeps track, through a series of functions, of how much work it has done. Executando sp_monitor exibe os valores atuais retornados por essas funções e mostra o quanto eles foram alterados desde a última vez em que o procedimento foi executado.Executing sp_monitor displays the current values returned by these functions and shows how much they have changed since the last time the procedure was run.
Para cada coluna, a estatística é impressa na forma número(número) –número% ou número(número).For each column, the statistic is printed in the form number(number)-number% or number(number). A primeira número refere-se ao número de segundos (para cpu_busy, io_busy, e ocioso) ou o número total (para o outro variáveis) desde que SQL ServerSQL Server foi reiniciado.The first number refers to the number of seconds (for cpu_busy, io_busy, and idle) or the total number (for the other variables) since SQL ServerSQL Server was restarted. O número entre parênteses refere-se ao número de segundos ou número total desde a última vez sp_monitor foi executado.The number in parentheses refers to the number of seconds or total number since the last time sp_monitor was run. A porcentagem é a porcentagem de tempo desde sp_monitor foi executado pela última vez.The percentage is the percentage of time since sp_monitor was last run. Por exemplo, se o relatório mostra cpu_busy como 4250 (215)-68%, a CPU ficou ocupada 4250 segundos desde SQL ServerSQL Server foi iniciado pela última vez, 215 segundos desde sp_monitor foi a última execução e 68% do total de tempo desde sp_monitor foi executado pela última vez.For example, if the report shows cpu_busy as 4250(215)-68%, the CPU has been busy 4250 seconds since SQL ServerSQL Server was last started up, 215 seconds since sp_monitor was last run, and 68 percent of the total time since sp_monitor was last run.
PermissõesPermissions
Exige associação à função de servidor fixa sysadmin .Requires membership in the sysadmin fixed server role.
ExemplosExamples
O exemplo a seguir relata as informações sobre o quanto o SQL ServerSQL Server esteve ocupado.The following example reports information about how busy SQL ServerSQL Server has been.
USE master
EXEC sp_monitor
Aqui está o conjunto de resultados.Here is the result set.
last_runlast_run | current_runcurrent_run | segundosseconds |
29 de março de 1998 11:55Mar 29 1998 11:55AM | 4 de abril de 1998 14:22Apr 4 1998 2:22 PM | 561561 |
cpu_busycpu_busy | io_busyio_busy | Ociosoidle |
190(0)-0%190(0)-0% | 187(0)-0%187(0)-0% | 148(556)-99%148(556)-99% |
packets_receivedpackets_received | packets_sentpackets_sent | packet_errorspacket_errors |
16(1)16(1) | 20(2)20(2) | 0(0)0(0) |
total_readtotal_read | total_writetotal_write | total_errorstotal_errors | Conexõesconnections |
141(0)141(0) | 54920(127)54920(127) | 0(0)0(0) | 4(0)4(0) |
Consulte tambémSee Also
sp_who (Transact-SQL) sp_who (Transact-SQL)
Procedimentos armazenados do sistema (Transact-SQL)System Stored Procedures (Transact-SQL)
Comentários
Carregando comentários...