블로그 이미지
LifeisSimple

calendar

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

Notice

2012. 8. 10. 13:52 Brain Trainning/DataBase

역시 가상화 환경으로 넘어가며 발생하는 오류들... 

IO쪽 오류가 많은 것 같은데... 이 녀석들은 VM Snapshot 등과도 관련이 있는 듯... 


SQL Server PVSCSI 어댑터를 사용 하도록 구성 된 VMware ESX 환경에 "운영 체제 오류 1117 (I/O 장치 오류)"을 보고

기술 자료: 2519834 - 이 문서가 적용되는 제품 보기.

현상

다음 사항을 고려 하십시오.
  • 게스트 OS로는 Windows Server 2008 또는 Windows Server 2008 R2 실행 중인 VMWare ESX 가상 컴퓨터의 경우
  • 게스트 VM Vmware에서 PVSCSI (Paravirtual SCSI) 어댑터를 사용 하도록 구성 했습니다. Paravirtual SCSI 구성 ESX 환경에서 PVSCSI.sys 드라이버를 사용 합니다.
이 환경에서 SQL Server 2008 또는 2008 R2 SQL Server의 인스턴스를 실행 하면 다음과 유사한 오류 메시지가 발생할 수 있습니다.

오류 메시지 1

오류: 17053, 심각도: 16, 상태: 1.

LogWriter: 시스템 오류가 발생 했습니다 (요청이 있는 I/O 장치 오류. 때문에 수행할 수 없습니다) 1117 작동 합니다.

로그 플러시 동안 쓰기 오류가 있습니다.


오류: 9001, 심각도: 21, 상태: 4.

'DBNAME' 데이터베이스의 로그를 사용할 수 없습니다.

spid51 오류: 9001, 심각도: 21, 상태: 4.

spid51 'DBNAME' 데이터베이스의 로그를 사용할 수 없습니다. 이벤트 로그에서 관련된 오류 메시지를 확인 합니다. 오류를 해결 하 고 데이터베이스를 다시 시작 합니다.



spid12s 오류: 9001, 심각도: 21, 상태: 4.

spid12s 'DBNAME' 데이터베이스의 로그를 사용할 수 없습니다. 이벤트 로그에서 관련된 오류 메시지를 확인 합니다. 오류를 해결 하 고 데이터베이스를 다시 시작 합니다.

spid51 데이터베이스 DBNAME 9001 루틴 'XdesRMFull::Commit' 오류 때문에 종료 되었습니다. 모든 데이터베이스 연결이 중단 된 후 데이터베이스 스냅샷 시도 됩니다에 대 한 다시 시작 합니다.

오류 메시지 2

오류: 823, 심각도: 24, 상태: 3.

운영 체제가 오프셋 0x000000b5940000에 대 한 쓰기 중 오류 1117 (요청을 수행할 수 없습니다는 I/O 장치 오류. 때문에) SQL Server 파일에서 반환 ' H:\MSSQL\DBNAME.MDF'. SQL Server 오류 로그와 시스템 이벤트 로그에 메시지를 추가로 자세한 내용을 제공할 수 있습니다. 이 데이터베이스 무결성을 위협 하 고 즉시 수정 해야 하는 심각한 시스템 수준의 오류 조건을 것입니다. 전체 데이터베이스 일관성 확인 (DBCC CHECKDB)를 완료 합니다. 이 오류는 여러 가지 요인에 의해 발생할 수 있습니다. 자세한 내용은 SQL Server 온라인 설명서를 참조 하십시오.



spid10s 오류: 18400, 심각도: 16, 상태: 1.

spid10s 백그라운드 검사점 스레드에서 복구할 수 없는 오류가 발생 했습니다. 스레드가 해당 리소스를 정리할 수 있도록 검사점 프로세스가 종료 됩니다. 이 정보 메시지입니다. 사용자 작업이 필요 하지 않습니다.


오류 메시지 3

spid13s 오류: 17053, 심각도: 16, 상태: 1.

spid13s ReadFileHdr: 1117 (요청을 수행할 수 없습니다는 I/O 장치 오류. 때문에) 운영 체제 오류가 발생 했습니다.

오류 spid13s: 5159, 심각도: 24, 상태: 3.

파일 "H:\MSSQL\DBNAME_log spid13s 운영 체제 오류 1117 (요청이 있는 I/O 장치 오류. 때문에 수행할 수 없습니다).LDF "동안 Readfilehdr입니다.

또한 문제 발생 및 없음 관찰 패턴이 나 추세를 따릅니다. 때때로 SQL Server 트랜잭션 로그 플러시 작업의 일부로 I/O 요청을 보낼 때 위의 I/O 오류가 발생할 수 있습니다. 해당 작업의 실패 데이터베이스 복구 프로세스를 시작 하 고 오프 라인으로 데이터베이스를 만들 수 있습니다.

해결 방법

이 문제를 해결 하려면 VMware 기술 자료의 다음 문서에서 설명 하는 단계를 따르는 것이 좋습니다.

PVSCSI를 사용 하는 방법에 대 한 자세한 내용은 VMware 기술 자료의 다음 문서를 참조 하십시오.

SQL 오류 메시지 823 SQL Server I/O 프로세스에 대 한 자세한 내용은 Microsoft 기술 자료의 다음 문서 번호를 클릭 합니다.
828339 823 오류 메시지 SQL Server 시스템 문제 또는 하드웨어 문제를 나타낼 수 있습니다.

추가 정보

참고 "현상" 절에서 설명 하는 오류는 다른 원인 때문일. 현재 문서의 OS 오류 1117 오류 메시지의 경우에 적합 합니다.

VMWare이 이번 paravirtual SCSI 어댑터를 사용 하면 다음 VMWare ESX 버전 바뀌었는지 확인 합니다.
  • ESX/ESXi 4.0 U1
  • ESX/ESXi 4.1
  • ESXi 5.0
