我这个oracle9i在执行sql的时候好像不好用执行计划,不知道为什么,麻烦高手赐教!谢谢

解决方案 »

  1.   

    怎么不好用?楼主怎么用的?explan plan for .....
    这样不行吗?
      

  2.   

     SQL> set autotrace on expSP2-0613: Unable to verify PLAN_TABLE format or existence
    SP2-0611: Error enabling EXPLAIN report 
     
     
     
    SQL> @'$ORACLE_HOME/rdbms/admin/utlxplan'
     
    Table created.
     
    SQL> create public synonym plan_table for plan_table;
     
    Synonym created.
     
    SQL> grant all on plan_table to public ;
     
    Grant succeeded.
     
    SQL> @'$ORACLE_HOME/sqlplus/admin/plustrce'SQL> drop role plustrace;
    drop role plustrace
              *
    ERROR at line 1:
    ORA-01919: role 'PLUSTRACE' does not exist
     
    SQL> create role plustrace;
     
    Role created.SQL> grant select on v_$sesstat to plustrace;
     
    Grant succeeded.
     
    SQL> grant select on v_$statname to plustrace;
     
    Grant succeeded.
     
    SQL> grant select on v_$session to plustrace;
     
    Grant succeeded.
     
    SQL> grant plustrace to dba with admin option;
     
    Grant succeeded.SQL> set echo off
    SQL> grant plustrace to public ;
     
    Grant succeeded.
     
    SQL>
     
     
     
     
     
    SQL> set autotrace on exp
      

  3.   

    只要通过ORACLE的JOB(运行时间可自定义)去运行过程就可以了。
      

  4.   

    为什么还是这样:
    SQL> @'E:\oracle\ora92\rdbms\admin\utlxplan.sql';Table createdSQL> create public synonym plan_table for plan_table;Synonym createdSQL> grant all on plan_table to public ;Grant succeededSQL> @'$ORACLE_HOME/sqlplus/admin/plustrce'
    Error reading fileSQL> @'E:\oracle\ora92\rdbms\admin\plustrce';
    Error reading fileSQL> @'E:\oracle\ora92\rdbms\admin\plustrce.sql';
    Error reading fileSQL> @'E:\oracle\ora92\sqlplus\admin\plustrce'
    drop role plustrace;drop role plustraceORA-01919: 角色'PLUSTRACE'不存在
    create role plustrace;Role created
    grant select on v_$sesstat to plustrace;grant select on v_$sesstat to plustraceORA-00942: 表或视图不存在
    grant select on v_$statname to plustrace;grant select on v_$statname to plustraceORA-00942: 表或视图不存在
    grant select on v_$session to plustrace;grant select on v_$session to plustraceORA-00942: 表或视图不存在
    grant plustrace to dba with admin option;Grant succeeded
    set echo offSQL> set autotrace on exp
    Cannot SET AUTOTRACESQL> 
      

  5.   

    提示
    ORA-01919: 角色'PLUSTRACE'不存在
    create role plustrace; 
    你grant select on v_$sesstat to plustrace; 肯定不能成功啊首先用sys登录:
    运行:
    @%oracle_home%\sqlplus\admin\plustrce然后把角色赋给需要使用的用户,比如scott:
    grant plustrace to scott; 
      

  6.   

    运行: 
    @%oracle_home%\sqlplus\admin\plustrce 
    成功
    grant plustrace to cjq1018;
    但是在cjq1018用户下还是这样:
    SQL> set autotrace on exp 
    Cannot SET AUTOTRACE