Andreas_Sprosec_7439

Is it possible to connect to Automic using Service instead of SID?

Discussion created by Andreas_Sprosec_7439 on Dec 7, 2016

We need to know that "Service" means "Easy Connect Naming Method" to connect to the database.

In case you will use "Easy Connect Naming Method" to connect to the database the answer is yes.

Test Case:

  1. ORACLE_SID variable is not set.
  2. Connection to the database via Easy Connect

This naming method provides out-of-the-box TCP/IP connectivity to databases. It extends the functionality of the host naming method by enabling clients to connect to a database server with an optional port and service name in addition to the host name of the database:

CONNECT username/password@[//]host[:port][/service_name]

https://docs.oracle.com/cd/B19306_01/network.102/b14212/naming.htm#i498306

  1. User: AE
  2. Passwd: AE
  3. HOST: localhost
  4. Service_Name: ORCL

Command: $ORACLE_HOME/bin/sqlplus UC4/uc4@localhost/ORCL

2cks8ynus2ux.png

ucsrv.ini:

ajxskgd9g0cc.png

; Oracle with OCI

;;SQLDRIVERCONNECT=ODBCVAR=NN1NIORO,DSN=ORCL;UID=AE;PWD=AE;SP=NLS_LANGUAGE=AMERICAN,NLS_TERRITORY=AMERICA,CODESET=WE8ISO8859P15,NLS_LENGTH_SEMANTICS=CHAR

SQLDRIVERCONNECT=ODBCVAR=NN1NIORO,DSN=localhost/ORCL;UID=AE;PWD=AE;SP=NLS_LANGUAGE=AMERICAN,NLS_TERRITORY=AMERICA,CODESET=WE8ISO8859P15,NLS_LENGTH_SEMANTICS=CHAR

Start Automic Engine:

5fdt23bpqh7e.pngAs you can see the engine is up & running:
1mbr9p501v0q.png
Stop Automic Engine:
uvx3754vikrp.png
Initiate an error:
  • Change the connection string in ucsrv.ini

  SQLDRIVERCONNECT=ODBCVAR=NN1NIORO,DSN=DUMMY/ORCL;UID=AE;PWD=AE;SP=NLS_LANGUAGE=AMERICAN,NLS_TERRITORY=AMERICA,CODES

  • Start the engine:

20161123/111212.339 - U00003400 Server 'AE112LOC#WP' version '11.2.0+hf.1.build.2421' (changelist '7126194') started.

20161123/111212.339 - U00003327 Build Date: '2015-12-17', '10:28:30'

20161123/111212.339 - U00003433 Server was started with INI file '/opt/uc4/ServiceManager/bin/../../AutomationEngine/bin/ucsrv.ini'.

20161123/111212.401 - U00003545 UCUDB: Opening database ...

20161123/111212.401 - U00029112 UCUDB - Length of the DB-History area: 100

20161123/111220.426 - U00029108 UCUDB: SQL_ERROR    Database handles  DB-HENV: 10f6bf0  DB-HDBC: 0

20161123/111220.426 - U00003591 UCUDB - DB error info: OPC: 'OCILogon' Return code: 'ERROR'

20161123/111220.426 - U00003592 UCUDB - Status: '' Native error: '12154' Msg: 'ORA-12154: TNS:could not resolve the connect identifier specified'

20161123/111220.426 - U00003590 UCUDB - DB error: 'OCILogon', 'ERROR   ', '', 'ORA-12154: TNS:could not resolve the connect identifier specified'

20161123/111220.426 - U00003524 UCUDB: ===> Time critical DB call!       OPC: 'OPEN' time: '8:062.089.000'

20161123/111220.426 - U00003611 DB OPEN executed. Return Code = '0000003590'

20161123/111220.426 - U00003620 Routine 'UCMAIN_R' forces trace because of error.

20161123/111220.427 - U00003450 The TRACE file was opened with the switches '0000000000000001'.

20161123/111220.427 - U00003380 Server 'AE112LOC#WP' version '11.2.0+hf.1.build.2421' (Runtime '0/00:00:08', Log# '1', Trc# '1').

20161123/111220.427 - U00003491 There is a time difference of '0/00:00:00' or '0' seconds to the Primary Server.

20161123/111220.427 - U00003375 Server usage of the last minute '0%', the last 10 minutes '0%' and the last hour '0%'.

20161123/111220.427 - U00003590 UCUDB - DB error: 'OCILogon', 'ERROR   ', '', 'ORA-12154: TNS:could not resolve the connect identifier specified'

20161123/111220.495 - U00003449 Output to the TRACE file is finished.

20161123/111220.495 - U00003590 UCUDB - DB error: 'OCILogon', 'ERROR   ', '', 'ORA-12154: TNS:could not resolve the connect identifier specified'

20161123/111220.495 - U00003410 Server 'AE112LOC#WP' version '11.2.0+hf.1.build.2421' ended abnormally.

 

 

Conclusion:

AE tries to connect to the database via tnsnames.ora because ‘DUMMY’ is not a valid host.

 

Outcomes