合 连接Oracle数据库报错“Segmentation fault (core dumped)”
Tags: Oracle故障处理环境变量straceNLS_LANGSegmentation fault (core dumped)
环境
服务器:12.2.0.1.0 64位
客户端:9.2.0.1.0 32位
现象
如果密码输入正确,则返回“Segmentation fault (core dumped)”;如果密码输入错误,则返回“ORA-01017: invalid username/password; logon denied”,但是,使用另一个用户shop,登陆的时候,却可以登陆。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | [oracle@ecs-ora-0001 ~]$ sqlplus system/oracle123@ora91 SQL*Plus: Release 9.2.0.1.0 - Production on Fri Jan 7 14:51:54 2022 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Segmentation fault (core dumped) [oracle@ecs-ora-0001 ~]$ sqlplus system/oracle@ora91 SQL*Plus: Release 9.2.0.1.0 - Production on Fri Jan 7 15:01:19 2022 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. ERROR: ORA-01017: invalid username/password; logon denied Enter user-name: ^C [oracle@ecs-ora-0001 ~]$ [root@ecs-ora-0001 ~]# su - shop Last login: Fri Jan 7 14:48:44 CST 2022 on pts/5 [shop@ecs-ora-0001 ~]$ sqlplus system/oracle123@ora91 SQL*Plus: Release 9.2.0.1.0 - Production on Fri Jan 7 14:51:03 2022 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> set line 1000 SQL> select * from v$version; BANNER CON_ID ------------------------------------------------------------------------------ ---------- Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0 PL/SQL Release 12.2.0.1.0 - Production 0 CORE 12.2.0.1.0 Production 0 TNS for Linux: Version 12.2.0.1.0 - Production 0 NLSRTL Version 12.2.0.1.0 - Production 0 |
所以,说明客户端没有问题,否则换一个用户登陆也会报错,那很可能问题就出在环境变量的配置上了。
解决
经过比对环境变量,发现,oracle用户比shop用户少了一个NLS_LANG
的变量。配置如下任意一个,即可:
1 2 | export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 |
过程: