26
SQLDiag 를 를를를 SQL Server 200 5 를를를를 를를를 를를 를를를 를를 ([email protected]) ([email protected]) 를를를를를를를를를 를를를를를를를를를

SQLDiag 를 이용한 SQL Server 2005 성능진단

Embed Size (px)

DESCRIPTION

SQLDiag 를 이용한 SQL Server 2005 성능진단. 김종구 과장 ([email protected]) 한국마이크로소프트. SQLDiag 란 ?. SQL Server 2005 진단 데이터 수집 서비스 PSSDiag 툴이 SQLDiag 로 이름이 변경 . SS2K/7.0 에서 사용되던 SQLDiag 가 동일한 이름으로 대체 . SQL Server 관련 이슈에 대한 모든 진단 데이터를 한번에 수집할 수 있는 도구. History. 2001 에 작성 . - PowerPoint PPT Presentation

Citation preview

Page 1: SQLDiag 를 이용한 SQL Server 2005   성능진단

SQLDiag 를 이용한 SQL Server 2005 성능진단SQLDiag 를 이용한 SQL Server 2005 성능진단

김종구 과장김종구 과장 ([email protected])([email protected])한국마이크로소프트한국마이크로소프트

Page 2: SQLDiag 를 이용한 SQL Server 2005   성능진단

SQLDiagSQLDiag 란란 ??

SQL Server 2005 SQL Server 2005 진단 데이터 수집 서비스진단 데이터 수집 서비스 PSSDiag PSSDiag 툴이 툴이 SQLDiagSQLDiag 로 이름이 변경로 이름이 변경 . . SS2K/7.0SS2K/7.0 에서 사용되던 에서 사용되던 SQLDiagSQLDiag 가 동일한 가 동일한

이름으로 대체이름으로 대체 .. SQL ServerSQL Server 관련 이슈에 대한 모든 진단 관련 이슈에 대한 모든 진단

데이터를 한번에 수집할 수 있는 도구데이터를 한번에 수집할 수 있는 도구

Page 3: SQLDiag 를 이용한 SQL Server 2005   성능진단

HistoryHistory

20012001 에 작성에 작성 .. 고객기술지원부 내에서 고객기술지원부 내에서 SQL ServerSQL Server 관련 관련

케이스의 대다수에 사용되고 있음케이스의 대다수에 사용되고 있음 .. 다른 제품의 기술지원에도 사용다른 제품의 기술지원에도 사용 . (Excha. (Excha

nge nge 등등 )) 20032003 년에 일반에게 공개년에 일반에게 공개 .. SQL Server 2005SQL Server 2005 에서 서버에 내장에서 서버에 내장 .. SQL Server 2005SQL Server 2005 에서부터 에서부터 SQLDiagSQLDiag 에 에

대한 기술지원 시작대한 기술지원 시작 ..

Page 4: SQLDiag 를 이용한 SQL Server 2005   성능진단

SQLDiagSQLDiag 가 수집할 수 있는 것가 수집할 수 있는 것 ?? Profiler traceProfiler trace Blocking script/traceBlocking script/trace Perfmon/Sysmon logsPerfmon/Sysmon logs Server configuration and state infoServer configuration and state info SQL Server error logsSQL Server error logs Event logsEvent logs MSInfoMSInfo Virtually any other diagnosticVirtually any other diagnostic

Page 5: SQLDiag 를 이용한 SQL Server 2005   성능진단

Service vs. Console AppService vs. Console App 두 가지 다 운영가능두 가지 다 운영가능 .. 서비스로 운영될 경우 무인 작동 가능서비스로 운영될 경우 무인 작동 가능 .. 로그 파일과 이벤트 로그에 기록로그 파일과 이벤트 로그에 기록 .. Supports Supports

self-registration/deregistration (/R, /U)self-registration/deregistration (/R, /U) Supports service control (Supports service control (START, START, STOP, STOP_ABORTSTOP, STOP_ABORT))

Page 6: SQLDiag 를 이용한 SQL Server 2005   성능진단

시작 및 중지시작 및 중지 Console appConsole app

Run SQLDiag.exe to start itRun SQLDiag.exe to start it Press Ctrl+C to stop it or create “stop file”Press Ctrl+C to stop it or create “stop file” Press Ctrl+C a second time to stop ASAPPress Ctrl+C a second time to stop ASAP

