ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 11g sqlplus errorlog

11g sqlplus errorlog

原创 Linux操作系统 作者:安佰胜 时间:2011-11-17 10:13:25 0 删除 编辑
 
11g sqlplus errorlog
 
=====================
11g新增的对sqlplus中错误记录日志
一旦sqlplus中发生错误会被记录到表中
------------------

--版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

、
--查看是否开启
SQL> show errorlog
errorlogging is OFF

--开启方法
SQL> set errorlog on

--再次查看开启情况
--如果开启会给出记录的表
SQL> show errorlog
errorlogging is ON TABLE AN.SPERRORLOG
SQL>

--刚刚开启之后表中没有数据
SQL> select * from sperrorlog;
no rows selected
 
--模拟错误
SQL> create table atest as select * from atest;
create table atest as select * from atest
             *
ERROR at line 1:
ORA-00955: name is already used by an existing object

--再次查看,其中会记录详细的错误信息
SQL> set wrap off
SQL> col username for a10
SQL> set linesize 300
SQL> col statement for a50
SQL> select * from sperrorlog;
USERNAME   STATEMENT                                          MESSAGE
---------- -------------------------------------------------- --------------------------------------------------------------------------------
AN         create table atest as select * from atest          ORA-00955: name is already used by an existing object
 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13177610/viewspace-711100/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 20000次 记录
下一篇: 11g plsql本地编译
请登录后发表评论 登录
全部评论

注册时间:2009-08-26

  • 博文量
    215
  • 访问量
    660346