python - CX_ORACLE TNS:listener does not currently know of service requested in connect descriptor -


i trying connect database server python using cx_oracle . have constructed connection string as

dbconfig['schema']+"/"+dbconfig['password']+"@"+dbconfig["ip"]+"/"+dbconfig['sid'] 

where dbconfig dictionary necessary credentials database connection

i able connect 1 of server using vpn connection . when try connect 1 of server in local network displays "tns:listener not know of service requested in connect descriptor" error.

i modified tnsnames.ora file appropriate sid though not required in other case . after that, able login using sqlplus . had no luck python code.

you connecting database using hostname connection type or called "easy connect" - ezconnect

forget tnsnames.ora in scenario. not in use when doing hostname connection.

you need service_name right. service_name not same sid.

sid name of server-side-processes on dbnode. fixed dbnode.

service_name abtraction. let's running 1 database on 2 dbnodes (rac) (shared storage), cluster expose service applications can connect - service_name. application doesn't have know underlying architecture.

connection service_name: user/pass@hostname:port/service_name  connection sid user/pass@hostname:port:sid -- note colon! 

if running oracle database 12c have specify service_name, not sid. never use sid! application wants database service!

sql>-- identify database services (you can have many like) sql>-- finance,betting,app1,app2...appn,etc sql>-- yes 'should' run applications in 1 database (schema separation or pluggable)  sql>show parameter service_names  rem try ezconnect through sqlplus rem note! add ..(ezconnect,tnsnames).. sqlnet.ora file if not in.  c:\>sqlplus user/pass@hostname:port/service_name 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -