简体   繁体   中英

ORA-12533: TNS:illegal ADDRESS parameters

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.

Guessing from what you've provided: The SERVICE_NAME in the connect string is not the same SERVICE_NAME from your tnsnames.ora file.

Also, why did you censor the SERVER parameter ? Only possible values are SHARED, DEDICATED or POOLED. No ip address or hostname here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM