linux下监听怎么配(Linux监听)

纸扎戏偶

本篇文章给大家谈谈linux下监听怎么配,以及Linux监听对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

  • 1、linux操作系统下oracle数据库如何配置监听
  • 2、linux 双网卡 数据库和监听应该怎么配置
  • 3、linux下如何用命令来配置oracle11g的监听
  • 4、linux下怎么配置本地监听服务

1、linux操作系统下oracle数据库如何配置监听

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文件配置信息是否正确,还有数据库是否已经被开启。

2、linux 双网卡 数据库和监听应该怎么配置

netconfig -d eth1

-d 后面跟设备名称。

其他参数可以通过netconfig --help 察看。

3、linux下如何用命令来配置oracle11g的监听

这个不是命令配置的,是改文件

如果是服务端:

$ORACLE_HOME/network/ADMIN目录,修改LISTENER.ORA

到$ORACLE_HOME/bin下,通过lnsrctl start启动监听  lnsrctl stop | lnsrctl status 分别是停止监听和查看监听状态

如果是客户端:

$ORACLE_HOME/network/ADMIN目录,修改tnsnames.ora

==========================================================

配置LISTENER.ORA的demo:

LISTENER =                                                                     

 (ADDRESS_LIST=                                                                

(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))                          

(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))                     

                                                                               

SID_LIST_LISTENER=                                                             

  (SID_LIST=                                                                   

(SID_DESC=                                                                   

        #BEQUEATH CONFIG                                                     

         (GLOBAL_DBNAME=salesdb.mycompany)                                     

         (SID_NAME=sid1)                                                         

         (ORACLE_HOME=/private/app/oracle/product/8.0.3)                       

        #PRESPAWN CONFIG                                                     

        (PRESPAWN_MAX=20)                                                      

  (PRESPAWN_LIST=                                                            

          (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))               

        )                                                                      

       )                                                                       

      )                                                                        

配置tnsnames.ora的demo:

ora_xxx =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = ora11g)    -----这个地方填SID_NAME也行

    )

  )

4、linux下怎么配置本地监听服务

如果是web服务器,比如apache,或者tomcat,nginx这种,有相应的配置文件的,比如xxx.conf,这个配置文件中可以设定监听的端口。

关于linux下监听怎么配和Linux监听的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

文章版权声明:除非注明,否则均为我爱教程术原创文章,转载或复制请以超链接形式并注明出处。