【TNS】listener.ora模板;tnsnames.ora模板

好多人使用监听的时候误操作,将监听弄的不好使了,这次这个模板,不光是针对大家出现的这种问题,也是给我自己留一个记录,方便他人,方便自己。

listener.ora模板样例

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

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = xxx.xxxx.xxxx)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = xxxx)
    )
  )


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxxxxxxx)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


ADR_BASE_LISTENER = /u01/app/oracle

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



tnsnames.ora模板样例

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

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


XXXXX =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxxxxx)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = xxxxxxxxxxx)
    )
  )

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


以上带xxxx的这种都需要自己设定,host可以设定hosts文件中的名称,或者IP,service_name可以在oracle中输入

SQL>show parameter name;

sid可以在进程中查看

$ ps -ef | grep ora_

或者

$ echo $ORACLE_SID











上一篇:CentOS下的Memcache安装步骤(Linux+Nginx+PHP+Memcached)


下一篇:安全防范:nginx下git引发的隐私泄露问题