SUSE Linux9下Oracle10g监听问题笔记

2014-11-24 17:26:17 · 作者: · 浏览: 0

环境:


1:更改主机host


[root@www ~]# hostname


linux


[root@www ~]# hostname test11


[root@www ~]# hostname


test11


[root@www ~]#


2:尝试重启监听


oracle@linux:/> lsnrctl stop


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 29-11月-2006 16:51:09


Copyright (c) 1991, 2005, Oracle. All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))


The command completed successfully


oracle@linux:/> lsnrctl start


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 29-11月-2006 16:51:32


Copyright (c) 1991, 2005, Oracle. All rights reserved.


Starting /free/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 10.2.0.1.0 - Production


System parameter file is /free/oracle/product/10.2.0/db_1/network/admin/listener.ora


Log messages written to /free/oracle/product/10.2.0/db_1/network/log/listener.log


Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))


Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))


STATUS of the LISTENER


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


Alias LISTENER


Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production


Start Date 29-11月-2006 16:51:32


Uptime 0 days 0 hr. 0 min. 42 sec


Trace Level off


Security ON: Local OS Authentication


SNMP OFF


Listener Parameter File /free/oracle/product/10.2.0/db_1/network/admin/listener.ora


Listener Log File /free/oracle/product/10.2.0/db_1/network/log/listener.log


Listening Endpoints Summary...


(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))


(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))


Services Summary...


Service "PLSExtProc" has 1 instance(s).


Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...


The command completed successfully


可以看到,监听启动很慢,但是最后还是能启动成功,其实这是假象,我们测试即可得知。


其实监听在每次启动时刻会去读系统的主机名,然后根据主机名启动lsnrctl。


3:测试监听连接的有效性


下面的standby是本地目录服务名。


oracle@linux:> sqlplus "sys/cicro@standby as sysdba"


SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 29 17:04:24 2006


Copyright (c) 1982, 2005, Oracle. All rights reserved.


ERROR:


ORA-12541: TNS:no listener


oracle@linux:> sqlplus "/as sysdba"


SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 29 17:07:32 2006


Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected.


SQL> shutdown immediate


ORA-24324: service handle not initialized


ORA-24323: value not allowed


ORA-00600: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]


SQL>


SQL> select host_name from v$instance;


HOST_NAME


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


linux


可以看到,此时关闭数据库也报错。数据库 v$instance中记录的hostname是linux,但是此时host name已经修改成了test11