블로그 이미지
010-9967-0955 보미아빠

카테고리

보미아빠, 석이 (500)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2024.5
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

공지사항

최근에 올라온 글


1월 7일 발표한
tempdb repro script 입니다.



아티클을 참고해 공부하세요~
http://sqlcat.com/sqlcat/b/technicalnotes/archive/2011/01/25/table-valued-functions-and-tempdb-contention.aspx
Posted by 보미아빠
, |

citiz d110

카테고리 없음 / 2012. 1. 4. 22:21
주연차장님께 거의 빼앗은 물건입죠 -_- 원두커피를 그리 사랑하진 않았지만 슬슬 커피맛을 알아갈 무렵
이 아저씨가 20만원 후반대에 판다고 엘리에서 작업을 걸어왔다. 새걸로 한번도 안쓴 포장도 안 벗겨본......새삥을....
팔겠단다.

-_- 멀라 25만 1천원 어때? 그럼사께~ 라고 사고 쳤다. 안팔줄 알았지 -_- ....... 헉~ 주더라....
아직 술한잔 사께 하고 못사고 있다.......술값 넘 많이 널려있다..........조만간 한탕 해야 할듯....은행을 털던지....
주연 차장님~ 꼭 살께요~ ^----^;


헉 ....... 하나에 1000원 하는 알맹이........다 먹고나면 어케 살지...........감당 불가.........
그래서 고민했다........원두 갈아서 싸게 먹는 방법은 없을까?..........Google 신 도와주세요~
있었다. necap ~ 3만원 정도 주고 구매.....칫 그래도 하나에 300원 이잖아.....헉.....


여튼 제조 성공 처음에는 원두 회사에서 100g 훔쳐옴....-_- 죄송합니다. 위험 부담이 커서 조금 훔쳤어요 ㅠ.ㅠ.....
통으로 들고 나르고 그러지 않았구요......정말 100g만 훔쳤어요.........베타 테스트를 위해 10층에서 조금 남은 원두 훔침....
그런데, 커피를 저렇게 곱게 갈아야 한단다.......-_- 집에 가면서 강영상 과장님과 어떻게 하면 커피를 갈 수 있을까? 같이 고민.............믹서에 갈면 갈릴까???? 우리의 강영상 과장님 ...... 안 갈리지 않을까요? 집에서 믹서 열라 돌려서 성공.....맛난 커피가 나왔다....(새벽에 문자날림....성공했다고...ㅋㅋ) ......그런데 집안 난리남....믹서로 갈면....시끄럽고.. 공장 분위기 됨....

그래서 핸드밀 구매....참나...이것도 한 3만 5천원 정도 함.....-_-


밤에 마누리 꼬셔서 커피 없어서 커피사러 감.............성공 했으니...큰거 하나 사서 묵자....응?
-_- 다방 차리냐? 라는 마눌의 압박을 무시하고 이 마르~ 트레이더스로 고~

아라비카 100% 3만 얼마 주고 구매......흐미~ 총 10만원 정도 들었음....ㅠ.ㅠ 이거면 알맹이 100개 사는데...ㅠ.ㅠ
100개 사면 알맹이 장식품도 주던데.......-_- 아~ 몰라..........하여간 이왕 갈기는거 트레이더스에서 젤 비싼거 지름...
모르면 비싼거 지르면 된다고 알려줬어 살면서 배웠어....


이제 무한 제조 들어감......


대락 성공.......크레마도 가득 나옴.........
음하하하하하 이제 친구들 와도 마구 커피 타 줄 수 있음....


이번에는 거품기 없이 마끼야또 만들기.....우유 어디갔어......우유사러 가자...(마누리가 꼬심...)
거품기 없는데......-_- 거품 없이 먹자.....응?
그래서 거품없는 마끼야도 제조.....설탕 밥숫가락 한숫갈...-_- + 우유 40ml 룽고 120ml 로 만들어서 숫갈로 스터해...마구...

