oracle ORA-12533:TNS:非法的ADDRESS参数

wswtfjt7  于 2022-12-11  发布在  Oracle
关注(0)|答案(1)|浏览(499)

I'm trying to open an OracleConnection on Visual Studio (c#) to join a Database with this command:

OracleConnection conn = new OracleConnection("Data Source=((DESCRIPTION=(ADDRESS_LIST =(ADDRESS=(PROTOCOL=tcp)(HOST=XX.XXX.X.XXX)(PORT=XXXX)))(CONNECT_DATA=(SERVICE_NAME=DEPL_D)(SERVER=xxxxx0xx)));User Id=X_XXX_XXX; Password=XXXXXXXXXX");

conn.Open();

my tnsnames.Ora contains the connection string like this:

DEPL_D.WORLD=
    (DESCRIPTION=
        (ADDRESS_LIST =
            (ADDRESS=
                (PROTOCOL = tcp)
                (HOST = XX.XXX.X.XXX)
                (PORT = XXXX)
            )
        )
        (CONNECT_DATA =
            (SERVICE_NAME = DEPL_D)
            (SERVER = XXXXXXXXXX)
        )
   )

On the conn.Open(); I have the message ORA-12533: TNS: illegual ADDRESS parameter
After having searched on the net, It seems it's a problem on my tnsnames.oRA
I have done a test SQL+ with the administrator of the database (on audio) and it works. But It doesn't with visual studio.
If anybody has any idea, everything can helps.
Thanks in advance,
Greetings,
Flo
EDIT1:
I have tried to edit the (CONNECT_DATA = (SERVICE_NAME = DEPL_D) (SERVER = XXXXXXXXXX) ) with (CONNECT_DATA = (SID=DEPL_D) but it doesn't works too.

carvr3hs

carvr3hs1#

根据您提供的信息猜测:连接字符串中的SERVICE_NAME与tnsnames.ora文件中的SERVICE_NAME不同。
另外,为什么要审查SERVER参数?只有可能的值是SHARED、DEDICATED或POOLED。这里没有IP地址或主机名。

相关问题