시나리오: pureQuery Runtime의 저장소 작성 및 구성

pureQuery ManageRepository 유틸리티를 사용하여 트랜잭션 데이터베이스에 있는 저장소를 작성하고 관리합니다. 저장소를 작성한 후 pureQuery Runtime 특성을 저장소에 업로드합니다.

이 태스크 정보

pureQuery ManageRepository 유틸리티를 사용하여 다음 태스크를 수행합니다.
  • 트랜잭션 데이터베이스에 있는 저장소를 작성하여 pureQuery Runtime 특성을 저장하십시오.

    저장소가 트랜잭션 데이터베이스에 있을 때에는 저장소가 백업 및 유지보수 면에서 트랜잭션 데이터베이스의 모든 혜택을 누립니다.

  • WebSphere® 애플리케이션에 대해 작업하도록 저장소를 구성하십시오.
    • 저장소에 런타임 그룹 버전을 작성하십시오.
    • pureQuery Runtime 특성을 런타임 그룹 버전에 대한 저장소에 업로드하십시오.

      pureQuery Runtime 특성을 저장소에 저장하면 pureQuery Runtime 특성을 중앙에서 지정하고 필요할 때 변경할 수 있습니다. pureQuery Runtime 특성 refreshInterval을 설정하여 pureQuery Runtime의 자동 새로 고침 기능을 사용합니다. refreshInterval 특성을 설정하면 pureQuery Runtime이 런타임 특성을 자동으로 새로 고칠 수 있습니다. 자동 새로 고침을 통해 데이터베이스 관리자는 pureQuery Runtime 특성을 변경하여 애플리케이션에서 발행된 SQL을 제어할 수 있습니다.

    • 애플리케이션과 연관된 런타임 그룹 버전을 활성화하여 pureQuery Runtime에 런타임 그룹 버전을 사용할 수 있도록 하십시오.

pureQuery 클라이언트 최적화에 사용 가능한 WebSphere 웹 애플리케이션은 저장소 런타임 그룹 버전의 정보를 사용합니다.

프로시저

