I installed oracle client WINDOWS.X64_193000_client_home in my computer. And I set up my tnsnames.ora file. When using tnsping
command to test the connection, I find it is OK when I put all the value in just one line, no line feed.
Name1 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = xxx)(SERVER = DEDICATED)))
But if I put the value in several lines with line feed, it throws out error.
Name1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = x.x.x.x)
(SERVER = DEDICATED)
)
)
Error as below
PS C:\Oracle\WINDOWS.X64_193000_client_home\network\admin> tnsping sap TNS Ping Utility for 64-bit Windows: Version 19.0.0.0.0 - Production on 03-MAY-2022 16:33:13
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files: C:\Oracle\WINDOWS.X64_193000_client_home\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = TNS-12533: TNS:illegal ADDRESS parameters
How can make it to recognise the line feed?
Edit: Some anwsers are about the incorrect content of tnsnames.ora file. Yes, after I change the tns with some indent, it is working.
But I also installed Oracle SQL Developer in my computer. It is working fine to use the tns and can be connected with oracle server successfully.
Try this:
I found this Syntax Rules for Configuration Files: