Fixing the Oracle Connection Error: ORA-12154
Fixing the Oracle Connection Error: ORA-12154: TNS:could not resolve the connect identifier specified
To fix this error when connecting to an Oracle database, follow the steps below:
1. Create the tnsnames.ora
file
Create a file named tnsnames.ora
with the following content:
REALDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = YOUR_IP_OR_HOST)(PORT = YOUR_PORT))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = YOUR_SERVICE_NAME)
)
)
Replace YOUR_IP_OR_HOST
, YOUR_PORT
, and YOUR_SERVICE_NAME
with the actual connection details.
2. Save it to the correct directory
Save the file to the following path:
3. Set environment variables in Windows
Go to:
Control Panel → System → Advanced system settings → Environment Variables
Add or edit the following System Variables:
Add or edit the following environment variables:
4. Edit the Apache configuration
Open the file:
Add the following lines:
FcgidInitialEnv TNS_ADMIN "C:/instantclient_19_6/network/admin"
Related Articles
Filtering Connection Database - Oracle
On various occasions, we encounter slowness when connecting to the database or while editing and executing applications. It is possible to resolve these issues by optimizing data loading through filter configuration. To do so, follow these steps: ...
Installing Scriptcase with PHP 7.3 on Windows
This documentation will walk you through the steps necessary to install PHP 7.3, Apache 2.4, and Scriptcase manually. When performing this type of installation, you are responsible for configuring your entire environment as well as database ...
Oracle Connection - Scriptcase 9 - Linux 64 Bits
This procedure will only work if you have a Scriptcase manual installation in your server. Installing PHP 7.0 Installing the Scriptcase Manually To connect with Oracle in a Linux System, we must follow these steps below: Step 1 - Installing these ...
Scriptcase Installer for Windows - PHP 7.3
The Scriptcase installer installs Apache, PHP, and Scriptcase on your operating system. The installer does not include a database. Prerequisites To download the Scriptcase Installer, go to our download page clicking here. Listed below are all the ...
Oracle Connection - Scriptcase 8.1 - Linux
To enable the connection to Oracle on Linux, we must perform the following steps: Prerequisites Step 1 - Add the i386 architecture and install the packages below : UBUNTU\DEBIAN CENTOS\RHEL - sudo dpkg —add-architecture i386
- sudo apt-get update
...