linux *** 作系统下oracle数据库如何配置监听

linux *** 作系统下oracle数据库如何配置监听,第1张

1. 修改监听器配置文件

Linux下Oracle监听器配置文件在:$ ORACLE_HOME/network/admin/listerer.ora, 如:

/bank/oracle/oracle10g/product/10.2.0/network/admin/listener.ora

修改并配置要监听SID的相关信息,如:

#listener.ora Network Configuration File: /bank/oracle/oracle10g/product/10.2.0/network/admin/listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /bank/oracle/oracle10g/product/10.2.0)

(PROGRAM = extproc)

)

(SID_DESC =

(GLOBAL DBNAME = bkserver)

(SID_NAME = bkserver)

)

)

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.7.13.242)(PORT = 1521))

)

)

2. 启动监听器

(1). 切换至oracle安装用户(一般为oracle)

su - oracle

(2). 启动监听器

lsnrctl start

另:停止监听器

lsnrctl stop

3. 测试监听器是否运行正常

在客户端修改tnsnames.ora配置文件就访问Oracle数据库,如:

BKSERVER =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.7.13.242)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = BKSERVER)

)

)

通过命令tnsping测试是否能访问到监听器,如:

M:\>tnsping bkserver

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 12-8月 -

2010 17:11:04

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

已使用的参数文件:

D:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora

已使用 TNSNAMES 适配器来解析别名

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)

(HOST = 10.7.13.242)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVIC

E_NAME = BKSERVER)))

OK (20 毫秒)

注意: 监听器是否能被tnsping通跟数据库的开启/关闭无关,所以就算可以tnsping通监听器但未必能连接到数据库,这时请检查listener.ora文件配置信息是否正确,还有数据库是否已经被开启。

照着网上的资料重装一遍oracle的时候,走到这边报错了。仔细看了下,提示: LISTENER:The information provided for this listener is currently in use by another listener on this computer.

想着可能是之前的oracle没有删干净,端口还是被占用的原因,于是切换到root用户下,查看1521端口对应的进程,然后kill掉。再次执行 netca /silent /responseFile 路径 命令,终于成功了。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7195756.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-02
下一篇 2023-04-02

发表评论

登录后才能评论

评论列表(0条)

保存