How to show errors in sqlplus

岁酱吖の 提交于 2019-12-18 09:34:16

问题


I would like to know how to show errors in sqlplus.

  1. try to compile a view

    alter view SYS.DBA_XML_SCHEMAS compile;

  2. I have the message :

    ERROR at line 1:
    
    ORA-04063 : view altered with compilation errors.
    
  3. I try :

    show errors;

  4. it says :

    No errors
    
  5. I try :

    show errors view SYS.DBA_XML_SCHEMAS
    
  6. it says :

    LINE/COL  ERROR
    
    0/0       ORA-00942 : table or view does not exist
    

If I could compile with errors, the view must exist or it would tell me that the view does not exist. I dont know how to display the compilation errors of the view

thank you


回答1:


You can query the dba_errors view, or the all_errors view, directly; the SQL*Plus show errors command seems to be a wrapper around that anyway.

select line, position, attribute, text
from dba_errors
where owner = 'SYS'
and type = 'VIEW'
and name = 'DBA_XML_SCHEMAS'
order by sequence;

But based on what show errors is telling you, that will just show the same thing, error "ORA-00942 : table or view does not exist" from line 0 position 0.

That doesn't make much sense, but internal views are sometimes strange things, and attempting to recompile one is probably not a good idea.

You might need to get your DBA to run utlrp.sql to recompile all invalid objects in the database. As with anything you think of doing under the SYS schema, that should be done with care; and only if selecting from the view still says it's invalid and failed recompilation.



来源:https://stackoverflow.com/questions/25247461/how-to-show-errors-in-sqlplus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!