이 문제와 관련된 된 패치에 대 한 자세한 내용은, VMWare 기술 자료 문서 2004578 해결 방법 절에 지정 된 참조 하십시오.이 문제를 완화 하기 위해 VMware 지원으로 작동 하도록 하는 것이 좋습니다.

다음 표에서 제품이 나이 SQL Server 인스턴스 및 버전에 대해 규칙이 평가 되는 SQL Server 제품의이 상태를 자동으로 확인 하는 도구에 대 한 자세한 정보를 제공 합니다.
규칙 소프트웨어규칙 제목규칙 설명규칙 평가 기준이 제품 버전
시스템 센터 관리자가상 컴퓨터 SCSI 구성 SQL Server 대 한 안정성 문제가 발생할 수 있습니다.시스템 센터 관리자 SQL Server VMware 가상 VMware PVSCSI 컨트롤러를 사용 하도록 구성 된 플랫폼에서 실행 되 고 있는지 확인 합니다. 문제를 해결 하려면이 문서에서 참조 하는 VMWare 문서에서 지침을 따릅니다.SQL Server 2008
2008 R2 SQL Server
SQL Server 2012



Microsoft의 현재 보기를 게시 날짜를 기준으로이 문제에 대 정보 및 솔루션에서이 문서를 나타냅니다. 이 방법은 Microsoft 또는 타사 공급자를 통해 사용할 수 있습니다. 모든 타사 공급자나 타사 솔루션이이 문서를 설명 하는 Microsoft 특별히 권장 하지 않습니다. 수 또한 있을 다른 타사 공급자나 타사 솔루션이이 문서에서 설명 하지 않습니다. Microsoft는 변화 하는 시장 환경에 대처 해야 하므로이 정보는 약정으로 Microsoft에서 해석 해서는 안. Microsoft 없습니다 보장 또는 모든 정보 또는 Microsoft 또는 모든 언급 한 타사 공급자에 의해 제공 되는 솔루션의 정확성을 보증 합니다. 

Microsoft 어떠한 보증도 및 표현, 보증 및 조건을 명시적, 묵시적 또는 법정 여부를 제외 합니다. 이러한 포함 되어 있지만 표현, 보증, 또는 조건을 제목, 비침해, 만족 스러운 조건, 상품성, 및, 모든 서비스, 솔루션, 제품 또는 다른 자료 또는 정보를 관련 하 여 특정 목적에 적합성에 국한 되지는지 않습니다. 어떠한 경우에 Microsoft는이 문서에 언급 된 타사 솔루션을 지지 것입니다.

속성

기술 자료: 2519834 - 마지막 검토: 2012년 4월 19일 목요일 - 수정: 1.0
본 문서의 정보는 다음의 제품에 적용됩니다.
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 R2 Datacenter
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Standard
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 Developer
키워드: 
kbmt KB2519834 KbMtko
기계 번역된 문서
중요: 본 문서는 전문 번역가가 번역한 것이 아니라 Microsoft 기계 번역 소프트웨어로 번역한 것입니다. Microsoft는 번역가가 번역한 문서 및 기계 번역된 문서를 모두 제공하므로 Microsoft 기술 자료에 있는 모든 문서를 한글로 접할 수 있습니다. 그러나 기계 번역 문서가 항상 완벽한 것은 아닙니다. 따라서 기계 번역 문서에는 마치 외국인이 한국어로 말할 때 실수를 하는 것처럼 어휘, 구문 또는 문법에 오류가 있을 수 있습니다. Microsoft는 내용상의 오역 또는 Microsoft 고객이 이러한 오역을 사용함으로써 발생하는 부 정확성, 오류 또는 손해에 대해 책임을 지지 않습니다. Microsoft는 이러한 문제를 해결하기 위해 기계 번역 소프트웨어를 자주 업데이트하고 있습니다.
이 문서의 영문 버전 보기:2519834

posted by LifeisSimple
2012. 8. 10. 12:04 Brain Trainning/DataBase

요즘... VMWare로 시퀄을 운영하면서 다양한 오류를 접한다... (참고)


http://www.sql-server-performance.com/forum/threads/troubleshooting-problem.9521/


Troubleshooting problem

Discussion in 'General DBA Questions' started by xiebo2010cxMay 14, 2007.

  1. xiebo2010cxNew Member


    SQL 2K EE SP4 on Windows 2k3 servers, here it is the errors found from errorlog when opening by text file.


    DB services and SQLAgent services are both on. when using EM to view, Database and Management folds showed no items.


    2007-05-11 14:31:10.42 spid3 LogWriter: Operating system error 21(The device is not ready.) encountered.
    2007-05-11 14:31:10.42 spid3 Write error during log flush. Shutting down server
    2007-05-11 14:31:30.42 spid52 Error: 9001, Severity: 21, State: 1
    2007-05-11 14:31:30.42 spid52 The log for database 'tempdb' is not available..
    2007-05-11 14:31:50.52 spid52 Error: 9001, Severity: 21, State: 1
    2007-05-11 14:31:50.52 spid52 The log for database 'tempdb' is not available..
    2007-05-11 14:32:10.53 spid52 Error: 9001, Severity: 21, State: 1
    2007-05-11 14:32:10.53 spid52 The log for database 'tempdb' is not available..
    2007-05-11 14:32:30.55 spid52 Error: 9001, Severity: 21, State: 1
    2007-05-11 14:32:30.55 spid52 The log for database 'tempdb' is not available..
    2007-05-11 14:32:50.56 spid52 Error: 9001, Severity: 21, State: 1
    2007-05-11 14:32:50.56 spid52 The log for database 'tempdb' is not available..

    ------------------
    Bug explorer/finder/seeker/locator
    ------------------
  2. xiebo2010cxNew Member

    it seems all the drives have enough disk space ( more than 40GB free space)

    ------------------
    Bug explorer/finder/seeker/locator
    ------------------
  3. xiebo2010cxNew Member

    My another server had the similar problem.

    2007-05-09 11:48:11.84 spid1 SQL Server has encountered 1 occurrence(s) of IO requests taking longer than 15 seconds to complete on file [g:mssqldata emdb.ldf] in database [tempdb] (2). The OS file handle is 0x000004D0. The offset of the latest long IO is: 0x00000001af7c00
    2007-05-09 11:48:22.64 spid2 LogWriter: Operating system error 1167(The device is not connected.) encountered.
    2007-05-09 11:48:22.64 spid2 Write error during log flush. Shutting down server
    2007-05-09 11:48:28.42 spid54 Error: 9001, Severity: 21, State: 1
    2007-05-09 11:48:28.42 spid54 The log for database 'tempdb' is not available..
    2007-05-09 11:48:44.59 logon Login succeeded for user 'TEST'. Connection: Trusted.
    2007-05-09 11:48:48.62 spid54 Error: 9001, Severity: 21, State: 1
    2007-05-09 11:48:48.62 spid54 The log for database 'tempdb' is not available..
    2007-05-09 11:48:52.66 logon Login succeeded for user 'TEST'. Connection: Trusted.


    ------------------
    Bug explorer/finder/seeker/locator
    ------------------
  4. MohammedUNew Member

    Looks like there is a Hard Ware/access related issue, make sure all disk are available and sql can access them...

    Error clearly stats that log file is not available for tempdb means you are totally done....

    Also take a look to the following article...... 

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;838765


    MohammedU.
    Moderator
    SQL-Server-Performance.com

    All postings are provided “AS IS” with no warranties for accuracy.
  5. satyaModerator

    Even though the drive has enough space the processess demanding more log space on TEMPDB and amount of time SQL is taking to increase the size is the main issue. So you have to limit the number of processess or perform in smaller batches to ensure the TEMPDB log can cope up the pressure, it is also a good thing to configure the TEMPDB accordingly.

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.

