问题现象如下
[oracle@tyj ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 22 21:56:28 2019
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-01041: internal error. hostdef extension doesn't exist
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@tyj ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 22 21:56:39 2019
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> conn /as sysdba
ERROR:
ORA-01041: internal error. hostdef extension doesn't exist
SQL> exit
这种情况有可能是共享内存问题导致的
[oracle@tyj ~]$ ipcs -mpt --查看共享内存
------ Shared Memory Attach/Detach/Change Times --------
shmid owner attached detached changed
65537 oracle Jan 22 21:56:44 Jan 22 21:56:44 Jan 22 16:59:24
[oracle@tyj ~]$ sysresv -l dspdb ---查看与实例名关联的共享内存
IPC Resources for ORACLE_SID "dspdb" :
Shared Memory:
ID KEY
65537 0x95bfdcbc --就是这里
Semaphores:
ID KEY
163842 0x6874b294
196611 0x6874b295
229380 0x6874b296
262149 0x6874b297
294918 0x6874b298
327687 0x6874b299
360456 0x6874b29a
393225 0x6874b29b
425994 0x6874b29c
Oracle Instance alive for sid "dspdb"
[oracle@tyj bin]$ ipcrm -m 65537 --用ipcrm命令删除
[oracle@tyj bin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 22 22:50:40 2019
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
搞定了,详细参考这篇文章:https://oracle-base.com/articles/misc/ora-01041-internal-error-hostdef-extension-doesnt-exist