그래서 아래 작품 완성


음 마지막 뽀나스~ 울 봄양의 가식적인 미소...-_-+++



아흐~ 저 가식.......-_- 원래 이쁘게 웃었는데 언제부턴가. 사진찍으면..저래....-_-+++


Posted by 보미아빠
, |

cpu 사용량

카테고리 없음 / 2012. 1. 1. 01:07

alter view cpu_percent
as
select
 top 256 record_id,
 dateadd(ms, -1 * ( (select cpu_ticks / convert(float, ms_ticks) from sys.dm_os_sys_info) - [timestamp]), GetDate()) as EventTime,
 SQLProcessUtilization,
 SystemIdle,
 100 - SystemIdle - SQLProcessUtilization as OtherProcessUtilization
 -- system idle 값과 SQLProcessUtilization 값을 이용해서 SQL 외 cpu 사용율을 계산 합니다.
from (
  select
   record.value('(./Record/@id)[1]', 'int') as record_id,
   record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') as SystemIdle,
   record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') as SQLProcessUtilization,
   timestamp
  from (
   select timestamp, convert(xml, record) as record
   from sys.dm_os_ring_buffers
   where ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
   and record like '%<SystemHealth>%'
   ) as x
 ) as y
order by record_id asc
Posted by 보미아빠
, |

Improvements for the DBCC CHECKDB command may result in faster performance when you use the PHYSICAL_ONLY option

sql server 2008r2 cu11 이나 sp1 cu4 를 설치하면 Traceflag 2562 와 2549 를 통해서 physical only 옵션을 사용할 수 있고 이는 꼭 checkdb 를 해서 체크를 해야 하는 경우에는 빠르게 체크 할 수 있다. 보통 checkdb 는 백업/복구를 통해서 다른 서버에서 진행 하는것이 관례이나 어떤 이유에서 실제 서버에서 꼭 해봐야 하는 경우에는 유용 할 수 있다. 

데이터베이스는 너무크고, 리스토어 할 시스템은 없고 주기적으로 일관성체크는 해봐야 하는 시스템에서는 유용할 수 있다.
sql server 2008 용은 내년에 만들어 준단다. (지금은 2011년 12월 31일 입니다.)

http://support.microsoft.com/kb/2634571
Posted by 보미아빠
, |
http://msdn.microsoft.com/en-us/library/ms144259(v=sql.90).aspx#options

다양한 삭제가 가능함.

[REMOVE]

The REMOVE parameter specifies which components to uninstall, like SQL Server, Reporting Services, or Analysis Services. This command must be used in conjunction with the INSTANCENAME parameter. For example, to remove the instance aware component AND any non-instance aware components, such as Client_Components, you would specify the following:

  • REMOVE=All INSTANCENAME=MSSQLSERVER
    ms144259.note(en-US,SQL.90).gifImportant:
    Do not use this parameter if you have several instances installed and you still want to use client tools.

    To remove all non-instance aware components, such as Client_Components and SQL_DTS, specify REMOVE=ALL without reference to the instance name.
    When REMOVE is specified for a new installation, components listed after 'REMOVE=' are not included for installation. For example, to install every component except for Reporting Services components during a new installation specify the following:
    • ADDLOCAL=All REMOVE=RS_Server,RS_Web_Interface

REMOVE can also be used during maintenance to remove components from an existing installation. For example, to remove Full-Text Search, specify the following:

  • REMOVE=SQL_FullText
    ms144259.note(en-US,SQL.90).gifImportant:
    Removing the parent feature removes both the parent and the child feature.

    REMOVE=
    

Posted by 보미아빠
, |
네트웍 관련 CPU 워크로드 분산 및 튜닝 포인트

