Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2898260
  • 博文数量: 599
  • 博客积分: 16398
  • 博客等级: 上将
  • 技术积分: 6875
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-30 12:04
个人简介

WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606

文章分类

全部博文(599)

文章存档

2014年(12)

2013年(56)

2012年(199)

2011年(105)

2010年(128)

2009年(99)

分类: Oracle

2012-11-15 14:57:09

 

对于处于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
C:\>sqlplus as sysdba
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: 监听程序: 所有适用例程都无法建立新连接

请输入用户名:
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
SQL> !
[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
C:\>sqlplus as sysdba
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

对于连接到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;
INSTANCE_NAME                    STATUS
-------------------------------- ------------------------
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...
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)
    )
)

C:\>sqlplus as sysdba
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
TNS配置中加入UR=A选项即可,即使服务状态是BLOCKED。
这对于连接到Auxilary instance的时候非常有用,否则你只能采用OS认证方式。
阅读(1779) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~