连接Oracle数据库经常报错?关于listener.ora和tnsnames.ora文件的配置
发布日期:2021-05-10 23:54:13 浏览次数:5 分类:精选文章

本文共 2104 字,大约阅读时间需要 7 分钟。

Oracle 11g Installation Guide

Follow these steps to ensure a smooth installation and configuration of your Oracle 11g database

Step 1: Access the Oracle 11g Administrative Directory

  • Locate the installation path for Oracle 11g on your system. For example, it might be:
    F:\Oracle\Oracle11g\product\11.2.0\dbhome_1\NETWORK\ADMIN
    2..Navigate to the ADMIN directory within this path. This directory contains crucial configuration files for your database setup.
  • Step 2: Configure the Listener.ora File

  • The Listener.ora file is essential for configuring the Oracle Net Listener, which manages database connections.
  • Open the Listener.ora file located in the NETWORK\ADMIN directory:
    F:\Oracle\Oracle11g\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
  • Add or modify the following entries to configure the listener properly:
    • For CLRExtProc:
      SID_LIST_LISTENER = (SID_LIST =    (SID_DESC =      (SID_NAME = CLRExtProc)      (ORACLE_HOME = F:\Oracle\Oracle11g\product\11.2.0\dbhome_1)      (PROGRAM = extproc)      (ENVS = "EXTPROC_DLLS=ONLY:F:\Oracle\Oracle11g\product\11.2.0\dbhome_1\bin\oraclr11.dll")    )  )
    • For the database instance:
      LISTENER = (DESCRIPTION_LIST =    (DESCRIPTION =      (ADDRESS = (PROTOCOL = TCP)(HOST = computer_name)(PORT = 1521))      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))    )  )
  • Save the changes to the Listener.ora file after configuring.
  • Step 3: Configure the Tnsnames.ora File

  • The Tnsnames.ora file defines how clients connect to your Oracle database. Locate it in the same directory:
    F:\Oracle\Oracle11g\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
  • Add or modify the following entry for the database connection:
    LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = computer_name)(PORT = 1521))
  • Ensure the host name and port number match your server settings.
  • Step 4: Verify Your Computer Name

    To ensure your configuration works correctly, verify the computer name:

  • Open Control Panel > System and Security > System
  • Check the "Computer name" field to confirm the hostname
  • By following these steps, you can successfully install and configure Oracle 11g on your system.

    上一篇:数据库编程题(练习题):学生课程数据库中有三个关系(附参考答案)
    下一篇:gpedit.msc无法启动,提示:管理员已阻止你运行此应用

    发表评论

    最新留言

    路过,博主的博客真漂亮。。
    [***.116.15.85]2025年04月23日 20时55分32秒