pureQuery Runtime에 대해 저장소를 작성 및 구성하려면 다음을 수행하십시오.

  1. 트랜잭션 데이터베이스에 저장소를 작성하십시오.
    ManageRepository 유틸리티를 -create repository 옵션과 함께 실행하십시오. 다음 명령은 저장소를 작성합니다.
    java com.ibm.pdq.tools.ManageRepository -create repository 
      -repositoryDriverClass com.ibm.db2.jcc.DB2Driver
      -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
      -repositoryUsername "myuser" -repositoryPassword "mypwd" 
      -repositoryType pureQueryRuntimeOnly
    명령의 출력은 다음 예와 유사합니다.
    IBM Optim pureQuery runtime 2.2.0.3 build 2.18.118 
    Licensed Materials - Property of IBM
    5724-U16
    (c) Copyright IBM Corp. 2006, 2010 All Rights Reserved. 
    
    =============================================================
    
    Starting to process options: -create "repository" 
    -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
    -repositoryUsername "****" -repositoryPassword "*****" 
    -repositoryDriverClass "com.ibm.db2.jcc.DB2Driver" 
    -repositoryType "pureQueryRuntimeOnly"
    
    The ManageRepository utility successfully created the repository. 
    -repositoryType 옵션은 pureQuery Runtime 용도로만 경량의 저장소를 작성하기 위해 pureQueryRuntimeOnly로 지정되었습니다.
    팁: -generateScriptOnly 옵션을 ManageReposoitory 명령과 함께 사용하여 저장소를 작성할 SQL문을 포함하지만 저장소를 작성하지 않는 SQL 스크립트를 생성할 수 있습니다. 기본 테이블 스페이스가 아닌 고유 테이블 스페이스에 테이블을 배치하도록 스크립트를 수정할 수 있습니다. 그러나 스키마 이름, 테이블 이름 또는 컬럼 이름은 수정할 수 없습니다.

    스크립트를 사용하여 저장소를 작성하는 경우 -verify repository 옵션을 사용하여 저장소의 구조가 올바른지 확인할 수 있습니다.

  2. 저장소에 런타임 그룹 버전을 작성하십시오.

    ID testApp 및 버전 ID V1의 런타임 그룹을 작성하십시오. 런타임 그룹을 작성할 때에는 버전도 지정해야 합니다.

    다음 ManageRepository 명령은 런타임 그룹 버전을 작성합니다.
    java com.ibm.pdq.tools.ManageRepository -create runtimeGroup 
      -repositoryDriverClass com.ibm.db2.jcc.DB2Driver
      -repositoryURL  "jdbc:db2://testserver.test.com:32706/sample" 
      -repositoryUsername  "myuser" -repositoryPassword  "mypwd" 
      -runtimeGroupId testApp 
      -runtimeGroupVersion V1 
    명령의 출력은 다음 예와 유사합니다.
    IBM Optim pureQuery runtime 2.2.0.3 build 2.18.118
    Licensed Materials - Property of IBM
    5724-U16
    (c) Copyright IBM Corp. 2006, 2010 All Rights Reserved.
    
    =========================================================
    
    Starting to process options:  -create "runtimeGroup" 
      -bind "packages" -runtimeGroupVersion "V1" 
      -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
      -repositoryUsername "myuser" -repositoryPassword "******" 
      -repositoryDriverClass "com.ibm.db2.jcc.DB2Driver" 
      -runtimeGroupId "testApp"
    
    The ManageRepository utility successfully created the runtime group "testApp" version "V1".

    그룹 ID testApp는 사용자 정의 데이터 소스 특성 pdqProperties를 WebSphere 데이터 소스에 작성할 때 pureQuery Runtime 특성 propertiesGroupId에 지정할 값과 동일합니다.

  3. pureQuery Runtime 특성이 포함된 파일을 작성하십시오.
    pureQuery Runtime 특성 captureMode의 값이 ON, NEW_STMT 또는 LITE로 설정된 pqtest.properties 파일을 로컬 파일 시스템의 현재 디렉토리에 작성하십시오. 파일에는 다음 텍스트 라인이 포함되어 있습니다.
    pdq.captureMode=ON
    pdq.allowDynamicSQL=TRUE

    pureQuery Runtime 특성을 특성 파일에 지정할 때에는 pdq. 접두부를 특성 이름에 추가합니다.

    captureMode 특성의 값이 ON이고 outputPureQueryXml 특성와 outputXmlRepository 특성이 설정되지 않았으면 pureQuery Runtime은 pureQuery 특성 finalRepositoryProperties에 지정된 저장소에 캡처한 SQL 데이터를 저장합니다. 저장소에서 데이터는 pureQuery 특성 propertiesGroupId에 지정된 런타임 그룹의 활성 버전에 저장됩니다.

    pureQuery Runtime 특성 allowDynamicSQL의 기본값은 TRUE이며 특성 파일에는 필요하지 않습니다. 파일에 특성을 포함시키는 것은 기본값 리마인더로써의 용도입니다. 기본으로 pureQuery Runtime은 SQL문이 이전에 캡처되지 않은 경우에도 애플리케이션에서 발행된 SQL문이 동적으로 실행되도록 합니다.

    팁: SQL 데이터를 캡처할 때 성능이 불안정한 경우 captureMode 특성의 값을 NEW_STMT 또는 LITE로 설정하여 캡처된 SQL 데이터의 양을 줄일 수 있습니다.
  4. pureQuery Runtime 특성을 저장소에 업로드하십시오.
    다음 명령을 실행하십시오.
    java com.ibm.pdq.tools.ManageRepository -update runtimeGroup 
      -repositoryDriverClass com.ibm.db2.jcc.DB2Driver
      -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
      -repositoryUsername "myuser" -repositoryPassword "mypwd" 
      -runtimeGroupId testApp 
      -pureQueryProperties ./pqtest.properties -runtimeGroupVersion V1
    명령의 출력은 다음 예와 유사합니다.
    IBM Optim pureQuery Runtime 2.2.0.3 build 2.18.118
    Licensed Materials - Property of IBM
    5724-U16
    (c) Copyright IBM Corp. 2006, 2010 All Rights Reserved.
    
    ======================================================
    
    Starting to process options: -update "runtimeGroup" 
    -runtimeGroupVersion "v1" 
    -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
    -repositoryUsername "*****" -repositoryPassword "****" 
    -repositoryDriverClass "com.ibm.db2.jcc.DB2Driver"
    -pureQueryProperties "./pqtest.properties" 
    -runtimeGroupId "testApp" 
    
    The ManageRepository utility successfully updated the runtime group "testApp" version "V1".
  5. 런타임 그룹 testApp의 런타임 그룹 버전 V1을 활성화하십시오.

    다음 명령을 실행하십시오.

    java com.ibm.pdq.tools.ManageRepository -activate runtimeGroup 
    -repositoryDriverClass com.ibm.db2.jcc.DB2Driver
    -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
    -repositoryUsername "myuser" -repositoryPassword "mypwd" 
    -runtimeGroupId testApp 
    -runtimeGroupVersion V1
    명령의 출력은 다음 예와 유사합니다.
    IBM Optim pureQuery Runtime 2.2.0.3 build 2.18.118
    Licensed Materials - Property of IBM
    5724-U16
    (c) Copyright IBM Corp. 2006, 2010 All Rights Reserved.
    
    ==========================================
    
    Starting to process options: -activate "runtimeGroup" 
    -runtimeGroupVersion "V1" -repositoryURL "jdbc:db2://testserver.test.com:32706/sample" 
    -repositoryUsername "*****"  -repositoryPassword "*****" 
    -pureQueryProperties "./pqtest.properties" 
    -runtimeGroupId "testApp" 
    
    The ManageRepository utility successfully activated the runtime group "testApp" version "V1".

결과

저장소를 작성하고 pureQuery Runtime 특성을 저장소의 런타임 그룹 버전에 추가했습니다. 저장소의 런타임 그룹 버전을 활성화하여 pureQuery Runtime을 통해 저장소에서 런타임 그룹에 대한 특성을 검색했습니다.

애플리케이션을 실행할 때 pureQuery Runtime은 애플리케이션에서 발행된 SQL문 및 SQL문과 연관된 데이터를 캡처합니다. 캡처 프로세스는 캡처 정보가 포함된 새 레코드를 저장소에 작성합니다.

다음에 수행할 작업

다음 태스크에서는 애플리케이션을 실행할 때 저장소 및 저장소의 pureQuery 데이터를 사용하도록 WebSphere Application Server를 구성합니다. 저장소에서 pureQuery 정보를 검색하도록 pureQuery Runtime을 구성할 때 런타임 그룹을 지정합니다. pureQuery Runtime은 런타임 그룹의 활성 버전에서 정보를 검색합니다.


피드백