洋名字叫:ORA-12528: TNS:listener: all appropriate instances are blocking new connections
通过在CMD下用lsnrctl status 查看出的问题。
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lypch)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROCipc)))
Services Summary...
Service "LSExtProc" has 1 instance(s).
Instance "LSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ammicly" has 1 instance(s).
Instance "ammicly", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
注:ammicly 就是所谓的数据库实例。
上个图样。
显然我上面的图是正确的,而出错情况下为:
这个问题说明数据库没有Mount
连接数据库,发现:
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
用sqlplus /nolog
sql>connect [email=sys/ammic@amicly]sys/ammic@amicly[/email] as sysdba
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
连接的问题
1,可以通过修改listener.ora(该文件位于:{你的Oracle安装盘}:\app\administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN)的参数,把动态的参数设置为静态的参数,红色标注部分,然后从新启动监听,就OK
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.1.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ammicly)
(ORACLE_HOME = c:\oracle\product\10.1.0\db_1)
(SID_NAME = ammicly)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = lypch )(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
2,也可以通过修改tnsnames.ora文件(该文件位于:{你的Oracle安装盘}:\app\administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN)的参数,红色表注部分
# tnsnames.ora Network Configuration File: C:\oracle\product\10.1.0\db_1
\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
AMMICLY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = lypch )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ammicly)
(UR=A)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
然后 sqlplus /nolog
SQL>alter database mount;
SQL>alter database open;
这样就可以启动数据库了;
或者用Oradim -shutdown -sid ammicly -shuttype srvc,inst -shutmode immediate -syspwd ammic;关闭数据库
在用oradim -startup -sid ammicly -starttype srvc,inst -syspwd ammic;启动数据库解决;也可以在截面上从启动数据库服务来解决;