Oracle ORA-03137: TTC protocol internal error : [12333] 故障分析

本文介绍了一个关于JDBC连接Oracle数据库时出现ORA-03137[12333]错误的问题及解决方案。此问题与Bug9445675有关,当使用特定版本的JDBC驱动时可能出现。文章详细记录了错误日志,并提供了升级JDBC驱动版本的解决办法。


程序通过JDBC 连接数据库异常,报 ORA-03137[12333]的错误。

当前程序的JDBC 驱动版本:ojdbc16-11.2.0.1.0.jar

数据库版本: 11.2.0.3

一. Log 信息

1.1 alert log

TNS-12637: Packet receive failed

ns secondary err code: 12532

nt main err code: 0

nt secondary err code: 0

nt OS err code: 0

opiodr aborting process unknown ospid(28518) as a result of ORA-609

Fri Aug 09 15:41:20 2013

Errors in file /u01/app/oracle/diag/rdbms/tserpdb/tserpdb/trace/tserpdb_ora_28329.trc (incident=60746):

ORA-03137: TTC protocolinternal error : [12333] [19] [3] [14] [] [] [] []

Incident details in:/u01/app/oracle/diag/rdbms/tserpdb/tserpdb/incident/incdir_60746/tserpdb_ora_28329_i60746.trc

Fri Aug 09 15:41:21 2013

Sweep [inc][60746]: completed

Sweep [inc2][60746]: completed

Fri Aug 09 15:41:21 2013

Dumping diagnostic data indirectory=[cdmp_20130809154121], requested by (instance=1, osid=28329),summary=[incident=60746].

Fri Aug 09 15:59:42 2013

1.2 trace 文件

Dump file/u01/app/oracle/diag/rdbms/tserpdb/tserpdb/incident/incdir_60746/tserpdb_ora_28329_i60746.trc

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

and Real Application Testing options

ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1

System name: Linux

Node name: sh-tsiagent-003180

Release: 2.6.18-308.el5

Version: #1SMP Tue Feb 21 20:06:06 EST 2012

Machine: x86_64

Instance name: tserpdb

Redo thread mounted by this instance: 1

Oracle process number: 92

Unix process pid: 28329, image:oracle@sh-tsiagent-003180

*** 2013-08-09 15:41:20.138

*** SESSION ID:(1911.53519) 2013-08-0915:41:20.138

*** CLIENT ID:() 2013-08-09 15:41:20.138

*** SERVICE NAME:(tsdb3180.develop)2013-08-09 15:41:20.138

*** MODULE NAME:(JDBC Thin Client)2013-08-09 15:41:20.138

*** ACTION NAME:() 2013-08-09 15:41:20.138

Dump continued from file:/u01/app/oracle/diag/rdbms/tserpdb/tserpdb/trace/tserpdb_ora_28329.trc

ORA-03137: TTC protocol internal error :[12333] [19] [3] [14] [] [] [] []

========= Dump for incident 60746 (ORA 3137[12333]) ========

*** 2013-08-09 15:41:20.139

dbkedDefDump(): Starting incident defaultdumps (flags=0x2, level=3, mask=0x0)

----- Current SQL Statement for thissession (sql_id=35tr4jfq0x3jw) -----

select mpzone0_.ZONEID as ZONEID83_0_,mpzone0_.AREACODE as AREACODE83_0_, mpzone0_.CARDTYPE as CARDTYPE83_0_,mpzone0_.city as city83_0_, mpzone0_.province as province83_0_ fromIAGENT.MPZONE mpzone0_ where mpzone0_.ZONEID=:1

----- Call Stack Trace -----

calling call entry argument values in hex

location type point (? means dubious value)

-------------------- ---------------------------- ----------------------------

skdstdst()+36 callkgdsdst() 000000000 ?000000000 ?

7FFF91403248 ? 000000001 ?

000000001 ?000000002 ?

__libc_start_main() callmain() 000000002 ?7FFF91414458 ?

+244000000001 ? 000000000 ?

009B910C0 ? 000000000 ?

_start()+36 call __libc_start_main() 000A0AF38 ? 000000002 ?

7FFF91414448 ? 000000000 ?

009B910C0 ? 000000002 ?

--------------------- Binary Stack Dump---------------------

========== FRAME [1] (skdstdst()+36 ->kgdsdst()) ==========

defined by frame pointers0x7fff91407b00 and 0x7fff91407af0

CALL TYPE: call ERROR SIGNALED: no COMPONENT: (null)

RDI 0000000000000000 RSI 0000000000000000RDX 00007FFF91403248

RCX 0000000000000001 R8 0000000000000001 R90000000000000002

RAX 0000000000000000 RBX 0000000000000003RBP 00007FFF91407B00

R10 00007FFF913FFA80 R11 0000000000000000R12 0000000000000003

R13 0000000000000002 R14 0000000000000000R15 0000000000000001

RSP 00007FFF91407B00 RIP 0000000006772B38

Dump of memory from 0x7fff91407af0 to0x7fff91407b00

7FFF91407AF0 91407B00 00007FFF 06772B3D00000000 [.{@.....=+w.....]

========== FRAME [2] (ksedst1()+98 ->skdstdst()) ==========

defined by frame pointers0x7fff91407bb0 and 0x7fff91407b00

CALL TYPE: call ERROR SIGNALED: no COMPONENT: KSE

1.3 Java 错误

org.springframework.transaction.TransactionSystemException:Could not commit Hibernate transaction; nested exception isorg.hibernate.TransactionException: JDBC commit failed

org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:660)

org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)

org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)

org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:394)

.

.

.

java.sql.SQLRecoverableException:No more data to read from socket

oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1200)

oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)

oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)

oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)

oracle.jdbc.driver.T4C7Ocommoncall.doOCOMMIT(T4C7Ocommoncall.java:75)

oracle.jdbc.driver.T4CConnection.doCommit(T4CConnection.java:558)

oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3674)

oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3680)

org.apache.tomcat.dbcp.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)

org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211)

org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:166)

二.解决方法

在MOS上搜了一下,该问题与Bug9445675 非常像。

Bug 9445675 NO MOREDATA TO READ FROM SOCKET WHEN USING END-TO-END METRICS

This bug does affect the JDBC driver.This bug may be the cause when all of the following conditions are met:

1)You are using the 10.1.x.x orthe 11.2.0.1 JDBC driver; the bug does not affect 10.2.x.x, or 11.1.x.xversions of the driver, nor versions 11.2.0.2 or above

2)You are using end-to-endmetrics in your Java code

3)The server side ORA-3137[12333] error is accompanied by the client side Java exception "No moredata to read from socket"

This bug is fixed in the11.2.0.2 version of the JDBC driver and above.

而当前版本的JDBC Driver 也是:11.2.0.1.0。 所以将JDBC DRIVER升级到11.2.0.2 之后,故障解决。

参考MOS

Understanding and Diagnosing ORA-00600[12333] ORA-3137 [12333] Errors (文档 ID 389713.1)

ORA-03137 TTC Protocol Internal Error [12333] Using JDBC Driver (文档 ID 752297.1)

Troubleshooting ORA-3137 [12333] ErrorsEncountered When Using Oracle JDBC Driver (文档 ID1361107.1)

--------------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

QQ: 251097186

Skype: tianlesoftware

Email: tianlesoftware@gmail.com

Blog: http://blog.youkuaiyun.com/tianlesoftware

Weibo: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware

在创建Oracle Spatial索引时,遇到的ORA-29855、ORA-13249、ORA-13200、ORA-13206和ORA-13365错误通常与空间索引的配置、元数据不一致或底层数据库对象的损坏有关。以下是对这些错误的详细分析和解决方案: ### ORA-29855: Error occurred in the execution of ODCIINDEXCREATE routine 该错误表明在创建域索引(如空间索引)时,底层的`ODCIIndexCreate`方法执行失败。常见于空间索引创建失败的场景中,通常由后续错误链中的具体错误引发,例如ORA-13249[^1]。 ### ORA-13249: internal error in Spatial index: [mdsys.mditopology] 该错误表示在空间索引构建过程中,内部拓扑结构处理失败。常见于空间元数据不一致、几何对象损坏或索引参数配置不当的情况。例如,用户定义的空间表未正确注册到`USER_SDO_GEOM_METADATA`视图中,或几何对象的SRID不一致[^1]。 ### ORA-13200: Physical storage parameters are invalid for the spatial index 此错误通常发生在空间索引的物理存储参数(如`TABLESPACE`、`INITIAL`、`NEXT`等)配置不合法时。例如,表空间不存在、存储参数值不合理或索引分区定义错误。应检查索引创建语句中的存储参数是否符合Oracle的限制。 ### ORA-13206: internal error in spatial index creation 该错误表示在空间索引构建过程中出现内部错误,通常与数据质量问题有关。例如,几何对象包含非法坐标、多边形不闭合或存在自相交等问题。建议使用`SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT`函数验证数据的完整性[^1]。 ### ORA-13365: layer does not exist 此错误表明在创建空间索引时,指定的空间图层(即对应的几何列)未正确注册到Oracle Spatial元数据中。应确保几何列已在`USER_SDO_GEOM_METADATA`中正确定义,并且其`TABLE_NAME`和`COLUMN_NAME`与实际表和列名一致。 ### 解决方案示例 1. **验证几何数据的完整性**: 使用以下SQL语句验证几何列的数据是否有效: ```sql SELECT b.geometry, SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(b.geometry, 0.005) FROM your_table b; ``` 如果返回非`TRUE`的结果,则需修复对应的几何对象。 2. **检查空间元数据注册**: 确保几何列已在`USER_SDO_GEOM_METADATA`中注册: ```sql SELECT * FROM USER_SDO_GEOM_METADATA WHERE TABLE_NAME = 'YOUR_TABLE'; ``` 如果未注册,需使用以下语句添加: ```sql INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) VALUES ('YOUR_TABLE', 'GEOMETRY_COLUMN', MDSYS.SDO_DIM_ARRAY( MDSYS.SDO_DIM_ELEMENT('X', 0, 100, 0.005), MDSYS.SDO_DIM_ELEMENT('Y', 0, 100, 0.005)), 8307); ``` 3. **调整索引存储参数**: 检查并调整空间索引的存储参数,确保表空间存在且参数合理: ```sql CREATE INDEX idx_spatial ON your_table(geometry_column) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('tablespace=USERS storage(initial 1M next 1M)'); ``` 4. **重建空间索引**: 如果索引已存在但出现错误,可尝试删除并重新创建: ```sql DROP INDEX idx_spatial; CREATE INDEX idx_spatial ON your_table(geometry_column) INDEXTYPE IS MDSYS.SPATIAL_INDEX; ``` 5. **检查模式名称长度**: 如果使用`st_geometry`类型(如ArcGIS环境),需注意模式名称和索引名称的总长度不应超过32个字符,以避免内部变量溢出导致的错误。 ### 总结 上述错误通常与空间数据质量、元数据配置或索引参数设置不当有关。通过验证几何数据完整性、正确注册元数据、合理配置存储参数及避免模式名称过长等措施,可有效解决这些问题。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值