posted by LifeisSimple
2012. 6. 19. 09:17 Brain Trainning/DataBase

Database Backup 에 써드파티 툴을 사용할때 다음과 같은 문제가 발생할 수 있습니다. 

이때는 몇가지 조치 방법이 있는데...


BackupMedium::ReportIoError: 백업 장치 ' D:\Backup\ DBDB.BAK'에서 write 오류가 발생했습니다. 운영 체제 오류 = 1784(제공된 사용자 버퍼가 요청된 작업에 적합하지 않습니다.).

Internal I/O request 0x5DDAABE8: Op: Write, pBuffer: 0x07DA0000, Size: 983040, Position: 5664283136, UMS: Internal: 0xC00000E8, InternalHigh: 0x0, Offset: 0x519E1A00, OffsetHigh: 0x1, m_buf: 0x07DA0000, m_len: 983040, m_ac

tualBytes: 0, m_errcode: 1784, BackupFile: D:\Backup\ DBDB.BAK

BACKUP failed to complete the command BACKUP DATABASE [DBDB] TO [bkstorms] WITH  INIT ,  NOUNLOAD ,  NAME = N' DBDB  backup',  NOSKIP ,  STATS = 10,  NOFORMAT 

2012-06-18 23:03:20.70 spid55    Database  DBDB : IO is frozen for snapshot

2012-06-18 23:03:25.98 spid62    Database  DBDB : IO is thawed


1. sqlvdi.dll 파일을 다시 Registry 등록하는 방법이 있고요


2. 두번째는 SQL Backup Simulator 를 사용해 보는 방법이 있습니다. 


SQL Server Backup Simulator

RATE THIS

We at SQL Server support team, continue to invest our time in writing tools and utilities which can aid you in troubleshooting SQL Server issues. SQL Server Backup Simulator is one such tool which will help you while troubleshooting issues in taking backup of SQL Server using 3rd party utilities like IBM Tivoli, Symantec BackupExec, Quest Litespeed, Redgate SQL Backup etc., which use sqlvdi.dll to communicate to SQL Server.

Let me tell you the thought process of bringing this tool to you all. We have been shipping simple.exe along with SQL Server samples which you can use to test backup of SQL Server databases using VDI but there is no tool available for you to troubleshoot VDI backup/restore issues. So necessity of such a tool was mother of the need for coding SQL Server Backup Simulator.

This tool does nothing magical, all it does is perform validation of the SQLVDI infrastructure and takes a sample backup to verify if everything from a SQLVDI perspective is working correctly for a 3rd party backup application to perform a VDI backup of a SQL database.

Steps to perform validation:

Launch this application using the service account credentials of the 3rd Party backup restore application so that we can perform validation and test backup/restore using those security credentials.

Once you launch the application, it reads all local SQL Server instances and gives you a choice to select one to perform validation:

 

Once you select the instance and hit “Validate VDI installation” it performs these steps:

1. Read the Operating System architecture

2. Read the SQL Server installation architecture

3. Read SQL Server build

4. Verify whether the login connected to SQL Server has sysadmin privilege

5. Read sqlvdi.dll loaded into SQL Server memory

6. Read version information about sqlvdi.dll located in %PROGRAMFILES% & %PROGRAMFILES86%

7. Verify whether the build numbers of all these dll’s are matching

You might be wondering as why we do these checks. Based on the history of issues we have seen, there are many different errors occur during SQLVDI backup/restore but the root cause would be that sysadmin permission is missing or version of sqlvdi.dll loaded into SQL Server is different from what client application is using etc.,.

So this GUI tool will help users determine whether the SQLVDI.DLL is functioning correctly and where you need to concentrate your troubleshooting efforts in case of SQL backup/restore operations are failing due to VDI errors.

Steps to perform Backup:

Once you complete the validation, switch to the Simulate window and select Backup or Restore and then select the database from the pre-loaded list.

Select the folder location where SQL Server Backup Simulator can store/read the backup file “SQLBackupSim.bak” (This file name is hardcoded)

