ORACLE STREAM ERROR
Subject: | Troubleshooting Streams Apply Error ORA-1403, ORA-26787 or ORA-26786 | |||
Doc ID: | Note:265201.1 | Type: | TROUBLESHOOTING | |
Last Revision Date: | 08-FEB-2008 | Status: | PUBLISHED |
SET SERVEROUTPUT ON;
DECLARE
lcr SYS.AnyData;
BEGIN
lcr := DBMS_APPLY_ADM.GET_ERROR_MESSAGE(3, '3.39.138135');
print_lcr(lcr);
END;
/
CREATE OR REPLACE PROCEDURE print_any (DATA IN ANYDATA)
IS
tn VARCHAR2 (61);
str VARCHAR2 (4000);
CHR VARCHAR2 (1000);
num NUMBER;
dat DATE;
rw RAW (4000);
res NUMBER;
BEGIN
IF DATA IS NULL THEN
DBMS_OUTPUT.put_line ('NULL value');
RETURN;
END IF;
tn := DATA.gettypename ();
IF tn = 'SYS.VARCHAR2' THEN
res := DATA.getvarchar2 (str);
DBMS_OUTPUT.put_line (SUBSTR (str, 0, 253));
ELSIF tn = 'SYS.CHAR' THEN
res := DATA.getchar (CHR);
DBMS_OUTPUT.put_line (SUBSTR (CHR, 0, 253));
ELSIF tn = 'SYS.VARCHAR' THEN
res := DATA.getvarchar (CHR);
DBMS_OUTPUT.put_line (CHR);
ELSIF tn = 'SYS.NUMBER' THEN
res := DATA.getnumber (num);
DBMS_OUTPUT.put_line (num);
ELSIF tn = 'SYS.DATE' THEN
res := DATA.getdate (dat);
DBMS_OUTPUT.put_line (dat);
ELSIF tn = 'SYS.RAW' THEN
res := data.GETRAW(rw);
DBMS_OUTPUT.PUT_LINE(SUBSTR(DBMS_LOB.SUBSTR(rw),0,253));
DBMS_OUTPUT.put_line ('BLOB Value');
ELSIF tn = 'SYS.BLOB' THEN
DBMS_OUTPUT.put_line ('BLOB Found');
ELSE
DBMS_OUTPUT.put_line ('typename is ' || tn);
END IF;
END print_any;
CREATE OR REPLACE PROCEDURE print_lcr (lcr IN ANYDATA)
IS
typenm VARCHAR2 (61);
ddllcr SYS.lcr$_ddl_record;
proclcr SYS.lcr$_procedure_record;
rowlcr SYS.lcr$_row_record;
res NUMBER;
newlist SYS.lcr$_row_list;
oldlist SYS.lcr$_row_list;
ddl_text CLOB;
ext_attr ANYDATA;
BEGIN
typenm := lcr.gettypename ();
DBMS_OUTPUT.put_line ('type name: ' || typenm);
IF (typenm = 'SYS.LCR$_DDL_RECORD') THEN
res := lcr.getobject (ddllcr);
DBMS_OUTPUT.put_line ( 'source database: ' || ddllcr.get_source_database_name);
DBMS_OUTPUT.put_line ('owner: ' || ddllcr.get_object_owner);
DBMS_OUTPUT.put_line ('object: ' || ddllcr.get_object_name);
DBMS_OUTPUT.put_line ('is tag null: ' || ddllcr.is_null_tag);
DBMS_LOB.createtemporary (ddl_text, TRUE);
ddllcr.get_ddl_text (ddl_text);
DBMS_OUTPUT.put_line ('ddl: ' || ddl_text);
-- Print extra attributes in DDL LCR
ext_attr := ddllcr.get_extra_attribute ('serial#');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('serial#: ' || ext_attr.accessnumber ());
END IF;
ext_attr := ddllcr.get_extra_attribute ('session#');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('session#: ' || ext_attr.accessnumber ());
END IF;
ext_attr := ddllcr.get_extra_attribute ('thread#');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('thread#: ' || ext_attr.accessnumber ());
END IF;
ext_attr := ddllcr.get_extra_attribute ('tx_name');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ( 'transaction name: ' || ext_attr.accessvarchar2 ());
END IF;
ext_attr := ddllcr.get_extra_attribute ('username');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('username: ' || ext_attr.accessvarchar2 ());
END IF;
DBMS_LOB.freetemporary (ddl_text);
ELSIF (typenm = 'SYS.LCR$_ROW_RECORD') THEN
res := lcr.getobject (rowlcr);
DBMS_OUTPUT.put_line ( 'source database: ' || rowlcr.get_source_database_name);
DBMS_OUTPUT.put_line ('owner: ' || rowlcr.get_object_owner);
DBMS_OUTPUT.put_line ('object: ' || rowlcr.get_object_name);
DBMS_OUTPUT.put_line ('is tag null: ' || rowlcr.is_null_tag);
DBMS_OUTPUT.put_line ('command_type: ' || rowlcr.get_command_type);
oldlist := rowlcr.get_values ('old');
FOR i IN 1 .. oldlist.COUNT LOOP
IF oldlist (i) IS NOT NULL THEN
DBMS_OUTPUT.put_line ('old(' || i || '): ' || oldlist (i).column_name);
print_any (oldlist (i).DATA);
END IF;
END LOOP;
newlist := rowlcr.get_values ('new', 'n');
FOR i IN 1 .. newlist.COUNT
LOOP
IF newlist (i) IS NOT NULL THEN
DBMS_OUTPUT.put_line ('new(' || i || '): ' || newlist (i).column_name);
print_any (newlist (i).DATA);
END IF;
END LOOP;
-- Print extra attributes in row LCR
ext_attr := rowlcr.get_extra_attribute ('row_id');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('row_id: ' || ext_attr.accessurowid ());
END IF;
ext_attr := rowlcr.get_extra_attribute ('serial#');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('serial#: ' || ext_attr.accessnumber ());
END IF;
ext_attr := rowlcr.get_extra_attribute ('session#');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('session#: ' || ext_attr.accessnumber ());
END IF;
ext_attr := rowlcr.get_extra_attribute ('thread#');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('thread#: ' || ext_attr.accessnumber ());
END IF;
ext_attr := rowlcr.get_extra_attribute ('tx_name');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ( 'transaction name: ' || ext_attr.accessvarchar2 ());
END IF;
ext_attr := rowlcr.get_extra_attribute ('username');
IF (ext_attr IS NOT NULL) THEN
DBMS_OUTPUT.put_line ('username: ' || ext_attr.accessvarchar2 ());
END IF;
ELSE
DBMS_OUTPUT.put_line ('Non-LCR Message with type ' || typenm);
END IF;
END print_lcr;
CREATE OR REPLACE PROCEDURE print_errors
IS
CURSOR c IS
SELECT local_transaction_id, source_database, message_number, message_count, error_number, error_message
FROM dba_apply_error
ORDER BY source_database, source_commit_scn;
i NUMBER;
txnid VARCHAR2 (30);
SOURCE VARCHAR2 (128);
msgno NUMBER;
msgcnt NUMBER;
errnum NUMBER := 0;
errno NUMBER;
errmsg VARCHAR2 (255);
lcr ANYDATA;
r NUMBER;
BEGIN
FOR r IN c LOOP
errnum := errnum + 1;
msgcnt := r.message_count;
txnid := r.local_transaction_id;
SOURCE := r.source_database;
msgno := r.message_number;
errno := r.error_number;
errmsg := r.error_message;
DBMS_OUTPUT.put_line('*************************************************');
DBMS_OUTPUT.put_line ('----- ERROR #' || errnum);
DBMS_OUTPUT.put_line ('----- Local Transaction ID: ' || txnid);
DBMS_OUTPUT.put_line ('----- Source Database: ' || SOURCE);
DBMS_OUTPUT.put_line ('----Error in Message: ' || msgno);
DBMS_OUTPUT.put_line ('----Error Number: ' || errno);
DBMS_OUTPUT.put_line ('----Message Text: ' || errmsg);
FOR i IN 1 .. msgcnt LOOP
DBMS_OUTPUT.put_line ('--message: ' || i);
lcr := DBMS_APPLY_ADM.get_error_message (i, txnid);
print_lcr (lcr);
END LOOP;
END LOOP;
END print_errors;
CREATE OR REPLACE PROCEDURE print_transaction (ltxnid IN VARCHAR2)
IS
i NUMBER;
txnid VARCHAR2 (30);
SOURCE VARCHAR2 (128);
msgno NUMBER;
msgcnt NUMBER;
errno NUMBER;
errmsg VARCHAR2 (128);
lcr ANYDATA;
BEGIN
SELECT local_transaction_id, source_database, message_number, message_count, error_number, error_message
INTO txnid, SOURCE, msgno, msgcnt, errno, errmsg
FROM dba_apply_error
WHERE local_transaction_id = ltxnid;
DBMS_OUTPUT.put_line ('----- Local Transaction ID: ' || txnid);
DBMS_OUTPUT.put_line ('----- Source Database: ' || SOURCE);
DBMS_OUTPUT.put_line ('----Error in Message: ' || msgno);
DBMS_OUTPUT.put_line ('----Error Number: ' || errno);
DBMS_OUTPUT.put_line ('----Message Text: ' || errmsg);
FOR i IN 1 .. msgcnt
LOOP
DBMS_OUTPUT.put_line ('--message: ' || i);
lcr := DBMS_APPLY_ADM.get_error_message (i, txnid); -- gets the LCR
print_lcr (lcr);
END LOOP;
END print_transaction;
SQL> SET SERVEROUTPUT ON SIZE 999999
SQL> EXEC print_errors
SET SERVEROUTPUT ON SIZE 999999
EXEC print_transaction('3.39.138135')
BEGIN
DBMS_APPLY_ADM.EXECUTE_ERROR(LOCAL_TRANSACTION_ID => '3.39.138135',EXECUTE_AS_USER => FALSE);
END;
SET SERVEROUTPUT ON;
DECLARE
lcr SYS.AnyData;
BEGIN
lcr := DBMS_APPLY_ADM.GET_ERROR_MESSAGE(1, '1.5.48006');
print_lcr(lcr);
END;
/
Subject: | Troubleshooting Streams Apply Error ORA-1403, ORA-26787 or ORA-26786 | |||
Doc ID: | Note:265201.1 | Type: | TROUBLESHOOTING | |
Last Revision Date: | 08-FEB-2008 | Status: | PUBLISHED |
http://download.oracle.com/docs/cd/B28359_01/server.111/b28322/troub_rep.htm#sthref703
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-242506/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- restart oracle streamRESTOracle
- oracle stream pool sizeOracle
- Oracle Stream概述與配置Oracle
- 【Jenkins】data stream error|Error cloning remote repo ‘origin‘ 錯誤解決JenkinsErrorREM
- UDI-03113: operation generated ORACLE error 3113OracleError
- oracle OGG-01232 Receive TCP params error:TCP/IP error 232(connection reset)OracleTCPError
- Oracle dataguard報錯:Error 1017 received logging on to the standbyOracleError
- 【ERROR】Oracle列印錯誤程式碼解釋ErrorOracle
- Sqoop從Oracle抽數錯:IO Error: Connection resetOOPOracleError
- [20230104]Oracle too many parse errors PARSE ERROR.txtOracleError
- Java-stream(1) Stream基本概念 & Stream介面Java
- Oracle索引修復 ,ORA-00600: internal error code, arguments: [6200],Oracle索引Error
- se://error/ Oracle 19c EM Exporess無法登陸ErrorOracle
- stream
- oracle ERROR: ORA-28002: 7 天之後口令將過期OracleError
- CentOS7.6安裝oracle 11.2.0.4 Error in invoking target 'agent nmhs' of makefileCentOSOracleError
- 使用dataX-stream2stream/stream2mysql/mysql2mysql/mysql2streamMySql
- Oracle 12C RAC的單機Standby returning error ORA-16191OracleError
- 連線oracle資料庫時,報錯:{dataSource-1} init errorOracle資料庫Error
- Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "問題ErrorOracleclient
- Oracle 19C OGG基礎運維-08Error code [942]Oracle運維Error
- Java StreamJava
- Stream流
- node stream
- elysia stream
- Stream APIAPI
- Oracle OER 7451 in Load Indicator : Error Code = OSD-04500的問題處理OracleIndicatorError
- [Javascript] Refactor blocking style code to stream style for fetching the stream dataJavaScriptBloC
- Java 8 StreamJava
- 深入node stream
- 聊聊 Redis StreamRedis
- centos stream 8CentOS
- Java Lambda StreamJava
- Stream瞭解
- Stream流求和
- stream常用操作
- [Java]Stream用法Java
- ERROR 2026 (HY000): SSL connection error: unknown error numberError