ORA-02248

遇到一个ora-02248: invalid option for ALTER SESSION的错误.环境是
java/10g instant client连接到
Oracle 9206 数据库发生的

Java 报告的错误:

WARN support.SQLErrorCodesFactory – Error while extracting database product name – falling back to empty error codes
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00604: error occurred at recursive SQL level 1
ORA-02248: invalid option for ALTER SESSION
)

当时连接不到网络,上不去Metalink,只好托Donny帮忙查一下,信息不太多.
后来自己没有办法,只好死马当作活马医,设置Event跟踪.发现正常的连接有如下类似的操作:


ALTER SESSION SET NLS_LANGUAGE= ‘AMERICAN’ NLS_TERRITORY= ‘AMERICA’ NLS_CURRENCY= ‘$’

NLS_ISO_CURRENCY= ‘AMERICA’ NLS_NUMERIC_CHARACTERS= ‘.,’ NLS_CALENDAR= ‘GREGORIAN’ NLS_DATE_FORMAT= ‘DD-MON-RR’
NLS_DATE_LANGUAGE= ‘AMERICAN’ NLS_SORT= ‘BINARY’ TIME_ZONE= ‘+08:00′ NLS_DUAL_CURRENCY = ‘$’ NLS_TIME_FORMAT = ‘HH.MI.SSXFF AM’
NLS_TIMESTAMP_FORMAT = ‘DD-MON-RR HH.MI.SSXFF AM’
NLS_TIME_TZ_FORMAT = ‘HH.MI.SSXFF AM TZR’
NLS_TIMESTAMP_TZ_FORMAT = ‘DD-MON-RR HH.MI.SSXFF AM TZR’
END OF STMT

而出错的连接有如下的Trace信息:

ALTER SESSION SET NLS_LANGUAGE= ‘SIMPLIFIED CHINESE’ NLS_TERRITORY= ‘CHINA’ NLS_CURRENCY= ‘£¿ NLS_ISO_CURRENCY= ‘CHINA’ NLS_NUMERIC_CHARACTERS= ‘.,’ NLS_CALENDAR= ‘GREGORIAN’ NLS_DATE_FORMAT= ‘DD-MON-RR’ NLS_DATE_LANGUAGE= ‘SIMPLIFIED CHINESE’
NLS_SORT= ‘BINARY’ TIME_ZONE= ‘+08:00′ NLS_COMP=’BINARY’ NLS_DUAL_CURRENCY = ‘£¿
NLS_TIME_FORMAT = ‘HH.MI.SSXFF AM’
NLS_TIMESTAMP_FORMAT = ‘DD-MON-RR HH.MI.SSXFF AM’
NLS_TIME_TZ_FORMAT = ‘HH.MI.SSXFF AM TZR’
NLS_TIMESTAMP_TZ_FORMAT = ‘DD-MON-RR HH.MI.SSXFF AM TZR’

修改NLS_LANG之后即可正常登录数据库

Google+
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值