ServiceService SQLDIAG STARTSQLDIAG START to start it to start it SQLDIAG STOPSQLDIAG STOP to stop it to stop it SQLDIAG STOP_ABORTSQLDIAG STOP_ABORT to stop ASAP to stop ASAP

Page 7: SQLDiag 를 이용한 SQL Server 2005   성능진단

구성 파일구성 파일

XMLXML 과 과 INI format INI format 지원지원 /I/I 옵션을 통해 지정옵션을 통해 지정 text editortext editor 나 나 GUI configuration appGUI configuration app

로 설정 가능 로 설정 가능

Page 8: SQLDiag 를 이용한 SQL Server 2005   성능진단

구성 파일구성 파일 SQLDiagSQLDiag 에서 에서 33 가지 기본 파일 제공가지 기본 파일 제공 ::

SQLDiag.XMLSQLDiag.XML (default) – snapshot of error logs, (default) – snapshot of error logs, configuration and state info, and MSInfoconfiguration and state info, and MSInfo

SD_General.XMLSD_General.XML – lightweight version of all diag – lightweight version of all diagnostics – Profiler, Perfmon, event logs, etc.nostics – Profiler, Perfmon, event logs, etc.

SD_Detailed.XMLSD_Detailed.XML – heavier version of all diagno – heavier version of all diagnostics (stmt-level Trace events)stics (stmt-level Trace events)

Page 9: SQLDiag 를 이용한 SQL Server 2005   성능진단

대상 머신과 대상 머신과 InstanceInstance

구성파일에서 지정구성파일에서 지정 .. 기본값은 현재 머신의 모든 기본값은 현재 머신의 모든 InstanceInstance 에서 에서

데이터를 수집데이터를 수집 특정 머신이나 특정 머신이나 InstanceInstance 를 지정 가능를 지정 가능

Page 10: SQLDiag 를 이용한 SQL Server 2005   성능진단

보안보안1.1. SQL Server sysadmin SQL Server sysadmin 그룹의 멤버여야 함그룹의 멤버여야 함 ..2.2. 대상 대상 InstanceInstance 에 로그인 가능해야 함에 로그인 가능해야 함 ..3.3. Administrators Administrators 그룹의 멤버여야 함그룹의 멤버여야 함 ..

/G (Generic mode)/G (Generic mode) 인 경우에는 인 경우에는 33 번만 번만 충족되면 됨충족되면 됨 ..

Page 11: SQLDiag 를 이용한 SQL Server 2005   성능진단

OutputOutput

기본 기본 output folder …90\Tools\Binn\SQLDioutput folder …90\Tools\Binn\SQLDiagag

/O /O 를 통해 변경가능를 통해 변경가능 ProfilerProfiler 와 와 PerfmonPerfmon 는 는 rollover rollover 지원지원 데이터 수집 동안 데이터 수집 동안 /C1 /C1 옵션을 이용하여 옵션을 이용하여 NN

TFS TFS 압축 가능압축 가능

Page 12: SQLDiag 를 이용한 SQL Server 2005   성능진단

Output Output

폴더는 자동으로 이름 변경이 되거나 폴더는 자동으로 이름 변경이 되거나 덮어 쓰기를 할 수 있음덮어 쓰기를 할 수 있음 . (/N). (/N)

Profiler traceProfiler trace 는 서버의 는 서버의 Log folderLog folder 에 에 기록된 후 이동기록된 후 이동 ..

Output file Output file 이름은 머신과 이름은 머신과 Instance Instance 이름을 포함이름을 포함

Internal output fileInternal output file 은 “은 “ ##” prefix##” prefix 를 가짐를 가짐

Page 13: SQLDiag 를 이용한 SQL Server 2005   성능진단

Scheduling Scheduling

/X /X 옵션을 이용하여 해당 시점옵션을 이용하여 해당 시점 (snapshot)(snapshot)의 데이터 수집 후 중지의 데이터 수집 후 중지

/L /L 옵션을 이용하여 옵션을 이용하여 scheduleschedule 된 중지 후 된 중지 후 자동으로 재시작자동으로 재시작

