侦听服务出现blocked状态


今天在用rman做standby数据库时,连接auxiliary数据库报错以下信息:

连接到目标数据库: ORALOCAL (DBID=3856983144)
 
RMAN> connect auxiliary sys/sys@standby
 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-04006: error from auxiliary database: ORA-12541: TNS: 没有监听器

去查了一下备机的侦听,由于是采用动态注册,先启动了侦听,再启动instance,当时pmon还没实现动态注册,需要等待1分钟左右的时间,发现oralocal的服务已经出现,就再次用rman连接,发现出现了另外一个报错:

RMAN> connect auxiliary sys/sys@standby
 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-04006: error from auxiliary database: ORA-12523: TNS: 监听程序未找到适用于客户机连接的例程

仔细检查了一下侦听的状态,发现其service是blocked的状态:

……
Service "oralocal" has 1 instance(s).
 
Instance "oralocal", status BLOCKED, has 1 handler(s) for this service...
……

奇怪,如果在listener.ora中如果没有出现sid_desc的话,应该也可以实现动态注册的呀,问题现在确实实现的动态注册,但是状态却是blocked,客户端是无法连接的。尝试修改listener.ora为静态注册后,恢复正常。

为了测试这个猜想,再次oradim了一个oratest的服务:

oradim -new -sid oratest
并且建立好
init文件
 
C:\Documents and Settings\Administrator>set oracle_sid=oratest
 
SQL> startup nomount pfile='?/database/initoratest.ora'
ORACLE 例程已经启动。
 
Total System Global Area  139533192 bytes
Fixed Size                   453512 bytes
Variable Size             109051904 bytes
Database Buffers           29360128 bytes
Redo Buffers                 667648 bytes
SQL>
SQL> show parameter name
 
NAME                                 TYPE                   VALUE
----------------------------------
-- ---------------------- ------------------------------
db_file_name_convert                 string
db_name                              string                 oratest
global_names                         boolean                FALSE
instance_name                        string                 oratest
lock_name_space                      string
log_file_name_convert                string
oracle_trace_collection_name         string
oracle_trace_facility_name           string                 oracled
plsql_native_make_file_name          string
service_names                        string                 oratest
SQL> exit
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production中断开
 
C:\Documents and Settings\Administrator>
C:\Documents and Settings\Administrator>lsnrctl status
 
LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-11月-2007 23:58:25
 
Copyright (c) 1991, 2002, Oracle CorporationAll rights reserved.
 
正在连接到
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=userhostname)(PORT=1521)))
LISTENERSTATUS
----------------------
--
别名                      LISTENER

版本                     
TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
启动日期                 
13-11月-2007 21:35:04
正常运行时间             
02 小时 2322
跟踪级别                 
off
安全性                   
OFF
SNMP                      OFF
监听器参数文件         
d:\oracle\ora92\network\admin\listener.ora
监听器日志文件         
d:\oracle\ora92\network\log\listener.log
监听端点概要...
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=1521)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=8080))(Presentation=HTTP)(Session=RAW))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=2100))(Presentation=FTP)(Session=RAW))
服务摘要..
服务
"OEMREP" 包含 1 个例程。
  例程
"OEMREP", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"PLSExtProc" 包含 1 个例程。
  例程
"PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"oralocal" 包含 2 个例程。
  例程
"oralocal", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
  例程
"oralocal", 状态 READY, 包含此服务的 1 个处理程序...
服务
"oralocalXDB" 包含 1 个例程。
  例程
"oralocal", 状态 READY, 包含此服务的 1 个处理程序...
服务
"orarman" 包含 1 个例程。
  例程
"orarman", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"oratest" 包含 1 个例程。
  例程
"oratest", 状态 BLOCKED, 包含此服务的 1 个处理程序...
命令执行成功
 
C:\Documents and Settings\Administrator>
C:\Documents and Settings\Administrator>
C:\Documents and Settings\Administrator>
C:\Documents and Settings\Administrator>lsnrctl stop
 
LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-11月-2007 23:59:48
 
Copyright (c) 1991, 2002, Oracle CorporationAll rights reserved.
 
正在连接到
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=userhostname)(PORT=1521)))
命令执行成功
 
C:\Documents and Settings\Administrator>lsnrctl start
 
LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-11月-2007 23:59:55
 
Copyright (c) 1991, 2002, Oracle CorporationAll rights reserved.
 
启动
tnslsnr:请稍候...
 
TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
系统参数文件为
d:\oracle\ora92\network\admin\listener.ora
写入
d:\oracle\ora92\network\log\listener.log的日志信息
监听:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=1521)))
监听:
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
 
正在连接到
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=userhostname)(PORT=1521)))
LISTENERSTATUS
----------------------
--
别名                      LISTENER

版本                     
TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
启动日期                 
13-11月-2007 23:59:55
正常运行时间             
00 小时 00
跟踪级别                 
off
安全性                   
OFF
SNMP                      OFF
监听器参数文件         
d:\oracle\ora92\network\admin\listener.ora
监听器日志文件         
d:\oracle\ora92\network\log\listener.log
监听端点概要...
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=1521)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
服务摘要..
服务
"OEMREP" 包含 1 个例程。
  例程
