批处理文件中的ORA-12545

时间:2017-04-14 19:49:03

标签: oracle tns

我在Windows 2008服务器上安装了Oracle 12.2.01。每当我尝试使用sqlplus sys/password@master as sysdba @E:/script.sql连接批处理文件时,我都会

ORA-12545:Connect failed because target host or object does not exist.

我可以使用完全相同的语法ping,tnsping和通过sqlplus连接。

如果删除“@master”,脚本将起作用。我需要找出原因,因为我们的一些脚本需要在客户位置使用“@master”。

监听器文件:

# listener.ora Network Configuration File: C:\oracle\product\12.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = MASTER)
      (ORACLE_HOME = C:\oracle\product\12.2.0\dbhome_1)
      (SID_NAME = MASTER)
    )
  )

LISTENER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-VFT0F2BL0T6)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.82)(PORT = 1521))
    )
  )

> ADR_BASE_LISTENER = C:\oracle\product\12.2.0\dbhome_1\log

SQLNET文件:

# sqlnet.ora Network Configuration File: c:\oracle\product\12.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= (NONE)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)


SQLNET.ALLOWED_LOGON_VERSION_SERVER=8

tnsnames文件:

# tnsnames.ora Network Configuration File: C:\oracle\product\12.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

MASTER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.82)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MASTER)
    )
  )

0 个答案:

没有答案