sqlplus无法登陆到ASM实例,报ORA-12547: TNS:lost contact错误

来源:这里教程网 时间:2026-03-03 16:43:34 作者:

1 发现无法登陆ASM实例 [grid@host02 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 26 09:46:22 2019 Version 19.4.0.0.0 Copyright (c) 1982, 2019, Oracle.  All rights reserved. ERROR: ORA-12547: TNS:lost contact Enter user-name: ^C 2 查看环境变量,发现没有配置LD_LIBRARY_PATH,增加LD_LIBRARY_PATH环境变量 [grid@host02 ~]$ cat .bash_profile  # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then         . ~/.bashrc fi # User specific environment and startup programs export PATH export TZ=Asia/Shanghai export ORACLE_SID=+ASM2 export ORACLE_BASE=/u01/app/grid export GRID_HOME=/u01/app/19.0.0.0/grid / export PATH=$GRID_HOME/OPatch:$GRID_HOME/bin:$PATH export ORACLE_HOME=/u01/app/19.0.0.0/grid/ 3 再次检查LD_LIBRARY_PATH,发现多一个/反斜杠 [grid@host02 ~]$ echo $LD_LIBRARY_PATH /u01/app/19.0.0.0/grid //lib:/lib:/usr/lib 4 再次编辑.bash_profile [grid@host02 ~]$ vi .bash_profile  # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then         . ~/.bashrc fi # User specific environment and startup programs export PATH export TZ=Asia/Shanghai export ORACLE_SID=+ASM2 export ORACLE_BASE=/u01/app/grid export GRID_HOME=/u01/app/19.0.0.0/grid export PATH=$GRID_HOME/OPatch:$GRID_HOME/bin:$PATH export ORACLE_HOME=/u01/app/19.0.0.0/grid export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 4 使用sqlplus登录成功 [grid@host02 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 26 09:47:44 2019 Version 19.4.0.0.0 Copyright (c) 1982, 2019, Oracle.  All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.4.0.0.0 SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.4.0.0.0 [grid@host02 ~]$ 

相关推荐