1. RSS 활성화 및 셋팅 (많은 CORE 로 네터웍 부하를 분산) http://minimonk.tistory.com/2728
2. base filtering engine 을 끈다? 그럼 방화벽 관련 문제가 있지만 성능 위주의 튜닝이 필요한 경우 활성화 (패킷필터를 하지마)
3. TCP Chimmeny offload 를 활성화 (네트웍 데이터패킷 처리 일부를 NIC 가 처리)
   http://support.microsoft.com/kb/942861/ko 드라이버를 최신으로 올리고 하던지 인텔 쓰던지.....

좋은 기능들 이지만 많은 문제가 있으니 죽어도 활성화 해야 하는 경우 빼고는 disable 을 권장한다. -_-
cpu 1% 쓰면서 네트웍 튜닝 한다고 저런 옵션 설정하면 바로 기때기다.....
Posted by 보미아빠
, |
Posted by 보미아빠
, |

커서 선택

카테고리 없음 / 2011. 12. 19. 06:11

커서 유형 선택

커서 유형 선택은 다음을 비롯한 여러 변수에 따라 달라집니다.

  • 결과 집합의 크기

  • 필요한 데이터 비율

  • 열린 커서의 성능

  • 스크롤이나 업데이트 등과 같은 커서 작업의 필요성

  • 다른 사용자가 수행하는 데이터 수정의 가시성 수준

커서 유형을 선택할 때 따라야 하는 몇 가지 규칙은 다음과 같습니다.

  • 기본 테이블 및 정방향 전용 커서는 정적 커서 또는 키 집합 커서보다 빨리 열립니다. 정적 커서 및 키 집합 커서가 열린 경우 내부 임시 작업 테이블을 작성해야 하지만 기본 테이블 및 정방향 전용 커서에는 이러한 테이블이 필요하지 않습니다.

  • 정적 및 키 집합 커서의 경우 임시 데이터베이스의 사용량이 늘어납니다. 정적 서버 커서는 임시 데이터베이스에 전체 커서를 작성합니다. 키 집합 커서는 임시 데이터베이스에 키 집합을 작성합니다.

  • 프로젝션이나 선택 없이 기본 테이블을 있는 그대로 검색할 경우에는 최소한의 오버헤드를 가지는 기본 테이블 커서를 사용하는 것이 좋습니다.

  • 정적 커서는 데이터를 복제하기 때문에 가장 많은 리소스를 소비합니다.

Posted by 보미아빠
, |


hash join 으로 풀리나 merge join 이 발생하도록 하고 planguide 로 고정 시켰다.
음 이러한 planguide 는 cursor 계획에도 적용 가능하다.
커서는 실행계획이 일반 쿼리 계획과 다르게 나올 수 있다.
커서 타입이나 락 타입 로케이션 등에 따라 다양하게 플랜이 바뀔 수 있고, 이때 비 효율적인 플랜이 선택 된다면
planguide 로 어플리케이션 변경없이 플랜을 가이드 할 수 있다.
또한 fn_validate_plan_guide 를 이용해 planguide 가 에러가 나면, 에러의 원인을 알 수 있다.

요지는 rule 컨트롤로 쿼리 변경 없이 plan 을 만들어 내고 고정 할 수 있다는 것이다.

if object_id ('tblx') is not null
drop table tblx
go

if object_id ('tbly') is not null
drop table tbly
go

create table tblx (cint int, cvarchar varchar(100))
create table tbly (cint int, cvarchar varchar(100))

dbcc freeproccache
go
drop table t_before
go
drop table t_after
go

select * into t_before from sys.dm_exec_query_transformation_stats
go

select * from tblx a join tblx b on a.cint = b.cint where a.cint < 1
go

select * into t_after from sys.dm_exec_query_transformation_stats
go

select *
  from t_before a
  join t_after b
    on a.name = b.name
   and a.succeeded <> b.succeeded
go

dbcc ruleoff('JNtoHS')
-- 플랜을 프로파일러에서 받아내고,
dbcc ruleon('JNtoHS')
-- 받아낸 플랜을 적용하고 다시 룰을 원상 복구한다.
-- 복구된 상황에서 플랜 가이드에 의해 올바르게 의도한 플랜으로 풀렸는지 확인한다.

