ITPub博客

首页 > 数据库 > Oracle > sqlplus无法登陆到ASM实例,报ORA-12547: TNS:lost contact错误

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

原创 Oracle 作者:xueshancheng 时间:2021-05-26 14:57:39 0 删除 编辑

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 ~]$ 


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69996316/viewspace-2774045/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
本人目前就职于北京海天起点技术服务股份有限公司,从事Oracle数据库有十几年了,对Oracle及goldengate比较精通。

注册时间:2021-03-11

  • 博文量
    60
  • 访问量
    68950