오라클/Tip

Autotrace 권한부여

빵순이^^ 2010. 5. 16. 15:51


에러 메세지

SQL> set autot on
SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report


autotrace 명령을 사용하기 위해 해당 User는 autotrace 권한이 있어야 하며
autotrace 명령을 사용하기 전에 PLAN_TABLE이 생성되어 있어야 한다.


해결책

SQL> conn / as sysdba

SQL> @$ORACLE_HOME/sqlplus/admin/plustrce.sql  -- autotrace 기능 활성화

SQL> @$ORACLE_HOME/rdbms/admin/utlxplan  -- XPLAN_TABLE 생성

SQL> grant plustrace to user;  -- plustrace 권한을 user에게 부여