问题如下:
centos 8 最小版安装完oracle 18c或者19c以后,使用sqlplus登录或者退出回返回问号。
提示如下:
[oracle@localhost dbhome_1]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Dec 11 09:16:06 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn /as sysdba
????
SQL> quit
? Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0 ??
解决方案:
[#zeyu#]
修改Oracle用户的环境变量,执行命令:
vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=ORCLCDB
export NLS_LANG=american_america.AL32UTF8
# User specific environment and startup programs
执行完毕后,执行命令:
source ~/.bash_profile
[/#zeyu#]
重新使用sqlplus登录即可正常。