Navigation:  Pre-required activities > Database configuration > Oracle >

Oracle Instant Client configuration

Previous  Top  Next

To configure Oracle Instant Client, execute the steps below:

 

Oracle Client 12 is installed along with the system. If Oracle 19 is used in the database server, we suggest updating Oracle Client to version 19. To do that, follow the procedure described in the Oracle Instant Client update section.

 

1.Create the Oracle configuration file in the /usr/local/se/apps/oracle-client directory:

# touch /usr/local/se/apps/oracle-client/tnsnames.ora

 

2.Define the file permissions:

# chmod 750 /usr/local/se/apps/oracle-client/tnsnames.ora

# chown sesuite.sesuite /usr/local/se/apps/oracle-client/tnsnames.ora

 

3.Edit the Oracle Instant Client configuration file:

# vi /usr/local/se/apps/oracle-client/tnsnames.ora

 

4.Add these configurations:

SESUITE =

(DESCRIPTION =

 (ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = <SERVER HOST>)(PORT = 1521))

 )

 (CONNECT_DATA =

  (SERVICE_NAME = <ORACLE SERVICE NAME>)

 )

)

 

5.Save and close the configuration file:

:wq!

 

Oracle environment variables

 

6.Reload the bash configuration:

# source ~/.bash_profile

# source /etc/bashrc

 

7.Test the connection:

# sqlplus <user>/<password>@<tnsname>

 

Troubleshooting:

Problem

Possible Solution

ORA-12541: TNS: no listener.

Check whether the Oracle environment variables were created correctly.

ORA-12154: TNS: could not resolve the connect identifier specified.

Check whether the TNS_ADMIN environment variable was properly created and whether the tnsnames.ora configuration file is configured correctly.

ORA-12560: TNS:protocol adapter error.

Redefine the tnsnames.ora. file permissions.
Check whether the Oracle environment variables were created correctly.

 

8.It will be necessary to create an environment variable to configure the charset. Still connected to SQLPlus, execute the three commands below to return the NLS parameters:

VALUE1:

SELECT VALUE FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = 'NLS_LANGUAGE';

VALUE2:

SELECT VALUE FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = 'NLS_TERRITORY';

VALUE3:

SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER = 'NLS_CHARACTERSET';

 

9.Close SQLPlus:

quit

 

10.Create the NLS_LANG environment variable with the results obtained above:

# echo 'export NLS_LANG=<VALUE1>_<VALUE2>.<VALUE3>' >> /etc/bashrc

# echo 'export NLS_LANG=<VALUE1>_<VALUE2>.<VALUE3>' >> /usr/local/se/apps/tomcat/bin/setenv.sh

 

11.Edit the /etc/init.d/sesuite file:

# vi /etc/init.d/sesuite

 

12.Add the line below to the beginning of the file with the other "export":

...

export NLS_LANG=<VALUE1>_<VALUE2>.<VALUE3>

...

 

13.Reload the bash configuration:

# source ~/.bash_profile

# source /etc/bashrc