블로그 이미지
다비도프

만나고, 고백하고, 가슴 떨리고, 설레이고, 웃고, 사랑하고, 키스하고, 함께하고..

Rss feed Tistory
STUDY/SQL Cache Dependency 2007. 4. 25. 15:58

[Study] Using the SQL Server Cache Dependency

1. SQL Cache 종속성을 사용하도록 데이터베이스 설정
aspnet_regsql -S localhost -U sa -P password -d testDB -ed

2. SQL Cache 종속성을 테이블에 활성화시킨다.
aspnet_regsql -S localhost -U sa -P password -d testDB -t tblMember -et

3. SQL Cache 종속성이 설정된 테이블 목록을 조회한다.
aspnet_regsql –S localhost –U sa –P password –d testDB -lt

4. SQL Server Cache Dependency 설정 해제 명령어

1) DB 해제
aspnet_regsql -S localhost -U sa -P password -d testDB -dd

2) Table 해제
aspnet_regsql -S localhost -U sa -P password -d testDB -t tblMember -dt

5. Web.config 설정

<caching>

    <sqlCacheDependency enabled="true">

      <databases>

        <add name="Northwind" connectionStringName="ConnectionString" pollTime="500" />

      </databases>

    </sqlCacheDependency>

</caching>

è  connectionStringName web.config 설정된 ConncetionString값과 동일하게 설정함.

è  pollTime 단위 : milliseconds

G.      SQL Server Cache Dependency 페이지 적용 (aspx page)
<%
@ OutputCache Duration="3600" VaryByParam="none"
SqlDependency="Northwind:Customers" %>

Or

<%@ OutputCache Duration="3600" VaryByParam="none"
SqlDependency="Northwind:Customers;Northwind:Products" %>

è  SqlDependency = “DatabaseName:TableName”


[출처 : http://blog.naver.com/metalzang?Redirect=Log&logNo=130016491535]
,
TOTAL TODAY