linux操作系统下oracle数据库如何配置监听 5
5个回答
展开全部
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文件配置信息是否正确,还有数据库是否已经被开启。
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文件配置信息是否正确,还有数据库是否已经被开启。
展开全部
可以在图形管理界面配置,一般是选择这样的方式,在linux桌面上,邮件在命令输入终端 中 键入 netca 回车就会弹出监听配置向导了
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
找到配置文件,直接修改,然后重启监听
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
/ora/oracle/10g/network/admin/samples
下
listener.ora tnsnames.ora
下
listener.ora tnsnames.ora
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
命令行中输入netca,选择创建一个监听,然后下一步就可以了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询