11g sqlplus errorlog
=====================
11g新增的对sqlplus中错误记录日志
一旦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
--------------------------------------------------------------------------------
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> 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
---------- -------------------------------------------------- --------------------------------------------------------------------------------
AN create table atest as select * from atest ORA-00955: name is already used by an existing object
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13177610/viewspace-711100/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13177610/viewspace-711100/