oracle学习之系统结构(1)--监听器

安装完数据库后除了用Net Manager手动添加LISTENER外,还可以这样操作:

一、监听文件路径:ORAHOME/ora92/network/admin/listener.ora
另外监听器日志文件路径是:ORAHOME/ora92/network/log/listener.log

二、用编辑器打开listener.ora文件,修改设置信息。例如(下面是一个完成的文件内容):

# LISTENER.ORA Network Configuration File: D:/oracle/ora92/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 86.16.24.88)(PORT = 1521))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:/oracle/ora92)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = name.domain)
      (ORACLE_HOME = D:/oracle/ora92)
      (SID_NAME = name)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = OEMREP)
      (ORACLE_HOME = D:/oracle/ora92)
      (SID_NAME = OEMREP)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = DEMO)
      (ORACLE_HOME = D:/oracle/ora92)
      (SID_NAME = DEMO)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = demo_dw)
      (ORACLE_HOME = D:/oracle/ora92)
      (SID_NAME = demodw)
    )
  )
三、运行监听器:
        1、在"开始"——"运行",输入lsnrctl,进入监听器管理。
        2、可以使用HELP命令查看命令。
        3、LSNRCTL>start

运行了监听器,就可以在OEM里打开所创建的数据库实例了。
如果要使用PL/SQL DEV来登录该数据库实例,还需要配置好tnsnames.ora文件,路径是:oraHOME/oracle/ora92/network/admin/tnsnames.ora
一个tnsnames.ora例子如下:
DEMO =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 86.16.24.88)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DEMO)
    )
  )

提示:
        有些情况下,listener.ora和tnsnames.ora这两个配置文件会出现乱码,导致无法使用OEM或PL/SQL DEV登录数据库,所以注意要把乱码部分设置好。
        这两个文件的路径分别为:
ORAHOME/ora92/network/admin/listener.ora
oraHOME/ora92/network/admin/tnsnames.ora
【学习,总结】

你可能感兴趣的:(oracle,listener)