SQLAgentSQLAgent 를 통해서도 를 통해서도 SchedulingScheduling 이 가능이 가능

Page 14: SQLDiag 를 이용한 SQL Server 2005   성능진단

장기간의 데이터 수집장기간의 데이터 수집

서비스로 등록하여 실행서비스로 등록하여 실행 Target data collectionTarget data collection 을 위해 일정 사용을 위해 일정 사용 Output folder renaming Output folder renaming 및 및 auto-auto-

restart restart 사용사용 .TRC .TRC 및 및 .BLG file.BLG file 들의 들의 rolled overrolled over 로 로

인한 공간을 절약하기 위해 인한 공간을 절약하기 위해 /C1 /C1 옵션 사용 옵션 사용 고려고려

Page 15: SQLDiag 를 이용한 SQL Server 2005   성능진단

ClustersClusters

아래 사항에 대해서 모든 가상 서버에 대해 아래 사항에 대해서 모든 가상 서버에 대해 데이터를 자동으로 추출데이터를 자동으로 추출 :: 대상 서버 이름으로 “대상 서버 이름으로 “ .”.” 이 설정된 경우 이 설정된 경우

(default)(default) Cluster nodeCluster node 에서 수행이 되는 경우에서 수행이 되는 경우 /G (generic mode)/G (generic mode) 가 설정되지 않은 경우 가 설정되지 않은 경우

(default)(default) ClusterCluster 의 가상 서버들을 확인하고의 가상 서버들을 확인하고 , , 각 각

가상서버의 모든 가상서버의 모든 InstanceInstance 에 대해 데이터를 에 대해 데이터를 수집함수집함 ..

Page 16: SQLDiag 를 이용한 SQL Server 2005   성능진단

Remote MachinesRemote Machines

Recommend approach is to install the serviRecommend approach is to install the service on remote machines ce on remote machines

SQLDiagSQLDiag 는 원격 서버에 대해 데이터 수집 는 원격 서버에 대해 데이터 수집 가능가능

TRC TRC 파일은 해당 서버에 저장된 후 옮겨파일은 해당 서버에 저장된 후 옮겨짐짐 . .

다른 데이터는 다른 데이터는 SQLDiagSQLDiag 가 수행되는 가 수행되는 머신에 저장머신에 저장

Page 17: SQLDiag 를 이용한 SQL Server 2005   성능진단

Multiple MachinesMultiple Machines

각 머신에 대한 각 머신에 대한 SectionSection 을 구성파일에 추가을 구성파일에 추가 모든 수집된 데이터는 모든 수집된 데이터는 output folderoutput folder 로 같이 로 같이

저장됨저장됨 .. 각 머신은 각각의 각 머신은 각각의 worker threadworker thread 를 할당받음를 할당받음 .. 모든 성능 로그는 하나의 모든 성능 로그는 하나의 BLG BLG 파일에 파일에

남겨짐남겨짐 ..

Page 18: SQLDiag 를 이용한 SQL Server 2005   성능진단

Custom TasksCustom Tasks

Supports wide variety of custom tasks:Supports wide variety of custom tasks: TSQL commandTSQL command TSQL script (with parameters)TSQL script (with parameters) Registry query, backupRegistry query, backup Copy file, list fileCopy file, list file ActiveX scripts (VBScript, JScript, etc.)ActiveX scripts (VBScript, JScript, etc.) Batch files, utilities, etc.Batch files, utilities, etc. Groups and nestingGroups and nesting

Page 19: SQLDiag 를 이용한 SQL Server 2005   성능진단

Custom TasksCustom Tasks Support built-in and user-defined variablesSupport built-in and user-defined variables Variables can be used within a task, embedded in TSQL scriVariables can be used within a task, embedded in TSQL scri

pts, or passed to sub-processespts, or passed to sub-processes Built-in:Built-in:

startup_path, output_pathstartup_path, output_path server, instance, server_instanceserver, instance, server_instance rsinstance, olapinstancersinstance, olapinstance authmode, ssuser, sspwdauthmode, ssuser, sspwd ssver, sspath, ssregroot, ssbatchrunnerssver, sspath, ssregroot, ssbatchrunner output_name, internal_output_nameoutput_name, internal_output_name quietmode, compressionmode, genericmode, outputfoldermodequietmode, compressionmode, genericmode, outputfoldermode starttime, endtimestarttime, endtime Environment variablesEnvironment variables

