oracle - How do I fix OCIServerAttach failing with DATABASE error: ORA-12541: TNS:no listener? -


i have client on windows machine , oracle server on centos virtual machine.

i able connect pc server using sqlplus using following string:

sqlplus myname/mypassword@ipaddress/xe 

my tnsnames.ora files is:

# tnsnames.ora network configuration file:  xe =   (description =     (address = (protocol = tcp)(host = ipaddress)(port = 1521))     (connect_data =       (server = dedicated)       (service_name = xe)     )   )  extproc_connection_data =   (description =     (address_list =       (address = (protocol = ipc)(key = extproc_for_xe))     )     (connect_data =       (sid = plsextproc)       (presentation = ro)     )   ) 

however, when try use same connection information application connections fails in ociserverattach call.

here code framework:

ocienvcreate(&tmpenv,                 oci_object | oci_threaded,                 null,                 null,                 null,                 null,                 0,                 null);  ocisessionbegin(servicecontexthandle_, errorhandle_, sessionhandle_, oci_cred_rdbms, oci_default);   ocihandlealloc( (dvoid *) environmenthandle_, (dvoid **) &servicecontexthandle_, oci_htype_svcctx, (size_t) 0, (dvoid **) 0); ocihandlealloc( (dvoid *) environmenthandle_, (dvoid **) &serverhandle_, oci_htype_server, (size_t) 0, (dvoid **) 0); ocihandlealloc( (dvoid *) environmenthandle_, (dvoid **) &errorhandle_, oci_htype_error, (size_t) 0, (dvoid **) 0); ocihandlealloc( (dvoid *) environmenthandle_, (dvoid **) &sessionhandle_, oci_htype_session, (size_t) 0, (dvoid **) 0);   /* here path std::string contains ipaddress followed '/xe'*/  result =  ociserverattach( serverhandle_, errorhandle_, (text *)path_.c_str(), (sb4)path_.length(), 0); 

the ipaddress matches ipaddress in tnsnames.ora , listener.ora file. there no port number being used intended use default 1521.

to best of knowledge listeners set , working correctly otherwise not able connect via sqlplus. oracle_home value expect. install directory in path.

anyone have ideas of might wrong?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -