如何在sqlplus中显示错误 [英] How to show errors in sqlplus

查看:111
本文介绍了如何在sqlplus中显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在sqlplus中显示错误.

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

  1. 尝试编译视图

  1. try to compile a view

alter view SYS.DBA_XML_SCHEMAS compile;

我收到消息:

ERROR at line 1:

ORA-04063 : view altered with compilation errors.

  • 我尝试:

  • I try :

    show errors;

    它说:

    No errors
    

  • 我尝试:

  • I try :

    show errors view SYS.DBA_XML_SCHEMAS
    

  • 它说:

  • 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

    谢谢

    推荐答案

    您可以直接查询dba_errors视图或all_errors视图;无论如何,SQL * Plus show errors命令似乎都是该包装器.

    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;
    

    但是根据show errors告诉您的内容,这只会显示相同的内容,从行0位置0开始出现错误"ORA-00942:表或视图不存在".

    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.

    您可能需要让DBA运行 utlrp.sql重新编译数据库中所有无效的对象.与您考虑在SYS模式下进行的任何操作一样,应谨慎进行;并且只有在从视图中进行选择时仍然认为无效和重新编译失败的情况下.

    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.

    这篇关于如何在sqlplus中显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