Before clicking Start, you can enable the checkbox “Use 64-bit Process” to use 64-bit client exe to connect to SQL Server which loads 64-bit sqlvdi.dll. If you don’t enable this checkbox, we connect to SQL Server using 32-bit client exe which will load 32-bit sqlvdi.dll.

Here is a screenshot of Backup/Restore simulation:

 

 

We don’t guarantee that all your sqlvdi issues can be resolved using this tool but what we can assure you is that this tool will provide a value-add in troubleshooting sqlvdi backup/restore failures because if backup/restore works fine with this tool, they you can focus on the backup application code which is reporting the failure.

Known Issues:

1. Backup path should not contain blank spaces.

2. Application crashes when attempting to take a backup of a SQL instance running in WOW (32-bit SQL on 64-bit server) using the 32-bit version of SQLVDI.DLL

Upcoming Features:

We are planning to provide compression features etc.., in the next release of this tool.

Download location:

Please feel free to download this tool and post your comments/feedbacks/questions/issues at http://code.msdn.microsoft.com/sqlbackupsim

To know more about VDI, download 'SQL Server 2005 Virtual Backup Device Interface (VDI) Specification' from http://www.microsoft.com/downloads/details.aspx?familyid=416f8a51-65a3-4e8e-a4c8-adfe15e850fc&displaylang=en

 

Regards, 
Sakthivel Chidambaram 
SE, Microsoft SQL Server Support

Reviewed by, 
Amit Banerjee 
SEE, Microsoft SQL Server Support

posted by LifeisSimple
2012. 6. 12. 17:36 Brain Trainning/DataBase

Creating a merged (slipstreamed) drop containing SQL Server 2008 RTM + Service Pack 1

[Updated on April 7th, along with the availability of SQL Server 2008 SP1]

Today, I am going to show you how to create new source media that will slipstream the original source media and SQL Server 2008 Service Pack 1. Once you have created this drop, you can install SQL Server 2008 SP1 in a single step! These instructions are included with the Service Pack 1 release but there are some issues with the documentation that will be addressed in the next revision of the on-line documentation. There is not a lot of user interface that indicates you are slipstreaming, but there are a few clues, see at the bottom for screen shots.

These steps will take a little longer to perform than the steps for the basic slipstream describe here, but once completed you will be able to run a slipstream installation from the same location. It is recommended you verify you can complete a slipstream installation from the new drop on a test machine before deploying into production.

These instructions are for English SQL Server but will work with any language of SQL Server if you obtain the correct service package language.

1. Copy your original SQL Server 2008 source media to c:\SQLServer2008_FullSP1

2. Download Service Pack 1 from http://www.microsoft.com/downloads/details.aspx?FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19. The three architectures of Service Pack 1 should be included, the package names are as follows:

  • SQLServer2008SP1-KB968369-IA64-ENU.exe
  • SQLServer2008SP1-KB968369-x64-ENU.exe
  • SQLServer2008SP1-KB968369-x86-ENU.exe

3. Extract the packages as follows:

  • SQLServer2008SP1-KB968369-IA64-ENU.exe /x:c:\SQLServer2008_FullSP1\PCU
  • SQLServer2008SP1-KB968369-x64-ENU.exe /x:c:\SQLServer2008_FullSP1\PCU
  • SQLServer2008SP1-KB968369-x86-ENU.exe /x:c:\SQLServer2008_FullSP1\PCU

Ensure you complete this step for all architectures to ensure the original media is updated correctly.

4. Copy Setup.exe and Setup.rll from the PCU extracted location to original source media location

  • robocopy C:\SQLServer2008_FullSP1\PCU c:\SQLServer2008_FullSP1 Setup.exe
  • robocopy C:\SQLServer2008_FullSP1\PCU c:\SQLServer2008_FullSP1 Setup.rll

5. Copy all files not the folders, except the Microsoft.SQL.Chainer.PackageData.dll, in c:\SQLServer2008_FullSP1\PCU\<architecture> to C:\SQLServer2008_FullSP1 \<architecture> to update the original files.

  • robocopy C:\SQLServer2008_FullSP1\pcu\x86 C:\SQLServer2008_FullSP1\x86 /XF Microsoft.SQL.Chainer.PackageData.dll
  • robocopy C:\SQLServer2008_FullSP1\pcu\x64 C:\SQLServer2008_FullSP1\x64 /XF Microsoft.SQL.Chainer.PackageData.dll
  • robocopy C:\SQLServer2008_FullSP1\pcu\ia64 C:\SQLServer2008_FullSP1\ia64 /XF Microsoft.SQL.Chainer.PackageData.dll

NOTE: if you accidentally copy the Microsoft.SQL.Chainer.PackageData.dll file, you may see this error when you launch Setup.exe. If this happens, restore  Microsoft.SQL.Chainer.PackageData.dll back to the original version.

clip_image002

6. Determine if you have a defaultsetup.ini at the following locations:

  • C:\SQLServer2008_FullSP1\x86
  • C:\SQLServer2008_FullSP1\x64
  • C:\SQLServer2008_FullSP1\ia64

If you have a defaultsetup.ini, add PCUSOURCE="{Full path}\PCU".

NOTE: The {Full path} needs to be the absolute path to the PCU folder. If you will just be running from local folder it would be C:\SQLServer2008_FullSP1. If you will eventually share this folder out, {Full path} would be \\MyServer\SQLServer2008_FullSP1.

See question #11 here if you would like to use a relative path.

     ;SQLSERVER2008 Configuration File

     [SQLSERVER2008]

     ...

     PCUSOURCE="{Full path}\PCU"

If you do NOT have a defaultsetup.ini, create one with the following content:

    ;SQLSERVER2008 Configuration File

    [SQLSERVER2008]

    PCUSOURCE="{full path}\PCU"

  and copy to the following locations

  • C:\SQLServer2008_FullSP1\x86
  • C:\SQLServer2008_FullSP1\x64
  • C:\SQLServer2008_FullSP1\ia64

      This file will tell the setup program where to locate the SP1 source media that you extracted in step 3.

