Home > Net >  [ISQL]ERROR: Could not SQLDriverConnect in Oracle database
[ISQL]ERROR: Could not SQLDriverConnect in Oracle database

Time:01-16

I have following configurations from file /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora

**LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ol7-19.localdomain)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
ODBC_CONNECTION_ORCL=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ol7-19.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ODBC_CONNECTION_ORCL)
    )
  )**

in file /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/tnsnames.ora

**ODBC_CONNECTION_ORCL=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =ol7-19.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = ODBC_CONNECTION_ORCL)
    )
  )**

in file /etc/odbc.ini

**[ODBC_CONNECTION_ORCL]
Description = ODBC CONNECTION CREATED FOR BACKUP DATABASE
Driver      = /u01/app/oracle/product/19.0.0/dbhome_1/lib/libsqora.so.19.1
ServerName  = //192.168.103.145:1521/ORCL
Database = ORCL
UserID = SYSTEM
Password = Test123$**

in file /etc/odbcinst.ini

**[ODBC_CONNECTION_ORCL]
Description = ODBC CONNECTION CREATED FOR BACKUP DATABASE
Driver      = /u01/app/oracle/product/19.0.0/dbhome_1/lib/libsqora.so.19.1
ServerName  = //192.168.103.145:1521/ORCL
Database = ORCL
UserID = SYSTEM
Password = Test123$**

but still i am getting below error while trying to connect from root user but via oracle user it connected successfully..

**isql -k -v Driver={ODBC_CONNECTION_ORCL};DSN=ODBC_CONNECTION_ORCL;Uid=SYSTEM;Pwd=Test123$;**

**[08004][unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified [ISQL]ERROR: Could not SQLDriverConnect**

CodePudding user response:

Check difference in environment variables, probably your root user can't find tnsnames.ora and sqlnet.ora files. But oracle user properly configured (environment variables), thus it can connect successfully. Try to execute env and filter output for ORACLE_HOME, ORACLE_SID, TNS_ADMIN and PATH environments variables. Compare them and align for root user.

And just curious - why in your showed contents of all configuration files (like listener.ora, tnsnames.ora, odbc.ini etc.) used two star symbols "**"? And also use of root account for any purpose except administration is not a good idea.

  • Related