IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Oracle23ai新特性—sqlplus errordetails功能

    惜分飞发表于 2024-07-30 14:45:12
    love 0

    联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

    标题:Oracle23ai新特性—sqlplus errordetails功能

    作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

    在oracle 23ai中如果sqlplus执行遇到ORA-错误,会有对应的Help: https://docs.oracle.com/error-help/db/ORA-XXXXX提示,由于以前的使用习惯或者是提示本身意义不大等原因,还是希望在sqlplus中关闭这类提示.通过分析确认该提示是由errordetails来控制的

    [oracle@xifenfei admin]$ sqlplus / as sysdba
    
    SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Mon Jul 29 22:44:23 2024
    Version 23.5.0.24.07
    
    Copyright (c) 1982, 2024, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
    Version 23.5.0.24.07
    
    SQL> select * from xff.xifenfei;
    select * from xff.xifenfei
                      *
    ERROR at line 1:
    ORA-00942: table or view "XFF"."XIFENFEI" does not exist
    Help: https://docs.oracle.com/error-help/db/ora-00942/
    
    SQL> show errordetails   <--该值默认为on
    errordetails ON
    

    设置errordetails off即可实现关闭Help: https://docs.oracle.com/error-help/db/ORA-XXXXX提示

    SQL> set errordetails off
    SQL>  select * from xff.xifenfei;
     select * from xff.xifenfei
                       *
    ERROR at line 1:
    ORA-00942: table or view "XFF"."XIFENFEI" does not exist
    
    

    设置errordetails verbose可以实现更加详细的提示

    SQL> set errordetails verbose
    SQL> select * from xff.xifenfei;
    select * from xff.xifenfei
                      *
    ERROR at line 1:
    ORA-00942: table or view "XFF"."XIFENFEI" does not exist
    Help: https://docs.oracle.com/error-help/db/ora-00942/
    Cause:     The specified table or view did not exist, or a synonym
               pointed to a table or view that did not exist.
               To find existing user tables and views, query the
               ALL_TABLES and ALL_VIEWS data dictionary views. Certain
               privileges may be required to access the table. If an
               application returned this message, then the table that the
               application tried to access did not exist in the database, or
               the application did not have access to it.
    Action:    Check each of the following:
               - The spelling of the table or view name is correct.
               - The referenced table or view name does exist.
               - The synonym points to an existing table or view.
    
               If the table or view does exist, ensure that the correct access
               privileges are granted to the database user requiring access
               to the table. Otherwise, create the table.
    
               Also, if you are attempting to access a table or view in another
               schema, make sure that the correct schema is referenced and that
               access to the object is granted.
    Params: 1) object_name: The table or view name specified as
                            SCHEMA.OBJECT_NAME, if one is provided.
                            Otherwise, it is blank.
    

    如果要实现sqlplus启动即屏蔽该提示,可以在glogin.sql文件($ORACLE_HOME/sqlplus/admin目录中)设置
    errordetails-off


    [oracle@xifenfei admin]$ sqlplus / as sysdba
    
    SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Mon Jul 29 22:44:23 2024
    Version 23.5.0.24.07
    
    Copyright (c) 1982, 2024, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
    Version 23.5.0.24.07
    
    SQL> show errordetails;
    errordetails OFF
    SQL> select * from xifenfei.xff;
    select * from xifenfei.xff
                           *
    ERROR at line 1:
    ORA-00942: table or view "XIFENFEI"."XFF" does not exist
    
    • Oracle23ai新特性—SCHEMA级授权( grant select any table on schema)
    • oracle 23ai(23.5.0.24.07)完整功能版安装体验
    • 授权用户访问数据字典三种方式
    • 创建视图提示ORA-01031
    • 模拟ORA-04043并解决
    • dual 缺少同义词故障解决
    • Oracle 11g丢失access$恢复方法
    • ORACLE 12C dbms_utility.expand_sql_text 查看SQL视图基表
    • update user$报ORA-01031错误
    • ORACLE 12C可以通过expdp导出view数据
    • PostgreSQL简单操作之—创建库,登录,ddl,dml,help,登出,删除库
    • v$和gv$来源



沪ICP备19023445号-2号
友情链接