exec sp_create_plan_guide
@name = N'Guide',
@stmt = N'select * from tblx a join tblx b on a.cint = b.cint where a.cint < 1',
@type = N'SQL',
@module_or_batch = NULL,
@params = NULL,
@hints = N'OPTION(USE PLAN N''<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.1" Build="10.50.2500.0"><BatchSequence><Batch><Statements><StmtSimple><QueryPlan CachedPlanSize="24" CompileTime="2" CompileCPU="2" CompileMemory="160"><RelOp NodeId="0" PhysicalOp="Merge Join" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0.000313" EstimateCPU="0.00564738" AvgRowSize="121" EstimatedTotalSubtreeCost="0.0352532" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cvarchar"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cvarchar"/></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0"/></RunTimeInformation><Merge ManyToMany="1"><InnerSideJoinColumns><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/></InnerSideJoinColumns><OuterSideJoinColumns><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/></OuterSideJoinColumns><Residual><ScalarOperator ScalarString="[SQLTAG2008R2].[dbo].[tblx].[cint] as [b].[cint]=[SQLTAG2008R2].[dbo].[tblx].[cint] as [a].[cint]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/></Identifier></ScalarOperator></Compare></ScalarOperator></Residual><RelOp NodeId="1" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.000100065" AvgRowSize="65" EstimatedTotalSubtreeCost="0.0146449" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cvarchar"/></OutputList><MemoryFractions Input="1" Output="0.5"/><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" ActualRebinds="0" ActualRewinds="0" ActualEndOfScans="0" ActualExecutions="0"/></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/></OrderByColumn></OrderBy><RelOp NodeId="2" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="65" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cvarchar"/></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0"/></RunTimeInformation><TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0"><DefinedValues><DefinedValue><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/></DefinedValue><DefinedValue><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cvarchar"/></DefinedValue></DefinedValues><Object Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" IndexKind="Heap"/><Predicate><ScalarOperator ScalarString="[SQLTAG2008R2].[dbo].[tblx].[cint] as [b].[cint]&lt;(1)"><Compare CompareOp="LT"><ScalarOperator><Identifier><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[b]" Column="cint"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"/></ScalarOperator></Compare></ScalarOperator></Predicate></TableScan></RelOp></Sort></RelOp><RelOp NodeId="3" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.000100065" AvgRowSize="65" EstimatedTotalSubtreeCost="0.0146449" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cvarchar"/></OutputList><MemoryFractions Input="0.5" Output="0.5"/><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" ActualRebinds="0" ActualRewinds="0" ActualEndOfScans="0" ActualExecutions="0"/></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/></OrderByColumn></OrderBy><RelOp NodeId="4" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="65" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cvarchar"/></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0"/></RunTimeInformation><TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0"><DefinedValues><DefinedValue><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/></DefinedValue><DefinedValue><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cvarchar"/></DefinedValue></DefinedValues><Object Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" IndexKind="Heap"/><Predicate><ScalarOperator ScalarString="[SQLTAG2008R2].[dbo].[tblx].[cint] as [a].[cint]&lt;(1)"><Compare CompareOp="LT"><ScalarOperator><Identifier><ColumnReference Database="[SQLTAG2008R2]" Schema="[dbo]" Table="[tblx]" Alias="[a]" Column="cint"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"/></ScalarOperator></Compare></ScalarOperator></Predicate></TableScan></RelOp></Sort></RelOp></Merge></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>'')'

select plan_guide_id from sys.plan_guides
select * from sys.fn_validate_plan_guide(65545)
EXEC sp_control_plan_guide N'DROP', N'Guide'


option (loop join, table hint (th_, index(d_1f0000018000000f), forceseek))
술한잔 벌었다......으흐흐흐흐

Posted by 보미아빠
, |
Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함