参考:
https://eco.dameng.com/community/article/aa2c736f29722b7d820b1da9e483d659
手工修改dm.ini,添加参数配置 ENABLE_LOCAL_OSAUTH = 1
c
[dmdba@dbserver01 DM]$ pwd
/dm8/data/DM
[dmdba@dbserver01 DM]$ ls -l dm.ini
-rw-r--r-- 1 dmdba dinstall 73709 Jan 17 22:22 dm.ini
[dmdba@dbserver01 DM]$
[dmdba@dbserver01 DM]$ vi dm.ini # 添加以下内容至文件末尾:
ENABLE_LOCAL_OSAUTH = 1
重启数据库实例后,disql / as sysdba 方式登录数据库修改密码。
备注:此时可以用任意密码(甚至是错误密码)登录sysdba用户。
恢复数据库身份证验证模式,禁用操作系统身份证验证模式:
c
[dmdba@dbserver01 ~]$ disql / as sysdba
Server[LOCALHOST:5236]:mode is normal, state is open
login used time : 3.344(ms)
disql V8
SQL> alter user sys identified by dameng123;
executed successfully
used time: 44.092(ms). Execute id is 601.
SQL>
SQL> sp_set_para_value(2,'ENABLE_LOCAL_OSAUTH',0);
DMSQL executed successfully
used time: 2.082(ms). Execute id is 602.
SQL> host DmServiceDM restart
Stopping DmServiceDM: [ OK ]
Starting DmServiceDM: [ OK ]
SQL> connect sysdba/xxx@dm
[-2501]:Invalid username or password.
SQL>
SQL> connect sysdba/dameng123@dm
Server[192.168.101.179:5236]:mode is normal, state is open
login used time : 3.311(ms)
SQL>
SQL> select sysdate();
#此时,如果发现dm.ini文件末尾添加的配置(ENABLE_LOCAL_OSAUTH = 1)仍然存在,手工删除即可。