7. Now run setup.exe as you normally would.

       

How can I tell I am slipstreaming?

1) You should see the "Update Setup Media Language Rule" on the Installation Rules dialog:

 InstallationRules

2) You should see the Action indicate it is being slipstreamed and the Slipstream node should be shown:

ReadyToInstall

3) You should see the PCUSource being specified in the Summary log:

Summary

 

4) After installing, if you run the "SQL Server features discovery report" off of the Installation Center you will see the following versions:

image

posted by LifeisSimple
2012. 6. 12. 10:42 Brain Trainning/DataBase

Download Service Pack 1 for Microsoft® SQL Server® 2008 R2

Quick details

Version:10.50.2500.0Date published:7/11/2011

Files in this download

The links in this section correspond to files available for this download. Download the files appropriate for you.

File nameSize
SQLManagementStudio_x64_ENU.exe155.9 MBDOWNLOAD
SQLManagementStudio_x86_ENU.exe153.1 MBDOWNLOAD
SQLServer2008R2SP1-KB2528583-IA64-ENU.exe296.5 MBDOWNLOAD
SQLServer2008R2SP1-KB2528583-x64-ENU.exe309.0 MBDOWNLOAD
SQLServer2008R2SP1-KB2528583-x86-ENU.exe201.1 MBDOWNLOAD


Microsoft® SQL Server® 2008 R2 서비스 팩 1 다운로드

간단 정보

버전:10.50.2500.0게시 날짜:2011-07-11

이 다운로드의 파일

이 섹션의 링크는 다운로드에 포함된 파일로 연결됩니다. 적절한 파일을 다운로드하십시오.

파일 이름크기
SQLManagementStudio_x64_KOR.exe178.0 MB다운로드
SQLManagementStudio_x86_KOR.exe175.3 MB다운로드
SQLServer2008R2SP1-KB2528583-IA64-KOR.exe300.4 MB다운로드
SQLServer2008R2SP1-KB2528583-x64-KOR.exe314.8 MB다운로드
SQLServer2008R2SP1-KB2528583-x86-KOR.exe206.3 MB다운로드

posted by LifeisSimple
2012. 5. 2. 22:01 Brain Trainning/DataBase


PAGEIOLATCH 리소스 조회 쿼리입니다.

Wait type을 변경하면 다른 리소스에 대한 것들도 조회가 가능합니다.

/*

           resource_description 컬럼

                     database_id:file_id:page_id 로구분되어짐.

*/

 

-- 현재PAGELATCH Wait를구함

select session_id, wait_type, resource_description

from sys.dm_os_waiting_tasks

where wait_type like 'PAGELATCH%'

 

-- PAGELATCHResource 상세정보를구함

select wt.session_id, wt.wait_type, wt.wait_duration_ms

, s.name as schema_name

, o.name as object_name

, i.name as index_name

from sys.dm_os_buffer_descriptors bd

join (

           select *

           , CHARINDEX(':', resource_description) as file_index

           , CHARINDEX(':', resource_description, charindex(':', resource_description)) as page_index

           , resource_description as rd

           from sys.dm_os_waiting_tasks wt

           where wait_type like 'PAGELATCH%'

           ) as wt

on bd.database_id = SUBSTRING(wt.rd, 0, wt.file_index) and bd.file_id = SUBSTRING(wt.rd, wt.file_index, wt.page_index)

and bd.page_id = SUBSTRING(wt.rd, wt.page_index, len(wt.rd))

join sys.allocation_units au on bd.allocation_unit_id = au.allocation_unit_id

join sys.partitions p on au.container_id = p.partition_id

join sys.indexes i on p.index_id = i.index_id and p.object_id = i.object_id

join sys.objects o on i.object_id = o.object_id

join sys.schemas s on o.schema_id = s.schema_id

posted by LifeisSimple
2012. 4. 26. 11:02 Brain Trainning/DataBase

데이터베이스별 버퍼 사용량을 측정할 수 있습니다. 


아래의 스크립트를 참조하시면 됩니다. 



SELECT [Database Name], sum([Page Count])

FROM (

SELECT

   (CASE WHEN ([is_modified] = 1) THEN 'Dirty' ELSE 'Clean' END) AS 'Page State',

   (CASE WHEN ([database_id] = 32767) THEN 'Resource Database' ELSE DB_NAME (database_id) END) AS 'Database Name',

   COUNT (*) AS 'Page Count'

FROM sys.dm_os_buffer_descriptors

WHERE database_id between 5 and 1000

GROUP BY [database_id], [is_modified]

) as K

GROUP BY [Database Name]

ORDER BY [Database Name]


아주 가끔씩 필요해지는 것들이 생기네요... 


흠... 

posted by LifeisSimple
2012. 4. 5. 19:19 Brain Trainning/DataBase

대기 상태에 대한 글입니다. 

간단히 읽어보면 도움이 많이 됩니다. 


출처 : http://www.sqlskills.com/BLOGS/PAUL/post/Wait-statistics-or-please-tell-me-where-it-hurts.aspx

(Be sure to join our community to get our monthly newsletter with exclusive content, advance notice of classes with discount codes, and other SQL Server goodies!)  

How many times have you walked up to a SQL Server that has a performance problem and wondered where to start looking? 

One of the most under-utilized performance troubleshooting methodologies in the SQL Server world is one called "waits and queues" (also known simply as "wait stats"). The basic premise is that SQL Server is permanently tracking why execution threads have to wait. You can ask SQL Server for this information and then use the results to narrow down where to start digging to unearth the cause of performance issues. The "waits" are what SQL Server tracks. The "queues" are the resources that the threads are waiting for. There are a myriad of waits in the system and they all indicate different resources being waited for. For example, a PAGEIOLATCH_EX wait means a thread is waiting for a data page to be read into the buffer pool from disk. A LCK_M_X wait means a thread is waiting to be granted an exclusive lock on something.

The great thing about all of this is the SQL Server *knows* where the performance issues are, and you just need to ask it.... and then interpret what it tells you, which can be a little tricky.

