天天看點

監聽的instance status blocked分析

對于處于NOMOUNT狀态的資料庫,PMON還沒有将服務注冊到監聽上,這個時候服務的狀态是BLOCKED的,對于來自遠端的任何連接配接

都會報ORA-12528錯誤。

如下:

[oracle@dbtest ~]$ export ORACLE_SID=orcl

[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

SQL> !

[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

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-12560: TNS: 協定擴充卡錯誤

SP2-0157: 在 3 次嘗試之後無法連接配接到 ORACLE, 退出 SQL*Plus

PMON隻有在MOUNT狀态下才能将服務注冊到監聽器上。

SQL> alter database mount;

Database altered.

MOUNTED

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 15-NOV-2012 14:47:05

Uptime                    12 days 18 hr. 6 min. 58 sec

  Instance "ORCL", status READY, has 1 handler(s) for this service...

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 11月 15 14:47:44 2012

連接配接到:

SQL> select instance_name,status from v$instance;

INSTANCE_NAME                    STATUS

-------------------------------- ------------------------

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

orcl                             STARTED

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 15-NOV-2012 14:55:24

Uptime                    12 days 18 hr. 15 min. 18 sec

TNS配置如下:

orcl=

  (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

TNS配置中加入UR=A選項即可,即使服務狀态是BLOCKED。

這對于連接配接到Auxilary instance的時候非常有用,否則你隻能采用OS認證方式。