[20120106]11G sqlplus set errorloging on.txt
在Oracle 11g版本的SQL*Plus中提供了一個非常有特色的選項errorlogging。當開啟該選項之後,會話級別的錯誤都會寫入到指定表中,是spool選項的有益補充。spool選項會將所有的輸出資訊都寫入到指定檔案檔案中,這樣會造成檔案內容過於臃腫和繁雜。在使用errorlogging選項後,我們將只關注那些與報錯有關的資訊,可以認為該選項是spool選項的精華抽取。
例子:
create table t (id number constraint pk_t primary key) ;
insert into t(id) values (1);
commit;
SQL> set errorlogging on
SQL> show errorlogging
errorlogging is ON TABLE SCOTT.SPERRORLOG
SQL> desc sperrorlog
Name Null? Type
----------- -------- --------------
USERNAME VARCHAR2(256)
TIMESTAMP TIMESTAMP(6)
SCRIPT VARCHAR2(1024)
IDENTIFIER VARCHAR2(256)
MESSAGE CLOB
STATEMENT CLOB
SQL> insert into t(id) values (1);
insert into t(id) values (1)
*
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.PK_T) violated
SQL> select timestamp,statement,message from sperrorlog;
TIMESTAMP STATEMENT MESSAGE
------------------- -------------------------------------------------- --------------------------------------------------
2012-01-06 15:30:47. insert into t(id) values (1) ORA-00001: unique constraint (SCOTT.PK_T) violated
000000
例子:
create table t (id number constraint pk_t primary key) ;
insert into t(id) values (1);
commit;
SQL> set errorlogging on
SQL> show errorlogging
errorlogging is ON TABLE SCOTT.SPERRORLOG
SQL> desc sperrorlog
Name Null? Type
----------- -------- --------------
USERNAME VARCHAR2(256)
TIMESTAMP TIMESTAMP(6)
SCRIPT VARCHAR2(1024)
IDENTIFIER VARCHAR2(256)
MESSAGE CLOB
STATEMENT CLOB
SQL> insert into t(id) values (1);
insert into t(id) values (1)
*
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.PK_T) violated
SQL> select timestamp,statement,message from sperrorlog;
TIMESTAMP STATEMENT MESSAGE
------------------- -------------------------------------------------- --------------------------------------------------
2012-01-06 15:30:47. insert into t(id) values (1) ORA-00001: unique constraint (SCOTT.PK_T) violated
000000
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-714528/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20131121]12c sqlplus的set colinvisible on.txtSQL
- sqlplus set命令SQL
- sqlplus set命令使用SQL
- sqlplus常用set指令(轉)SQL
- cmd_sqlplus:set head off and set head onSQL
- SQLPLUS之set常用設定SQL
- Sqlplus下的set命令詳解SQL
- sqlplus 環境下部分set 命令SQL
- PLSQL Developer_v7_sqlplus:set head off and set head onSQLDeveloper
- sqlplus_set describe linenumSQL
- 11g sqlplus errorlogSQLError
- 11g SQLPLUS新增SHOW SPPARAMETER命令SQL
- oracle 10g sqlplus_set sqlprompt之妙用_ztOracle 10gSQL
- sqlplus : set autot traceonly vs pl/sql developer : F5SQLDeveloper
- [20190215]sqlplus set arraysize.txtSQL
- 【OH】SET System Variable Summary SQLPLUS 系統變數設定SQL變數
- Oracle 11g在redhat 5 sqlplus 錯誤OracleRedhatSQL
- goldengate 11g patch set 1的新特性Go
- [20221203]sqlplus set trimspool 問題.txtSQL
- [20170916]sqlplus set array最小2補充.txtSQL
- [20120410] sqlplus中set termout off.txtSQL
- 11g優化了sqlplus的glogin指令碼優化SQL指令碼
- [20221202]sqlplus set trimout 問題.txtSQL
- [20141216]sqlplus的set appinfo.txtSQLAPP
- [20120106]Extensibility Types.txt
- 11g啟動sqlplus報錯沒有許可權SQL
- [20181122]18c sqlplus set linesize.txtSQL
- [20120109]sqlplus 與set longchunksize 設定問題.txtSQLGC
- sqlplus login -- SP2-0750: You may need to set ORACLE_HOME to your Oracle software directorySQLOracle
- configuring Csscan in 10g and 11g (Database Character Set Scanner)_745809.1CSSDatabase
- Set
- set /?
- lombok get/set 與 JavaBean get/setLombokJavaBean
- [20211012]sqlnet.ora USE_DEDICATED_SERVER=on.txtSQLServer
- SQLPlusSQL
- SET NEWNAME FOR
- Jet Set
- set -e