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/ ,如需转载,请注明出处,否则将追究法律责任。