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

linux下如何用命令来配置oracle11g的监听,第1张

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

如果是服务端:

$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也行

    )

  )

一般情况下端口号是1521,但如果安装Oracle时更改了端口号的话,就需要到Oracle服务器上查讯端口号。可以通过tnsnames.ora文件读取数据库的信息。

可以看到类似如下的内容:

HOST= 就是主机地址(如果是写的主机名,可以查看/etc/hosts文件中查看主机名对应的IP地址)

POST= 就是数据库开放的端口。


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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存