본문 바로가기

Server Story..../MSSQL

래치 소개 Latch http://ko.sunningview.com/article/5325 퍼옴. 메모리 구조를 보장하기 위해 래치 래치 일관성 경량 동기화 메커니즘 SQL Server 엔진은 무엇입니까. 이러한 인덱스, 데이터 페이지 (예 : 비 잎 수준 인덱스 페이지 등) 내부 구조 등. Y N Y Y Y N N Y Y N N N Y N N N N N N N N은 N & LT/div> 래치 경합에 미치는 영향 요인 요소 SLEEP_TASK 논리적 CPU 어떤 멀티 코어의 과도한 사용을 고백 래치 경합 시스템이 나타납니다. 래치 경합은 시스템의 허용 수준, 사용 16 이상의 코어의 대부분을 초과합니다. 건축 설계 및 액세스 모드 크기 B 트리 깊이, 인덱스, 밀도 및 페이지 디자인, 데이터 액세스 .. 더보기
Error: 7886, Severity: 20, State: 1 A read operation on a large object failed while sending data to the client. A common cause for this is if the application is running in READ UNCOMMITTED isolation level. This connection will be terminated. Error: 7886, Severity: 20, State: 1 A read operation on a large object failed while sending data to the client. A common cause for this is if the application is running in READ UNCOMMITTED isolation level. This connection will be terminated. 1. SQL Error Log 발생한 에러 2012-11-27 17:16:55.590 spid3477 Error: 7886, Severity: 20, State: 1.2012-11-27 17:16:55.590 spid3477 A read operation on a large ob.. 더보기
mssql error code 17806 2009-11-22 03:20:39.810 로그온 오류: 17806, 심각도: 20, 상태: 2.2009-11-22 03:20:39.810 로그온 SSPI handshake failed with error code 0x80090311 while establishing a connection with integrated security; the connection has been closed. [클라이언트: IP] 배포자에서 위와 같은 에러네트워크 문제로Active Directory서버(Domain Controller라 부름)와의 통신상에 문제가 발생하였을 경우 생성됨 더보기
SQL서버 성능카운터 활용을 위한 팁 SQL서버 성능카운터 활용을 위한 팁 원문링크 : http://www.sql-server-performance.com/performance_monitor_counters_sql_server.asp번역 : 김종균 (jkkim@techdata.co.kr) SQL서버에서 과도한 I/O의 원인 중 하나는 페이지 분할 입니다. 페이지 split은 인덱스나 데이터 페이지가 꽉 찰 경우에 발생하며, 현재 페이지와 새로이 할당되는 페이지 사이에서 분할이 이루어 집니다. 가끔 발생하는 페이지 분할은 정상입니다만, 과도한 페이지 분할은 과도한 디스크 I/O를 유발하게 되며, 이는 느린 성능을 야기합니다.SQL서버가 과도한 페이지 분할을 일으키고 있는지를 찾기 원한다면 성능카운터에서 SQL Server Access Meth.. 더보기
mssql 최적화 http://yoonsy.tistory.com/29 여기 참고, 동적 awe 관련 참고. http://ddoung2.tistory.com/244 http://technet.microsoft.com/ko-kr/library/ms190730(v=sql.105).aspx 더보기
alter database 데이터 베이스 파일 증가 제한하기 ALTER DATABASE [test] MODIFY FILE ( NAME = N'test_log', MAXSIZE = 10240000KB )GO 더보기
2008 에서 mdf 만으로 복구하고자 할때. mssql 서버 사용시. ldf 파일 을 분실 혹은 사용하지 못할경우, 2005 2008 에서 복원 방법. -- 기존 데이터 베이스에서 mdf 파일을 다른곳을 보관, -- 기존 데이터 베이스 삭제. -- 기존 데이터 베이스와 동일한 이름으로 데이터 베이스 생성, -- 해당 데이터 베이스 긴급장애 모드로 변경 한뒤 싱글 모드로 변경, ALTER DATABASE recovery_test_2 SET EMERGENCY; ALTER DATABASE recovery_test_2 SET SINGLE_USER; 새로 생성된 mdf 파일과 ldf 파일삭제후 동일한 위치에 기존 백업해둔 mdf 파일을 복사.** 이때 sql 서비스를 정지해야 할필요도 있다. -- 다시 sql 을 올려보면, 문제가 있고 테이블도 안되고 그럴.. 더보기
mssql error 로그 확인 하기. sp_readerrorlog 명령어이다. 해당 명령어 프로시져는 아래와 같이 되어 있으며, 각 하위 옵션은 아래내용확인 바란다. 1234567891011121314151617CREATE PROC [sys].[sp_readerrorlog]( @p1 INT = 0, @p2 INT = NULL, @p3 VARCHAR(255) = NULL, @p4 VARCHAR(255) = NULL) ASBEGIN IF (NOT IS_SRVROLEMEMBER(N'securityadmin') = 1) BEGIN RAISERROR(15003,-1,-1, N'securityadmin') RETURN (1) END IF (@p2 IS NULL) EXEC sys.xp_readerrorlog @p1 ELSE EXEC sys.xp_read.. 더보기
슬로우 쿼리 slow 쿼리 확인 방법. 간략.. 샘플. 1초 이상 쿼리만 조회. select top 100 t.text, q.*from ( select (total_elapsed_time / execution_count) / 1000000 as AvgDuration, * from sys.dm_exec_query_stats where (total_elapsed_time / execution_count) > 1000000 -- 1 sec) as qcross apply sys.dm_exec_sql_text(sql_handle) as torder by AvgDuration desc ----------------------------------- select top 10 * from sys.sysprocesseswhere b.. 더보기
중복 제거후 select 값을 insert 하는 과정 쿼리 변수선언declare @tname varchar(50) declare @totalname varchar(200) set @tname='t_user_test' set @totalname = 'insert into ' + @tname + ' select DISTINCT * from [34].[testc].[dbo].[' + @tname + ']' exec (@totalname) 더보기