Page 20: SQLDiag 를 이용한 SQL Server 2005   성능진단

User-defined VariablesUser-defined Variables

구성파일에서 지정 또는 구성파일에서 지정 또는 /V /V 옵션을 옵션을 사용하여 지정 가능사용하여 지정 가능SQLDIAG /V foo=barSQLDIAG /V foo=bar

SQLDiag can prompt for variable values at rSQLDiag can prompt for variable values at runtime (console app only)untime (console app only)

Page 21: SQLDiag 를 이용한 SQL Server 2005   성능진단

ServerServer 에 미치는 영향에 미치는 영향 PerformancePerformance

Minimal for collector itself (<10% CPU)Minimal for collector itself (<10% CPU) Usually equal to sum of selected diagnosticsUsually equal to sum of selected diagnostics Dominated by Profiler trace costDominated by Profiler trace cost

Support objectsSupport objects Created in tempdb and dropped afterwardCreated in tempdb and dropped afterward

Registry entriesRegistry entries None for console appNone for console app Deleted by service deregistrationDeleted by service deregistration

Page 22: SQLDiag 를 이용한 SQL Server 2005   성능진단

GUI Configuration AppGUI Configuration App

구성파일에 대한 생성 및 편집 지원구성파일에 대한 생성 및 편집 지원 Collection Collection 서비스에 대한 조절 지원서비스에 대한 조절 지원 Provides limited automatic problem Provides limited automatic problem

diagnosisdiagnosis

Page 23: SQLDiag 를 이용한 SQL Server 2005   성능진단

SQLDiag vs. PSSDiagSQLDiag vs. PSSDiag Essentially the same tool (same code)Essentially the same tool (same code) SQLDiag does not include support files for SQLDiag does not include support files for

down level versions of SQL Serverdown level versions of SQL Server SQLDiag does not support ZIP compressionSQLDiag does not support ZIP compression SQLDiag can only be run by AdministratorsSQLDiag can only be run by Administrators

Page 24: SQLDiag 를 이용한 SQL Server 2005   성능진단

Yukon SQLDiag vs. Sphinx SQLDiYukon SQLDiag vs. Sphinx SQLDiagag

Yukon SQLDiag is a superset of Sphinx SQLDiagYukon SQLDiag is a superset of Sphinx SQLDiag Sphinx/Shiloh SQLDiag was a snapshot of error logs, configSphinx/Shiloh SQLDiag was a snapshot of error logs, config

uration, etc.uration, etc. No Perfmon, Profiler, blocking info, or customizationNo Perfmon, Profiler, blocking info, or customization Snapshot collection only (no polling support)Snapshot collection only (no polling support) No multi-instance or multi-machine supportNo multi-instance or multi-machine support No scheduling or built-in compressionNo scheduling or built-in compression Diagnostics collected serially rather than in parallelDiagnostics collected serially rather than in parallel

Page 25: SQLDiag 를 이용한 SQL Server 2005   성능진단

FAQFAQWhat’s the perf impact of running this?What’s the perf impact of running this?Can I add new Perfmon counters or Profiler trace events?Can I add new Perfmon counters or Profiler trace events?Can I filter the Profiler trace?Can I filter the Profiler trace?Can I run SQLDiag via SQLAgent?Can I run SQLDiag via SQLAgent?Can I add my own diagnostics to the collection set?Can I add my own diagnostics to the collection set?Can I collect diagnostics for Reporting Services, Analysis ServiCan I collect diagnostics for Reporting Services, Analysis Servi

ces, Notification Services, etc.?ces, Notification Services, etc.?Can I customize the built-in scripts SQLDiag runs?Can I customize the built-in scripts SQLDiag runs?Can I run multiple instances of SQLDiag?Can I run multiple instances of SQLDiag?Is a 64-bit version available?Is a 64-bit version available?How do I troubleshoot problems with SQLDiag itself?How do I troubleshoot problems with SQLDiag itself?

Page 26: SQLDiag 를 이용한 SQL Server 2005   성능진단