Now - where people sometimes get hung up is trying to track down every last wait and figure out what's causing it. Waits *always* occur. It's the way SQL Server's scheduling system works.

A thread is using the CPU (called RUNNING) until it needs to wait for a resource. It then moves to an unordered list of threads that areSUSPENDED. In the meantime, the next thread on the FIFO (first-in-first-out) queue of threads waiting for the CPU (called being RUNNABLE) is given the CPU and becomes RUNNING. If a thread on the SUSPENDED list is notified that it's resource is available, it becomes RUNNABLE and is put on the bottom of the RUNNABLE queue. Threads continue this clockwise movement from RUNNING to SUSPENDED to RUNNABLE to RUNNING again until the task is completed. You can see processes in these states using the sys.dm_exec_requests DMV. 

SQL Server keeps track of the time that elapses between leaving the RUNNING state and becoming RUNNING again (called the "wait time") and the time spent on the RUNNABLE queue (called the "signal wait time" - i.e. how long does the thread need to wait for the CPU after being signaled that its resource is available). We need to work out the time spent waiting on the SUSPENDED list (called the "resource wait time") by subtracting the signal wait time from the overall wait time.

Tom Davidson of Microsoft wrote a fantastic and very accessible whitepaper on "waits and queues" which I encourage you to read:Performance Tuning Using Waits and Queues. My good friend Joe Sack (blog|twitter) who runs the MCM program also published an excellent slide deck on the subject that you can download here. And of course Books Online has a section on the sys.dm_os_wait_stats DMVthat gives info on some of the newer wait types. PSS is putting together a repository of info on all the wait types but not much progress has been made. And there's a free video+demo recording as part of the MCM online training we recorded for Microsoft - see here.

You can ask SQL Server for the cumulative wait statistics using the sys.dm_os_wait_stats DMV, and many people prefer to wrap the DMV call in some aggregation code. I use code based on a query that I got from fellow-MVP Glenn Berry (blog|twitter) and then modified quite a bit. See below for the version updated to take account of the results discussed below:

WITH Waits AS
    (SELECT
        wait_type,
        wait_time_ms / 1000.0 AS WaitS,
        (wait_time_ms - signal_wait_time_ms) / 1000.0 AS ResourceS,
        signal_wait_time_ms / 1000.0 AS SignalS,
        waiting_tasks_count AS WaitCount,
        100.0 * wait_time_ms / SUM (wait_time_ms) OVER() AS Percentage,
        ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS RowNum
    FROM sys.dm_os_wait_stats
    WHERE wait_type NOT IN (
        'CLR_SEMAPHORE', 'LAZYWRITER_SLEEP', 'RESOURCE_QUEUE', 'SLEEP_TASK',
        'SLEEP_SYSTEMTASK', 'SQLTRACE_BUFFER_FLUSH', 'WAITFOR', 'LOGMGR_QUEUE',
        'CHECKPOINT_QUEUE', 'REQUEST_FOR_DEADLOCK_SEARCH', 'XE_TIMER_EVENT', 'BROKER_TO_FLUSH',
        'BROKER_TASK_STOP', 'CLR_MANUAL_EVENT', 'CLR_AUTO_EVENT', 'DISPATCHER_QUEUE_SEMAPHORE',
        'FT_IFTS_SCHEDULER_IDLE_WAIT', 'XE_DISPATCHER_WAIT', 'XE_DISPATCHER_JOIN', 'BROKER_EVENTHANDLER',
        'TRACEWRITE', 'FT_IFTSHC_MUTEX', 'SQLTRACE_INCREMENTAL_FLUSH_SLEEP',
        'BROKER_RECEIVE_WAITFOR', 'ONDEMAND_TASK_QUEUE', 'DBMIRROR_EVENTS_QUEUE',
        'DBMIRRORING_CMD', 'BROKER_TRANSMITTER', 'SQLTRACE_WAIT_ENTRIES',
        'SLEEP_BPOOL_FLUSH', 'SQLTRACE_LOCK')
    )
SELECT
    W1.wait_type AS WaitType, 
    CAST (W1.WaitS AS DECIMAL(14, 2)) AS Wait_S,
    CAST (W1.ResourceS AS DECIMAL(14, 2)) AS Resource_S,
    CAST (W1.SignalS AS DECIMAL(14, 2)) AS Signal_S,
    W1.WaitCount AS WaitCount,
    CAST (W1.Percentage AS DECIMAL(4, 2)) AS Percentage,
    CAST ((W1.WaitS / W1.WaitCount) AS DECIMAL (14, 4)) AS AvgWait_S,
    CAST ((W1.ResourceS / W1.WaitCount) AS DECIMAL (14, 4)) AS AvgRes_S,
    CAST ((W1.SignalS / W1.WaitCount) AS DECIMAL (14, 4)) AS AvgSig_S
FROM Waits AS W1
    INNER JOIN Waits AS W2 ON W2.RowNum <= W1.RowNum
GROUP BY W1.RowNum, W1.wait_type, W1.WaitS, W1.ResourceS, W1.SignalS, W1.WaitCount, W1.Percentage
HAVING SUM (W2.Percentage) - W1.Percentage < 95; -- percentage threshold
GO

This will show the waits grouped together as a percentage of all waits on the system, in decreasing order. The waits to be concerned about (potentially) are those at the top of the list as this represents the majority of where SQL Server is spending it's time waiting. You can see that a bunch of waits are being filtered out of consideration - as I said above, waits happen all the time and these are the benign ones we can usually ignore.

You can also reset the aggregated statistics using this code:

DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);

And of course you can very easily come up with a way to persist the results every few hours or every day and do some time-series analysis to figure out trends or automatically spot problems as they start to happen. You can also use Performance Dashboard to see these graphically in 2005 and Data Collector in 2008. On SQL Server 2000 you can use DBCC SQLPERF ('waitstats').

