监听的instance status blocked分析
对于处于NOMOUNT状态的数据库,PMON还没有将服务注册到监听上,这个时候服务的状态是BLOCKED的,对于来自远程的任何连接
都会报ORA-12528错误。
如下:
都会报ORA-12528错误。
如下:
[oracle@dbtest ~]$ export ORACLE_SID=orcl
[oracle@dbtest ~]$ sqlplus / as sysdba
[oracle@dbtest ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 15 14:39:52 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------------------
STARTED
------------------------
STARTED
SQL> !
[oracle@dbtest ~]$ lsnrctl status
[oracle@dbtest ~]$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 15-NOV-2012 14:40:43
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER_dbtest
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
Start Date 02-NOV-2012 20:40:07
Uptime 12 days 18 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/oracle/product/db10gr2/network/admin/listener.ora
Listener Log File /u01/oracle/product/db10gr2/network/log/listener_dbtest.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.76)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.77)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status BLOCKED, has 1 handler(s) for this service...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
STATUS of the LISTENER
------------------------
Alias LISTENER_dbtest
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
Start Date 02-NOV-2012 20:40:07
Uptime 12 days 18 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/oracle/product/db10gr2/network/admin/listener.ora
Listener Log File /u01/oracle/product/db10gr2/network/log/listener_dbtest.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.76)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.77)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status BLOCKED, has 1 handler(s) for this service...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 11月 15 14:36:35 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12528: TNS: 监听程序: 所有适用例程都无法建立新连接
ORA-12528: TNS: 监听程序: 所有适用例程都无法建立新连接
请输入用户名:
ERROR:
ORA-12560: TNS: 协议适配器错误
请输入用户名:
ERROR:
ORA-12560: TNS: 协议适配器错误
SP2-0157: 在 3 次尝试之后无法连接到 ORACLE, 退出 SQL*Plus
PMON只有在MOUNT状态下才能将服务注册到监听器上。
SQL> alter database mount;
Database altered.
SQL> select status from v$instance;
STATUS
------------------------
MOUNTED
------------------------
MOUNTED
SQL> !
[oracle@dbtest ~]$ lsnrctl status
[oracle@dbtest ~]$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 15-NOV-2012 14:47:05
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER_dbtest
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
Start Date 02-NOV-2012 20:40:07
Uptime 12 days 18 hr. 6 min. 58 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/oracle/product/db10gr2/network/admin/listener.ora
Listener Log File /u01/oracle/product/db10gr2/network/log/listener_dbtest.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.76)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.77)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
STATUS of the LISTENER
------------------------
Alias LISTENER_dbtest
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
Start Date 02-NOV-2012 20:40:07
Uptime 12 days 18 hr. 6 min. 58 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/oracle/product/db10gr2/network/admin/listener.ora
Listener Log File /u01/oracle/product/db10gr2/network/log/listener_dbtest.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.76)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.77)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 11月 15 14:47:44 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
-------------------------------- ------------------------
orcl MOUNTED
-------------------------------- ------------------------
orcl MOUNTED
对于连接到NOMOUNT的数据库10G之前只能使用静态注册,10G之后除了使用静态注册之外,还有个更简单的方法。
如下所示:
SQL> startup force nomount
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
Total System Global Area 1.0737E+10 bytes
Fixed Size 2101912 bytes
Variable Size 1.0586E+10 bytes
Database Buffers 134217728 bytes
Redo Buffers 14671872 bytes
SQL> select instance_name,status from v$instance;
Fixed Size 2101912 bytes
Variable Size 1.0586E+10 bytes
Database Buffers 134217728 bytes
Redo Buffers 14671872 bytes
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
-------------------------------- ------------------------
orcl STARTED
-------------------------------- ------------------------
orcl STARTED
[oracle@dbtest ~]$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 15-NOV-2012 14:55:24
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER_dbtest
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
Start Date 02-NOV-2012 20:40:07
Uptime 12 days 18 hr. 15 min. 18 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/oracle/product/db10gr2/network/admin/listener.ora
Listener Log File /u01/oracle/product/db10gr2/network/log/listener_dbtest.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.76)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.77)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status BLOCKED, has 1 handler(s) for this service...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
STATUS of the LISTENER
------------------------
Alias LISTENER_dbtest
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
Start Date 02-NOV-2012 20:40:07
Uptime 12 days 18 hr. 15 min. 18 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/oracle/product/db10gr2/network/admin/listener.ora
Listener Log File /u01/oracle/product/db10gr2/network/log/listener_dbtest.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.76)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.77)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status BLOCKED, has 1 handler(s) for this service...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
TNS配置如下:
orcl=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.76)(PORT = 1521))
)
(CONNECT_DATA =
(service_name = orcl)
(SERVER = DEDICATED)
(UR=A)
)
)
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.76)(PORT = 1521))
)
(CONNECT_DATA =
(service_name = orcl)
(SERVER = DEDICATED)
(UR=A)
)
)
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 11月 15 14:53:53 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
-------------------------------- ------------------------
orcl STARTED
-------------------------------- ------------------------
orcl STARTED
TNS配置中加入UR=A选项即可,即使服务状态是BLOCKED。
这对于连接到Auxilary instance的时候非常有用,否则你只能采用OS认证方式。
人生有三宝:终身运动,终身学习,终身反醒.吸收新知,提高效率,懂得相处,成就自己,也成就他人,创造最高价值。