• 10046解决PLSQL访问数据字典 显示授权问题


    SQL> create or replace procedure test_trc IS
    msql varchar2(200);
    begin
    msql := 'insert into t100 select * from dba_objects';
    execute immediate msql;
    commit;
    end;  2    3    4    5    6    7  
      8  /
    
    Procedure created.
    
    SQL> show err
    No errors.
    SQL> exec test_trc
    BEGIN test_trc; END;
    
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "TEST.TEST_TRC", line 5
    ORA-06512: at line 1
    
    
    
    SQL> ALTER SESSION SET EVENTS '10046 trace name context forever,level 12';
    执行过程居然报:
    
    SQL> exec test_trc;
    BEGIN test_trc; END;
    
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "TEST.TEST_TRC", line 5
    ORA-06512: at line 1
    SQL> ALTER SESSION SET EVENTS '10046 trace name context off';  
    
    Session altered
    
    /oracle/app10g/admin/orcl/udump/orcl_ora_9165.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORACLE_HOME = /oracle/app10g/product/10.2.0/db
    System name:    Linux
    Node name:      jhoa
    Release:        2.6.18-194.el5
    Version:        #1 SMP Tue Mar 16 21:52:39 EDT 2010
    Machine:        x86_64
    Instance name: orcl
    Redo thread mounted by this instance: 1
    Oracle process number: 15
    Unix process pid: 9165, image: oracle@jhoa (TNS V1-V3)
    
    *** ACTION NAME:() 2014-11-20 16:20:22.316
    *** MODULE NAME:(SQL*Plus) 2014-11-20 16:20:22.316
    *** SERVICE NAME:(SYS$USERS) 2014-11-20 16:20:22.316
    *** SESSION ID:(1636.47) 2014-11-20 16:20:22.316
    WAIT #2: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1383273068668059
    WAIT #2: nam='SQL*Net message from client' ela= 5733215 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1383273074401482
    =====================
    PARSING IN CURSOR #1 len=22 dep=0 uid=90 oct=47 lid=90 tim=1383273074401646 hv=769690522 ad='80ed20c8'
    BEGIN test_trc; END;
    END OF STMT
    PARSE #1:c=0,e=64,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1383273074401642
    BINDS #1:
    =====================
    PARSING IN CURSOR #3 len=37 dep=2 uid=0 oct=3 lid=0 tim=1383273074402315 hv=1398610540 ad='c0e8a398'
    select text from view$ where rowid=:1
    END OF STMT
    PARSE #3:c=0,e=63,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=4,tim=1383273074402312
    BINDS #3:
    kkscoacd
     Bind#0
      oacdty=11 mxl=16(16) mxlc=00 mal=00 scl=00 pre=00
      oacflg=18 fl2=0001 frm=00 csi=00 siz=16 off=0
      kxsbbbfp=2b0a1692b280  bln=16  avl=16  flg=05
      value=000018E0.0000.0001
    EXEC #3:c=0,e=87,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=4,tim=1383273074402485
    FETCH #3:c=0,e=40,p=0,cr=2,cu=0,mis=0,r=1,dep=2,og=4,tim=1383273074402545
    STAT #3 id=1 cnt=1 pid=0 pos=1 obj=63 op='TABLE ACCESS BY USER ROWID VIEW$ (cr=1 pr=0 pw=0 time=29 us)'
    =====================
    PARSE ERROR #2:len=42 dep=1 uid=90 oct=2 lid=90 tim=1383273074404068 err=942
    insert into t100 select * from dba_object
    EXEC #1:c=3000,e=2549,p=0,cr=2,cu=0,mis=0,r=0,dep=0,og=1,tim=1383273074404245
    ERROR #1:err=942 tim=446336866
    WAIT #1: nam='SQL*Net break/reset to client' ela= 15 driver id=1650815232 break?=1 p3=0 obj#=-1 tim=1383273074404304
    WAIT #1: nam='SQL*Net break/reset to client' ela= 52 driver id=1650815232 break?=0 p3=0 obj#=-1 tim=1383273074404372
    WAIT #1: nam='SQL*Net message to client' ela= 0 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1383273074404395
    *** 2014-11-20 16:20:35.053
    WAIT #1: nam='SQL*Net message from client' ela= 6702657 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1383273081107101
    =====================
    PARSING IN CURSOR #3 len=55 dep=0 uid=90 oct=42 lid=90 tim=1383273081107348 hv=2655499671 ad='0'
    ALTER SESSION SET EVENTS '10046 trace name context off'
    END OF STMT
    PARSE #3:c=0,e=111,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1383273081107345
    EXEC #3:c=1000,e=53,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1383273081107446
    
    
    
    
    PARSE ERROR #2:len=42 dep=1 uid=90 oct=2 lid=90 tim=1383273074404068 err=942
    insert into t100 select * from dba_object
    EXEC #1:c=3000,e=2549,p=0,cr=2,cu=0,mis=0,r=0,dep=0,og=1,tim=1383273074404245
    
    
    解析的时候居然是被当成:insert into t100 select * from dba_object
    
    
    在过程里访问数据字典,需要显示的grant select any dictionary to test;
    

  • 相关阅读:
    谷歌浏览器提示Adobe Flash Player因过期而遭到阻止
    Oracle 查看表空间剩余与创建空间语法
    招标
    iphone刷机各种错误
    oracle 创建dblink
    imp-00002 无法打开。。
    oracle 大字段clob检索
    (一)EasyUI 使用——基本概念
    使用 Google 高级搜索的一些技巧
    (四)Maven构建多模块项目
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351989.html
Copyright © 2020-2023  润新知