SQL 관련 문제 발생시 문제 분석이나 Oracle SR 진행시 가장 어려운 부분은 문제 재현입니다. 


이미 분석되어 널리 알려지거나 오류 등에 의한 trace, dump 등이 있다면 문제 재현없이 진행해 볼수 있겠으나, 

그렇지 않은 경우 SR에서 권고하는 각종 diag patch 등을 적용해 다음 문제 발생때 까지 기다려야 할 수 도 있습니다. 

또 문제가 재현된다고 해도 이걸 잘 포장해서 넘기는 것도 일입니다.

다른 서버에서 재현 실패해서 직접 재현해 놓은 서버에 접속해 테스트와 분석이 진행되기도 합니다. 


Oracle 11g에서 이러한 SQL 관련 문제 발생시 SQL 중심으로 object 상태 정보를 수집할 수 있는 diag tool을 하나를 끼여 넣었는데, 그게 SQL Test Case Builder 입니다. 이 SQL Test Case Builde(TCB)는 EM이나 sqlplus에서 Oracle package 형태로 수행되며 분석에 필요한 다음의 두가지 형태의 정보를 자동으로 수집합니다. 

1. Permanent information

  • SQL text
  • PL/SQL functions, procedures, packages
  • Statistics
  • Bind variables
  • Compilation environment
  • User information (like privileges)
  • SQL profiles, stored outlines, or other SQL Management Objects
  • Meta data on all the objects involved
  • Optimizer statistics
  • The execution plan information
  • The table content (sample or full). This is optional.


2. Transient information

  • dynamic sampling results
  • cached information
  • some run time information (like the actual degree of parallelism used)
  • etc.


사용방법은 간단히 directory 생성및 권한 부여 이후 package로 간단히 수행가능합니다.  

declare

  tc_out clob;

begin

   dbms_sqldiag.export_sql_testcase(directory=>'&dump_dir', 

                                    sql_id=>'&sqlid', 

                                    testcase => tc_out);

end;

/


자세한 예제나 설명은 아래 오라클 블로그에서 읽어보세요. 

Oracle keeps closing my TAR because I cannot provide a testcase, can you help?



+ Recent posts