1、达梦数据安装之后无法在终端输入disql命令解决办法:
解决:.bash_profile需要配置安装目录,并且确保$DM_HOME/tool写在了$DM_HOME/bin的后面;
文件中需要追加:
--检查环境变量, 达梦数据库默认安装位置:opt/dmdbms
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/dmdbms/bin"
export DM_HOME="/opt/dmdbms"
export PATH=$DM_HOME/bin:$DM_HOME/tool:$PATH
文件保存之后,终端执行:source .bash_profile 命令之后,终端就可以正确调用disql命令了;
--测试登录正常
scadahis@scada-his1:~$ disql SYSDBA/SYSDBA
[-2501]:用户名或密码错误.
disql V7.6.1.94-Build(2021.04.15-137745-10005)CTM
用户名:
密码:
[-2501]:用户名或密码错误.
用户名:SYSDBA
密码:
服务器[LOCALHOST:5236]:处于普通打开状态
登录使用时间: 3.334(毫秒)
SQL> select name,status$ from v$instance;
行号 NAME STATUS$
---------- -------- -------
1 DMSERVER OPEN
已用时间: 2.631(毫秒). 执行号:377.
SQL> exit
2、达梦数据库在使用disql登录时,显示“未连接”
指定了IP和端口号还是连接异常
[scadahis@scadahis~]$ disql sysdba/Dameng123
SQL> select * from v$instances;
未连接
SQL> exit
[scadahis@scadahis~]$ disql sysdba/Dameng123@localhost:5236
SQL> select * from v$instances;
未连接
SQL> EXIT
[scadahis@scadahis~]$ disql sysdba/Dameng123@127.0.0.1:5236
SQL> select * from v$instances;
未连接
SQL> exit
[scadahis@scadahis~]$
查看安装目录数据库的配置信息:
scadahis@scada-his1:/opt/dmdbms/data/DAMENG$ cat dm.ini |grep PORT
PORT_NUM = 5236 #Port number on which the database server will listen
ELOG_REPORT_LINK_SQL = 0 #Whether to write the SQLs that sent to remote database by DBLINKs into error log file
EXTERNAL_JFUN_PORT = 6363 #DmAgent port for external java fun.
DCRS_PORT_NUM = 6236 #Port number on which the database dcrs will listen
AP_PORT_NUM = 0 #Port number on which the database ap will listen
DW_UDP_PORT = 0 #Dmwatch udp port
INST_UDP_PORT = 0 #Instance udp port
DW_PORT = 0 #Instance tcp port for watch2
DCP_PORT_NUM = 5237 #Port number on which DCP will listen
HA_INST_CHECK_PORT = 65534 #HA instance check port
scadahis@scada-his1:/opt/dmdbms/data/DAMENG$