Loading...
ÓÑÇéÁ´½Ó£º Pandora Charms Ugg Australia Boots Ghd Straighteners
             
 
¾ÆÀ̵ð
ÆÐ½º¿öµå

   
   


³¯Â¥ : 2009-10-15 ¿ÀÀü 10:01:18  Ãßõ : 1  Á¶È¸ : 1065

À̸§

À̽¿¬

Á¦¸ñ

SQL Server 2008 È®ÀåÀ̺¥Æ® (XEvent)

 

 

Ȥ½Ã È®ÀåÀ̺¥Æ®¶ó°í µé¾îº¸¼Ì³ª¿ä?
sqler.pe.kr MSSQL Tip ¶õ¿¡ º¸½Ã¸é ¼®ÀÌ´ÔÀÌ ¿Ã¸®½Å XEvent¶ó´Â °ÍÀÌ Àִµ¥ ±×°ÍÀÌ 2008ÀÇ new feature À̶ó Çϳ׿ä. ±×¸®°í ÀÌ È®ÀåÀ̺¥Æ®¸¦ DBA°¡ ÀÓÀÇ·Î ¸¸µé¼öµµ ÀÖ°í, ±âº»ÀûÀ¸·Î Ç×»ó ¶° ÀÖ´Â È®ÀåÀ̺¥Æ®(XEvent)°¡ ÀÖ´Ù°í ÇÏ´õ±º¿ä.

¿ø¹® ¸µÅ© : http://blogs.msdn.com/psssql/archive/2008/07/15/supporting-sql-server-2008-the-system-health-session.aspx

¿ä±â¿¡ º¸½Ã¸é ±âº»ÀûÀ¸·Î µ¹¾Æ°¡´Â È®ÀåÀ̺¥Æ®(XEvent) ¼¼¼ÇÀº System-health ÀÌ°í ±× System-health´Â ¾Æ·¡¿Í °°Àº errorµéÀ» ±â·ÏÇÑ´Ù°í Çϳ׿ä.

1. The sql_text and session_id for any sessions that encounter an error with severity >=20 
2. The sql_text and session_id for any sessions that encounter a "memory" type of error such as 17803, 701, etc (we added this because not all memory errors are severity >=20) 
3. A record of any "non-yielding" problems (you have sometimes seen these in the ERRORLOG as Msg 17883) 
4. Any deadlocks that are detected 
5. The callstack, sql_text, and session_id for any sessions who have waited on latches (or other interesting resources) for > 15 seconds 
6. The callstack, sql_text, and session_id for any sessions who have waited on locks for > 30 seconds 
7. The callstack, sql_text, and session_id for any session that have waited for an extended period of time for "external" waits or "pre-emptive waits". 

ÇØ¼­ ´ÙÀ½°ú °°ÀÌ °£´ÜÇÏ°Ô Blocking¸¸ Å×½ºÆ® ÇØº¸¾Ò¾î¿ä.
ÇØ´ç Blocking ½ºÅ©¸³Æ®´Â 'Àü¹®°¡·Î °¡´Â ±æ(3) - SQL Server 2000/2005 Æ©´×'À̶ó´Â Ã¥¿¡ ÀÖ´Â ½ºÅ©¸³Æ®¸¦ »ç¿ëÇß¾î¿ä.

USE tempdb
GO
DROP TABLE testtable 
GO
CREATE TABLE testtable (a int not null)
INSERT testtable VALUES(1)
GO
 
CREATE PROCEDURE testproc
AS
  PRINT 'testproc ½ÃÀÛ'
  UPDATE testtable
    SET a = 12
  PRINT 'testproc Á¾·á'
GO
 
CREATE PROCEDURE exectest
AS
  PRINT 'exectest ½ÃÀÛ'
  EXEC testproc
GO

--<¼¼¼Ç-1>
DBCC TRACEON(2681, -1)
GO 
BEGIN TRANSACTION
  SELECT * FROM testtable (HOLDLOCK)