"OEMREP", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"PLSExtProc" 包含 1 个例程。
  例程
"PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"oralocal" 包含 1 个例程。
  例程
"oralocal", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"orarman" 包含 1 个例程。
  例程
"orarman", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
 
C:\Documents and Settings\Administrator>lsnrctl status
 
LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 14-11月-2007 00:00:01
 
Copyright (c) 1991, 2002, Oracle CorporationAll rights reserved.
 
正在连接到
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=userhostname)(PORT=1521)))
LISTENERSTATUS
----------------------
--
别名                      LISTENER

版本                     
TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
启动日期                 
13-11月-2007 23:59:55
正常运行时间             
00 小时 05
跟踪级别                 
off
安全性                   
OFF
SNMP                      OFF
监听器参数文件         
d:\oracle\ora92\network\admin\listener.ora
监听器日志文件         
d:\oracle\ora92\network\log\listener.log
监听端点概要...
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=1521)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
服务摘要..
服务
"OEMREP" 包含 1 个例程。
  例程
"OEMREP", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"PLSExtProc" 包含 1 个例程。
  例程
"PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"oralocal" 包含 1 个例程。
  例程
"oralocal", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"orarman" 包含 1 个例程。
  例程
"orarman", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
 
(等待一分钟左右的时间)
 
C:\Documents and Settings\Administrator>lsnrctl status
 
LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 14-11月-2007 00:01:15
 
Copyright (c) 1991, 2002, Oracle CorporationAll rights reserved.
 
正在连接到
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=userhostname)(PORT=1521)))
LISTENERSTATUS
----------------------
--
别名                      LISTENER

版本                     
TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
启动日期                 
13-11月-2007 23:59:55
正常运行时间             
00 小时 119
跟踪级别                 
off
安全性                   
OFF
SNMP                      OFF
监听器参数文件         
d:\oracle\ora92\network\admin\listener.ora
监听器日志文件         
d:\oracle\ora92\network\log\listener.log
监听端点概要...
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=1521)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=8080))(Presentation=HTTP)(Session=RAW))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=userhostname)(PORT=2100))(Presentation=FTP)(Session=RAW))
服务摘要..
服务
"OEMREP" 包含 1 个例程。
  例程
"OEMREP", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"PLSExtProc" 包含 1 个例程。
  例程
"PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"oralocal" 包含 2 个例程。
  例程
"oralocal", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
  例程
"oralocal", 状态 READY, 包含此服务的 1 个处理程序...
服务
"oralocalXDB" 包含 1 个例程。
  例程
"oralocal", 状态 READY, 包含此服务的 1 个处理程序...
服务
"orarman" 包含 1 个例程。
  例程
"orarman", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务
"oratest" 包含 1 个例程。
  例程
"oratest", 状态 BLOCKED, 包含此服务的 1 个处理程序...
命令执行成功
 
C:\Documents and Settings\Administrator>

我们发现oratest是blocked状态,故障重现。

是否是因为在win下使用oradim新建service引起的呢?我们在unix环境下测试看看情况如何:

$ export ORACLE_SID=oratest
$
sqlplus "/ as sysdba"
 
SQL*Plus: Release 9.2.0.1.0 - Production on Wed Nov 14 00:19:15 2007
 
Copyright (c) 1982, 2002, Oracle CorporationAll rights reserved.
 
Connected to an idle instance.
 
SQL> startup nomount pfile='?/dbs/initoratest.ora'
ORACLE instance started.
 
Total System Global Area 1076850392 bytes
Fixed Size                   736984 bytes
Variable Size             285212672 bytes
Database Buffers          788529152 bytes
Redo Buffers                2371584 bytes
SQLhost
$
lsnrctl status
 
LSNRCTL for HPUX: Version 9.2.0.1.0 - Production on 14-NOV-2007 00:21:00
 
Copyright (c) 1991, 2002, Oracle CorporationAll rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
----------------------
--
Alias                     LISTENER

Version                   TNSLSNR for HPUX: Version 9.2.0.1.0 - Production
Start Date                02-NOV-2007 09:44:27
Uptime                    11 days 14 hr. 36 min. 34 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /oracle/product/9.2.0.4/network/admin/listener.ora
Listener Log File         /oracle/product/9.2.0.4/network/log/listener.log
Listening Endpoints Summary...
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HP189)(PORT=1521)))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HP189)(PORT=8080))(Presentation=HTTP)(Session=RAW))
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HP189)(PORT=2100))(Presentation=FTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
 
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora9i" has 2 instance(s).
 
Instance "ora9i", status UNKNOWN, has 1 handler(s) for this service...
 
Instance "ora9i", status READY, has 1 handler(s) for this service...
Service "oratest" has 1 instance(s).
 
Instance "oratest", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
$

发现也是出现同样的问题。

因此可以推断,在instance没有建立的情况下,用pfile启动到nomount状态,实现数据库动态注册,虽然可以实现动态注册,在service中能看到service name,但是其状态为blocked,客户端此时无法连接。要解决此问题:
1.改用静态注册
2.建完database后才用动态注册

· 【文章发布信息】发表于: 2007-11-14 @ 00:34:53 · ||分类: ..experience, Working case

留条评论