2
回答
ORACLE网络配置
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

之前一直用的mysql,现在要用ORACLE.配置真的麻烦,不知道怎么弄了,本地oracle连不上了,用的Navicat for Oracle,本地oracle无法连上,远程oracle可以连上,下面是oracle的配置文件:

listener.ora

# listener.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = E:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:E:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
    (SID_DESC =
     (GLOBAL_DBNAME = ORCL)
     (ORACLE_HOME = E:\app\Administrator\product\11.2.0\dbhome_1)
     (SID_NAME = ORCL)
    )
  ) 

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = PC201505280948)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = E:\app\Administrator



tnsnames.ora:
# tnsnames.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORACL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.5.60.127)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORACL)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )



sqlnet.ora:
# sqlnet.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)



oracle版本是11g64位,使用PL/SQL无论是本地的还是远程的,都无法连上

Navicat for oracle连接本地oracle出现如下错误:

PLSQL连接出现如下错误:

oracle的服务只开启了两个:

举报
影非弦
发帖于2年前 2回/164阅
共有2个答案 最后回答: 2年前
我安装的是oracle11gx64,所以同时下载了对应的客户端instantclient_11_2
将下载的instantclient_11_2解压到一个目录,记住,PL/SQL是通过这个客户端去访问的,不是本地安装的oracle的目录。
所以在PL/SQL中配置的oracle的目录就应该是这个instantclient_11_2的目录,同时需要将本地安装的oracle的tnsnames.ora文件拷贝到instantclient_11_2目录下。
若需要使用PL/SQL同时访问远程的ORACLE,则只需要在拷贝到instantclient_11_2目录下的tnsnames.ora文件中追加上相应的服务配置即可。如下:
Oracle 自己的工具呢?EM能访问吗?删除监听配置,使用配置工具重新配置本地监听,不建议用各种抄来的ora,那东西我发现基本上没靠谱的。
顶部