--<¼¼¼Ç-2>
EXEC exectest

--<¼¼¼Ç-1>
ROLLBACK TRAN

ÀÌ·¸°Ô Blocking »óŸ¦ ¾à 15ÃÊ ÀÌ»ó Áö¼Ó½ÃŲ ÈÄ ¾Æ·¡¿Í °°Àº System-health ±â·ÏÀ» º¸´Â ½ºÅ©¸³Æ®¸¦ µ¹¸®¸é BlockingÁ¤º¸°¡ º¸Àϲ¨¿¡¿ä.

SELECT
	 wait_info.value('(data/value)[1]','nvarchar(max)') as 'wait_type(VALUE)'
	,wait_info.value('(data/text)[1]','nvarchar(max)') as 'wait_type(TEXT)'  
	,wait_info.value('(data/value)[2]','nvarchar(max)') as 'event_opcode(VALUE)'
	,wait_info.value('(data/text)[2]','nvarchar(max)') as 'event_opcode(TEXT)'
	,wait_info.value('(data)[3]','nvarchar(max)') duration
	,wait_info.value('(data)[4]','nvarchar(max)') max_duration
	,wait_info.value('(data)[5]','nvarchar(max)') total_duration
	,wait_info.value('(data)[6]','nvarchar(max)') signal_duration
	,wait_info.value('(data)[7]','nvarchar(max)') completed_count
	,wait_info.value('(action)[1]','nvarchar(max)') callstack
	,wait_info.value('(action)[2]','nvarchar(max)') session_id
	,wait_info.value('(action)[3]','nvarchar(max)') sql_text
FROM (
	SELECT CAST(xest.target_data AS XML) statementdata
	from sys.dm_xe_session_targets xest INNER JOIN sys.dm_xe_sessions xes 
	ON xes.address = xest.event_session_address
	WHERE xest.target_name = 'ring_buffer' AND xes.name = 'system_health'
) statements
CROSS APPLY statementdata.nodes ('//RingBufferTarget/event[@name="wait_info"]') AS a(wait_info)

±âº»ÀûÀ¸·Î È®ÀåÀ̺¥Æ®(XEvent)±â·ÏÀÌ XML·Î ÀúÀåÀÌ µÇ¾î¼­;;; XQuery·Î ÀÛ¼ºÇØ¾ß ÇÏ´Â ¾î·Á¿òÀÌ ÀÖ³×¿ä ¤Ì.¤Ì;;

À§ ½ºÅ©¸³Æ®´Â ´ë±â(wait_info)¸¸ º¸ÀÌ´Â ½ºÅ©¸³Æ®À̰í¿ä. DeadLockÀ» º¸·Á¸é '//RingBufferTarget/event[@name="wait_info"]'ÀÌ ºÎºÐÀ» '//RingBufferTarget/event[@name="xml_deadlock_report"]' ÀÌ·¸°Ô ¹Ù²Ù°í XQuery À» ÀÛ¼ºÇؼ­ º¸¸é º¸Àϲ¨¶ó ¹Ï¾î º¸¾Æ¿ä -0-;;;

 

 

 ±èÁ¾¿­(2009³â 10¿ù 16ÀÏ ±Ý¿äÀÏ 10:51)
xEvent´Â ¾Æ´ÏÁö¸¸ ¿ª½Ã DMV¸¦ ÀÌ¿ëÇÏ¿© ºÐ¼®À» ½ÃµµÇϰíÀÚ Çß´ø Äõ¸®°¡ ÀÖ±º¿ä
¼ÛÇõ¾¾ÀÇ ±ÛÀ» ¸µÅ©ÇÕ´Ï´Ù. Âü°í ^^
http://www.sqlleader.com/mboard.asp?exec=view&strBoardID=SS2005Admin&intSeq=3300

Àǰß

À̸§

 À̸ÞÀÏ   ºñ¹Ð¹øÈ£

 

Àüü 1 °Ç

À̽¿¬

2009-10-15

1

1066