Once you get the results, you then start figuring out how to interpret them and where to go looking. The whitepaper I referenced above has a ton of good info on most of the wait types (except those added in 2008). There are various ways you can dig in deeper to this information that I'll go into in later posts.

I'm going to start blogging about wait stats analysis, either as standalone posts or as part of other things - and I've already done so in the last post (at time of writing this) in my benchmarking series.

For now, I want to report on the results of the wait stats survey I posted a couple of months back. I asked people to run the code above and let me know the results. I received results for a whopping 1823 SQL Servers out there - thank you!

Here's a graphical view of the results:

 

I'm not surprised at all by the top four results as I see these over and over on client systems.

For the remainder of this post, I'm going to list all the top wait types reported by survey respondents, in descending order, and give a few words about what they might mean if they are the most prevalent wait on your system. The list format shows the number of systems with that wait type as the most prevalent, and then the wait type.

  • 505: CXPACKET
    • This is commonly where a query is parallelized and the parallel threads are not given equal amounts of work to do, or one thread blocks. One thread may have a lot more to do than the others, and so the whole query is blocked while the long-running thread completes. If this is combined with a high number of PAGEIOLATCH_XX waits, it could be large parallel table scans going on because of incorrect non-clustered indexes, or out-of-date statistics causing a bad query plan. If neither of these are the issue, you might want to try setting MAXDOP to 4, 2, or 1 for the offending queries (or possibly the whole instance). Make sure that if you have a NUMA system that you try setting MAXDOP to the number of cores in a single NUMA node first to see if that helps the problem. You also need to consider the MAXDOP effect on a mixed-load system.
  • 304: PAGEIOLATCH_XX
    • This is where SQL Server is waiting for a data page to be read from disk into memory. It commonly indicates a bottleneck at the IO subsystem level, but could also indicate buffer pool pressure (i.e. not enough memory for the workload).
  • 275: ASYNC_NETWORK_IO
    • This is commonly where SQL Server is waiting for a client to finish consuming data. It could be that the client has asked for a very large amount of data or just that it's consuming it reeeeeally slowly because of poor programming.
  • 112: WRITELOG
    • This is the log management system waiting for a log flush to disk. It commonly indicates a problem with the IO subsystem where the log is, but on very high-volume systems it could also be caused by waiting for the LOGCACHE_ACCESS spinlock (which you can't do anything about). To be sure it's the IO subsystem, use the DMV sys.dm_io_virtual_file_stats to examine the IO latency for the log file.
  • 109: BROKER_RECEIVE_WAITFOR
    • This is just Service Broker waiting around for new messages to receive. I would add this to the list of waits to filter out and re-run the wait stats query. 
  • 086: MSQL_XP
    • This is SQL Server waiting for an extended stored-proc to finish. This could indicate a problem in your XP code. 
  • 074: OLEDB
    • As its name suggests, this is a wait for something communicating using OLEDB - e.g. a linked server. It could be that the linked server has a performance issue.
  • 054: BACKUPIO
    • This shows up when you're backing up directly to tape, which is slooooow. I'd be tempted to filter this out.
  • 041: LCK_M_XX
    • This is simply the thread waiting for a lock to be granted and indicates blocking problems. These could be caused by unwanted lock escalation or bad programming, but could also be from IOs taking a long time causing locks to be held for longer than usual. Look at the resource associated with the lock using the DMV sys.dm_os_waiting_tasks.
  • 032: ONDEMAND_TASK_QUEUE
    • This is normal and is part of the background task system (e.g. deferred drop, ghost cleanup).  I would add this to the list of waits to filter out and re-run the wait stats query.
  • 031: BACKUPBUFFER
    • This shows up when you're backing up directly to tape, which is slooooow. I'd be tempted to filter this out.
  • 027: IO_COMPLETION
    • This is SQL Server waiting for IOs to complete and is a sure indication of IO subsystem problems.
  • 024: SOS_SCHEDULER_YIELD
    • If this is a very high percentage of all waits (had to say, but Joe suggests 80%) then this is likely indicative of CPU pressure.
  • 022: DBMIRROR_EVENTS_QUEUE
  • 022: DBMIRRORING_CMD
    •  These two are database mirroring just sitting around waiting for something to do. I would add these to the list of waits to filter out and re-run the wait stats query.
  • 018: PAGELATCH_XX
    • This is contention for access to in-memory copies of pages. The most well-known cases of these are the PFS, SGAM, and GAM contention that can occur in tempdb under certain workloads. To find out what page the contention is on, you'll need to use the DMV sys.dm_os_waiting_tasks to figure out what page the latch is for. For tempdb issues, my friend Robert Davis (blog|twitter) has a good post showing how to do this. Another common cause I've seen is an index hot-spot with concurrent inserts into an index with an identity value key.
  • 016: LATCH_XX
    • This is contention for some non-page structure inside SQL Server - so not related to IO or data at all. These can be hard to figure out and you're going to be using the DMV sys.dm_os_latch_stats. More on this in future posts.
  • 013: PREEMPTIVE_OS_PIPEOPS
    • This is SQL Server switching to pre-emptive scheduling mode to call out to Windows for something. These were added for 2008 and haven't been documented yet (anywhere) so I don't know exactly what it means.
  • 013: THREADPOOL
    • This says that there aren't enough worker threads on the system to satisfy demand. You might consider raising the max worker threads setting.
  • 009: BROKER_TRANSMITTER
    • This is just Service Broker waiting around for new messages to send. I would add this to the list of waits to filter out and re-run the wait stats query. 
  • 006: SQLTRACE_WAIT_ENTRIES
    • Part of SQL Trace. I would add this to the list of waits to filter out and re-run the wait stats query.
  • 005: DBMIRROR_DBM_MUTEX
    •  This one is undocumented and is contention for the send buffer that database mirroring shares between all the mirroring sessions on a server. It could indicate that you've got too many mirroring sessions.
  • 005: RESOURCE_SEMAPHORE
    • This is queries waiting for execution memory (the memory used to process the query operators - like a sort). This could be memory pressure or a very high concurrent workload. 
  • 003: PREEMPTIVE_OS_AUTHENTICATIONOPS
  • 003: PREEMPTIVE_OS_GENERICOPS
    • These are SQL Server switching to pre-emptive scheduling mode to call out to Windows for something. These were added for 2008 and haven't been documented yet (anywhere) so I don't know exactly what it means.
  • 003: SLEEP_BPOOL_FLUSH
    • This is normal to see and indicates that checkpoint is throttling itself to avoid overloading the IO subsystem. I would add this to the list of waits to filter out and re-run the wait stats query.
  • 002: MSQL_DQ
    • This is SQL Server waiting for a distributed query to finish. This could indicate a problem with the distributed query, or it could just be normal.
  • 002: RESOURCE_SEMAPHORE_QUERY_COMPILE
    • When there are too many concurrent query compilations going on, SQL Server will throttle them. I don't remember the threshold, but this can indicate excessive recompilation, or maybe single-use plans.
  • 001: DAC_INIT
    • I've never seen this one before and BOL says it's because the dedicated admin connection is initializing. I can't see how this is the most common wait on someone's system... 
  • 001: MSSEARCH
    • This is normal to see for full-text operations.  If this is the highest wait, it could mean your system is spending most of its time doing full-text queries. You might want to consider adding this to the filter list. 
  • 001: PREEMPTIVE_OS_FILEOPS
  • 001: PREEMPTIVE_OS_LIBRARYOPS
  • 001: PREEMPTIVE_OS_LOOKUPACCOUNTSID
  • 001: PREEMPTIVE_OS_QUERYREGISTRY
    • These are SQL Server switching to pre-emptive scheduling mode to call out to Windows for something. These were added for 2008 and haven't been documented yet (anywhere) so I don't know exactly what it means. 
  • 001: SQLTRACE_LOCK
    • Part of SQL Trace. I would add this to the list of waits to filter out and re-run the wait stats query.

I hope you found this interesting! Let me know if there's anything in particular you're interested in seeing or just that you're following along and enjoying the ride!

posted by LifeisSimple
2012. 4. 4. 12:53 Brain Trainning/DataBase

대기 정보 분석을 위한 Best Reference 페이지들 입니다.

Performance_Tuning_Waits_Queues.doc


1. SQL Server Best Practices Article 

 - http://msdn.microsoft.com/en-us/library/cc966413.aspx

2. Performance Tuning With Wait Statistics 

 - http://blogs.msdn.com/joesack/archive/2009/04/22/presentation-deck-for-performance-tuning-with-wait-statistics.aspx

3. Wait statistics, or please tell me where it hurts

 - http://www.sqlskills.com/BLOGS/PAUL/post/Wait-statistics-or-please-tell-me-where-it-hurts.aspx

4. The SQL Server Wait Type Repository ..

 - http://blogs.msdn.com/b/passsql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx

5. Great Resource on SQL Server Wait Types

 - http://sqlserverperformance.wordpress.com/2009/12/21/great-resource-on-sql-server-wait-types

6. Tracking Session and Statement Level Waits

 - http://sqlblog.com/blogs/jonathankehayias/archive/2010/12/30/an-xevent-a-day-30-of-31-tracking-session-and-statement-levelwaits.aspx

7. Wait Stats Introductory References

 - http://blogs.msdn.com/b/jimmymay/archive/2009/04/26/wait-stats-introductory-references.aspx

8. Performance Blog

 - http://sqldoctor.idera.com/tag/wait-stats/



posted by LifeisSimple
2012. 4. 3. 22:48 Brain Trainning/DataBase


Database 파일들의 정보를 조회하는 스크립트 입니다. 

대충 대충 필요하겠다 싶은것을 정리했습니다. 

/*

           Database file 별상태점검

                     - by Koon

*/

create proc dbo.DBA_GetDBFilesInfo

as

 

set nocount on

 

if exists (select top 1 * from sys.tables where name = 'DBA_DBFileInfo')

           truncate table DBA_DBFileInfo

else

           create table DBA_DBFileInfo (db_name nvarchar(100), db_id int, file_id int, type_desc nvarchar(60), data_space_id int, name sysname, physical_name nvarchar(260),  state_desc nvarchar(60), size int, max_size int, growth int, is_percent_growth bit)

 

insert into  DBA_DBFileInfo (db_name , db_id, file_id, type_desc, data_space_id, name, physical_name,  state_desc, size, max_size, growth, is_percent_growth)

exec sp_msforeachdb 'use ?; select db_name(), db_id(), file_id, type_desc, data_space_id, name, physical_name,  state_desc, size, max_size, growth, is_percent_growth from sys.database_files'

 

select a.db_id, a.db_name, a.file_id, a.name, a.physical_name, state_desc, convert(varchar(20), (a.size * 8 / 1024)) + 'MB' as file_size, -- (BytesOnDisk / 1024 / 1024)  as used_size,

           max_size, (case when is_percent_growth = 1 then convert(varchar(3), a.growth) + '%' else convert(varchar(20), (a.growth * 8) / 1024) + 'MB' end) as file_growth,

           convert(decimal(13, 2), (NumberReads * 1.00 / (NumberReads + NumberWrites * 1.00)) * 100) as ReadsPercent,

           convert(decimal(13, 2), (NumberWrites * 1.00 / (NumberReads + NumberWrites * 1.00)) * 100) as WritesPercent,

           NumberReads, (BytesRead / 1024 / 1024) as MBytesRead, (IoStallReadMS / 1000) as IoStallReadSec,

           NumberWrites, (BytesWritten / 1024 / 1024) as MBytesWritten, (IoStallWriteMS / 1000) as IoStallWriteSec

from DBA_DBFileInfo a

           cross apply sys.fn_virtualfilestats(a.db_id, a.file_id)

order by a.db_id, a.file_id

posted by LifeisSimple