Oracle change connection identifier - oracle

I have 2 Oracle database installed on 2 different server (production and test) but I'm not Oracle expert. In production I can connect succesfully via SQLPLUS using:
sqlplus user/password#bc.name.server.com
In test system I have to specify different connection string:
sqlplus user/password#bc.name.server.com:1521/orcl
Whithout the :1521/orcl I got: ORA-01017: invalid username/password; logon denied
For scripting purpose, I would like to use the same connection string but I'm stuck on how to change it.
I tried to change the tnsnames.ora as:
ORCLCDB=localhost:1521/orclcdb
bc.name.server.com=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
But still not work. Could someone address me on how I can change the connection string to:
sqlplus user/password#bc.name.server.com
Thank you
Lucas

This is how I do that; see if it helps.
As every Oracle piece of software uses its own TNSNAMES.ORA file (for example, if you installed Oracle database and Developer Suite, you'd have two TNSNAMES.ORA files). In order to be able to connect to different databases, you have to maintain TNSNAMES.ORA in both (or more) directories. To avoid that, create TNS_ADMIN environment variable which points to a directory that contains a single copy of the TNSNAMES.ORA file. Therefore, when I add a new database to connect to, I maintain it only in that TNSNAMES.ORA file. On my computer, it is set to
SQL> $set tns_admin
TNS_ADMIN=C:\oralib
Contents of my SQLNET.ORA file:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
Contents of my TNSNAMES.ORA (part of it, though; in reality, I currently have aliases to 56 databases in there):
MY_TEST_DB=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=my_test_host)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SID=db_test)
)
)
MY_PRODUCTION_DB=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=my_production_host)
(PORT=1521)
)
)
(CONNECT_DATA=
(SID=db_production)
)
)
When I'm connecting to these databases, I run (at the operating system command prompt)
sqlplus scott/tiger#my_production_db
or
sqlplus scott/tiger#my_test_db
and everything works just fine.

Related

How to connect to Oracle Database Server from another Database server?

Server 1: Oracle 12.2 (Linux)
Server 2: Oracle 11g (Windows)
Problem Statement: Connect to Server 1 and take a full backup of the running database?
First, what are the requirements to connect to a database such as tnsname.ora file strings.
Second, how to take backup in already created directory on server 1 using server 2.
If On client-side Oracle Full Database or Oracle Client has already installed.
Locate TNSNAMES.ORA from one of the client-side servers and add below-mentioned string:
PRODDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ORACLE-EN-1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRODDB)
)
)
You also need to make sure that the LISTENER.ORA has been configured correctly and that both database and listener services are running.
After installing SQL*plus or SQL Developer, also make sure that on the client machine the TNSNAMES.ORA matches the server configuration, then try:
TNSPING PRODDB

ORA-12154 TNS can't resolve specified identifier

i'm trying to connect to my oracle server using a batch file, but while i try connecting i got the following error:
ORA-12154: TNS: could not resolve the connect identifier specified
I've already check the tnsnames.ora ad the identifier is spelled correctly; i've put in the environment's variable a new variable named TNS_ADMIN that point on my admin folder in the client section.
ty tnsname.ora is as following
ORCL_SRVDATIORIO12 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL)
(SERVER = DEDICATED)
)
)
If i try connecting to that server using SSMA for example, using the tnsnames mode (SID or the description name), connection will establish just fine; while running it in command line it return me the error.
Also if i try running
tnsping <my tnsname>
i'll get:
TNS Ping Utility for 32-bit Windows: Version 12.2.0.1.0 - Production on 03-GEN-2019 14:36:59
Copyright (c) 1997, 2016, Oracle. All rights reserved.
File di parametri utilizzati:
C:\app\client\user\product\12.2.0\client_1\network\admin\sqlnet.ora
TNS-03505: Impossible finding name
So i checked the sqlnet.ora file and the directory path seems fine to me:
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, LDAP)
any suggestion?
EDIT: i solved by simply creating a new text file and copy past the previous contents in the new one.
you need to check tnsnames.ora. tnsnames.ora contains tns names and their connection declarations. You need to use appropriate tns name to connect your database.
tnsping <tns_name> //tns_name is needed to be defined in tnsnames.ora
in your case
tnsping ORCL_SRVDATIORIO12 10
need to return success message. if it does not, it means that your connection decriber is wrong. In which case, you need to talk with your DBA

ORA 12154 - unable to connect from toad/SQLplus

when i try to connect any DataBase in my TNSNAMES.ora file SQLPLUS throws
ORA-12154: TNS could not resolve service name
I've already checked this stuff:
TNS_ADMIN environment variable is defined as "C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN"
"C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\tnsnames.ora" was located
The following connect descriptor was found for my_db in the tnsnames.ora file
my_db=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=local.db)
(PORT=1521)
)
(CONNECT_DATA=
(SID=SCMPROD)
)
)
"C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\sqlnet.ora" was located
NAMES.DIRECTORY_PATH specifies TNSNAMES in the sqlnet.ora file
the question is:
what is missing?
UPDATE
Now on SqlPlus using the usr/pwd#SELFTEST connection string it works
In can't be an error on the server because on my old PC it still accept my connection an all my company works on it.
The tnsname.ora
SELFTEST=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=10.100.2.7)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=GOLDtest)
)
)
The problem still exist trying to connect from Toad for Oracle...
ORA-12154: TNS could not resolve service name
my_db=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=local.db)
(PORT=1521)
)
(CONNECT_DATA=
(SID=SCMPROD)
)
)
The error is about incorrect service name. I see your tnsnames.ora doesn't have the service_name, rather you have mentioned SID. Probably this is the cause of the error.
You could edit the tnsnames.ora as:
SCMPROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SCMPROD)
)
)
Assuming, SCMPROD is the service_name.
From the source
ORA-12154: TNS:could not resolve the connect identifier specified
Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could
not be resolved into a connect descriptor using one of the naming
methods configured. For example, if the type of connect identifier
used was a net service name then the net service name could not be
found in a naming method repository, or the repository could not be
located or reached.
Action:
If you are using local naming (TNSNAMES.ORA file):
Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)
Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.
Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.
Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a
TNSNAMES.ORA file may make it unusable.
If you are using directory naming:
Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Verify that the LDAP directory server is up and that it is accessible.
Verify that the net service name or database name used as the connect identifier is configured in the directory.
Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect
identifier
If you are using easy connect naming:
Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Make sure the host, port and service name specified are correct.
Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system
specific guide for more information on naming.

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor

We have an application running locally where we're experiencing the following error:
ORA-12514: TNS:listener does not currently know of service requested
in connect descriptor
I've tested the connection using TNSPing which resolved correctly and
I tried SQLPlus to try connecting, which failed with the same error as above. I used this syntax for SQLPlus:
sqlplus username/password#addressname[or host name]
We have verified that:
the TNS Listener on the server is running.
Oracle itself on the server is running.
We don't know of any changes that were made to this environment.
Anything else we can test?
I had this issue and the fix was to make sure in tnsnames.ora the SERVICE_NAME is a valid service name in your database. To find out valid service names, you can use the following query in oracle:
select value from v$parameter where name='service_names'
Once I updated tnsnames.ora to:
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = *<validhost>*)(PORT = *<validport>*))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = *<servicenamefromDB>*)
)
)
then I ran:
sqlplus user#TEST
Success!
The listener is basically telling you that whatever service_name you are using isn't a valid service according to the DB.
(*I was running sqlplus from Win7 client workstation to remote DB and blame the DBAs ;) *)
I know this is an old question, but still unanswered. It took me a day of research, but I found the simplest solution, at least in my case (Oracle 11.2 on Windows 2008 R2) and wanted to share.
The error, if looked at directly, indicates that the listener does not recognize the service name. But where does it keep service names? In %ORACLE_HOME%\NETWORK\ADMIN\listener.ora
The "SID_LIST" is just that, a list of SIDs and service names paired up in a format you can copy or lookup.
I added the problem Service Name, then in Windows "Services" control panel, I did a "Restart" on the Oracle listener service. Now all is well.
For example, your listener.ora file might initially look like:
# listener.ora Network Configuration File: C:\app\oracle_user\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\oracle_user\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\oracle_user\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
... And to make it recognize a service name of orcl, you might change it to:
# listener.ora Network Configuration File: C:\app\oracle_user\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\oracle_user\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\oracle_user\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = C:\app\oracle_user\product\12.1.0\dbhome_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
In my circumstances the error was due to the fact the listener did not have the db's service registered. I solved this by registering the services. Example:
My descriptor in tnsnames.ora:
LOCALDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = LOCALDB)
)
)
So, I proceed to register the service in the listener.ora manually:
SID_LIST_LISTENER =
(SID_DESC =
(GLOBAL_DBNAME = LOCALDB)
(ORACLE_HOME = C:\Oracle\product\11.2.0\dbhome_1)
(SID_NAME = LOCALDB)
)
Finally, restart the listener by command:
> lsnrctl stop
> lsnrctl start
Done!
I had this issue at Windows server 2008 R2 and Oracle 11g
go to Net Manager > Listener > select database services form the combox > "Global Database Name" must be same as "SID" and "Oracle Home Directory" must be correct.
If you don't have any entry for database services, create one and set correct global database , sid and oracle home.
This really should be a comment to [Brad Rippe][1]'s answer, but alas, not enough rep. That answer got me 90% of the way there. In my case, the installation and configuration of the databases put entries in the tnsnames.ora file for the databases I was running. First, I was able to connect to the database by setting the environment variables (Windows):
set ORACLE_SID=mydatabase
set ORACLE_HOME=C:\Oracle\product\11.2.0\dbhome_1
and then connecting using
sqlplus / as sysdba
Next, running the command from Brad Rippe's answer:
select value from v$parameter where name='service_names';
showed that the names didn't match exactly. The entries as created using Oracle's Database Configuration Assistant were originally:
MYDATABASE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mylaptop.mydomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydatabase.mydomain.com)
)
)
The service name from the query was just mydatabase rather than mydatabase.mydomain.com. I edited the tnsnames.ora file to just the base name without the domain portion so they looked like this:
MYDATABASE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mylaptop.mydomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydatabase)
)
)
I restarted the TNS Listener service (I often use lsnrctl stop and lsnrctl start from an administrator command window [or Windows Powershell] instead of the Services control panel, but both work.) After that, I was able to connect.
[1]: https://stackoverflow.com/users/979521/brad-rippe
Starting the OracleServiceXXX from the services.msc worked for me in Windows.
For thoses Who are using spring-boot and jdbc for connection.
You have to be careful while writing jdbcUrl in application.properties
With SID in Database connection -
source.datasource.jdbcUrl = jdbc:oracle:thin:#[HOST][:PORT]:SID
With Service name in db connection
globe.datasource.jdbcUrl = jdbc:oracle:thin:#//[HOST][:PORT]/SERVICE
This worked for me :)
For Dbeaver users: try selecting "SID" instead of "Service name" in connection settings.
I had the same problem. For me, just writing
sqlplus myusername/mypassword#localhost
did the trick, doing so makes it connect to the default service name, I guess.
This error can occur when an application makes a new connection for every database interaction or the connections are not closed properly. One of the free tools to monitor and confirm this is Oracle Sql developer (although this is not the only tool you can use to monitor DB sessions).
you can download the tool from oracle site Sql Developer
here is a screenshot of how to monitor you sessions. (if you see many sessions piling up for your application user during when you see the ORA-12514 error then it's a good indication that you may have connection pool problem).
Check to see the database is up. Log onto the server, set the ORACLE_SID environment variable to your database SID, and run SQL*Plus as a local connection.
I resolved this issue in my linux enviroment updating the IP of my machine in /etc/hosts file.
You can verify your network IP (inet end.) with:
$ifconfig
See if your IP matches with /etc/hosts file:
$cat /etc/hosts
Edit your /etc/hosts file, if nedded:
$sudo gedit /etc/hosts
Bye.
what worked for me was really simple, I just needed to initiate the service manually in the "Windows Services" (services.msc in cmd trompt).
my service name is: OracleServiceXXXXX.
I had also faced the same problem and spent 3 days to dig it out.
This happens because of your wrong TNS service entry.
First check whether you are able to connect to standby database from primary database using sql > sqlplus sys#orastand as sysdba (orastand is a standby database).
If you are not able to connect then it is a problem with the service. Correct the entry of service name in TNS file at primary end.
Check standby database the same way. Make the changes here too if required.
Make sure the log_archive_dest_2 parameter has the correct service name.
For those that may be running Oracle in a VM (like me) I saw this issue because my VM was running out of memory, which seems to have prevented OracleDB from starting up/running correctly. Increasing my VM memory and restarting fixed the issue.
Lots of answers here, but here comes a working example with code that you can copy and paste and test immediately:
For me the error 12514 was solved after specifying the correct SERVICE_NAME.
You find that on the server in the file tnsnames.ora which comes with 3 predefined service names (one of them is "XE").
I installed the Oracle Express database OracleXE112 which already comes with some preinstalled demo tables.
When you start the installer you are asked for a password. I entered "xxx" as password. (not used in production)
My server runs on the machine 192.168.1.158
On the server you must explicitely allow access for the process TNSLSNR.exe in the Windows Firewall. This process listens on port 1521.
OPTION A: For C# (.NET2 or .NET4) you can download ODAC11, from which you have to add Oracle.DataAccess.dll to your project. Additionally this DLL depends on: OraOps11w.dll, oci.dll, oraociei11.dll (130MB!), msvcr80.dll.
These DLLs must be in the same directory as the EXE or you must specify the DLL path in: HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.112.4.0\DllPath. On 64 bit machines write additionally to HKLM\SOFTWARE\Wow6432Node\Oracle\...
OPTION B: If you have downloaded ODAC12 you need Oracle.DataAccess.dll, OraOps12w.dll, oci.dll, oraociei12.dll (160MB!), oraons.dll, msvcr100.dll. The Registry path is HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.121.2.0\DllPath
OPTION C: If you don't want huge DLL's of more than 100 MB you should download ODP.NET_Managed12.x.x.x.xxxxx.zip in which you find Oracle.ManagedDataAccess.dll which is only 4 MB and is a pure managed DLL which works in 32 bit and 64 bit processes as well and depends on no other DLL and does not require any registry entries.
The following C# code works for me without any configuration on the server side (just the default installation):
using Oracle.DataAccess.Client;
or
using Oracle.ManagedDataAccess.Client;
....
string oradb = "Data Source=(DESCRIPTION="
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.158)(PORT=1521)))"
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)));"
+ "User Id=SYSTEM;Password=xxx;";
using (OracleConnection conn = new OracleConnection(oradb))
{
conn.Open();
using (OracleCommand cmd = new OracleCommand())
{
cmd.Connection = conn;
cmd.CommandText = "select TABLESPACE_NAME from DBA_DATA_FILES";
using (OracleDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
listBox.Items.Add(dr["TABLESPACE_NAME"]);
}
}
}
}
If the SERVICE_NAME=XE is wrong you get error 12514. The SERVICE_NAME is optional. You can also leave it away.
In my case the database had ran out of disk space. Which caused it to not respond. Once I cleared up that issue everything worked again.
I got the same error because the remote SID specified was wrong:
> sqlplus $DATASOURCE_USERNAME/$DATASOURCE_PASSWORD#$DB_SERVER_URL/$REMOTE_SID
I queried the system database:
select * from global_name;
and found my remote SID ("XE").
Then I could connect without any problem.
In my case, round brackets around the SERVICE_NAME was missing in the tnsnames.ora file.
<DBNAME> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=TCP)(HOST = nupark-cnvr-ora )(PORT=1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <DBNAME> ***CLOSING ROUND BRACKET WAS MISSING HERE***
)
)
LISTENER_<DBNAME> =
(ADDRESS = (PROTOCOL = TCP)(HOST = nupark-cnvr-ora)(PORT = 1521))
I had just to replace my connection string
from:
jdbc:oracle:thin:#localhost:1521:xe
To:
jdbc:oracle:thin:#localhost:1521:orcl
For me this was caused by using a dynamic ipadress using installation. I reinstalled Oracle using a static ipadress and then everything was fine
Restarting the VM worked for me
My issue was resolved by replacing the'SID' in URL with 'service name' and correct host.
tnslsnr is up but database is down.
For oracle novice it is not obvious that database may be down while connections are accepted.
I had to start up database manually like that
su - oracle
export ORACLE_SID=XE
sqlplus sys as sysdba
And then in sql console
startup
In my case i failed to startup but got another error message and found the source of a problem - i had to change host name and then database auto startup was functional again.
I have implemented below workaround to resolve this issue.
I have set the ORACLE_HOME using command prompt
(right click cmd.exe and Run as System administrator).
Used below command
set oracle_home="path to the oracle home"
Go to All programs --> Oracle -ora home1 --> Configuration migration tools --> Net Manager --> Listener
Select Database Services from dropdown.
Both Global database name and SID are set to the same (ORCL in my case).
Set Oracle Home Directory.
Oracle Net Manager window example from oracle documentation:
Click on File and save network configuration.
The problem was that my connection string url contained database name instead of SID.
Replacing database name with oracle database connection SID solved this problem.
To know your oracle SID's you can browse tnsnames.ora file.
XE was the actual SID, so this is how my tomcat connection string looks like now:
<Resource
name="jdbc/my_db_conn"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:#//127.0.0.1:1521/XE"
username="test_user"
password="test" />
My server version was "Oracle 11.2 Express", but solution should work on other versions too.
I had a case that I used DBMS where I had to fulfill a db connection form.
I put SID into the Database field and in the dropdown, next to the field, I had had 'Service Name' value instead of 'SID' value.
(normally I don't use Oracle database so I've not been aware of the difference)
That was the reason I got the error message.
The problem can be in the incorrect URL.
For example, I'm using Oracle database (inside VM) with Spring framework and having this issue.
I had in my application.properties file:
spring.datasource.url=jdbc:oracle:thin:#//localhost:1521/orcl12c
But the db version was defferent:
spring.datasource.url=jdbc:oracle:thin:#//localhost:1521/orclcdb
The correct URL can be found in the tnsnames.ora file (this file would be available where the Oracle server, so if you using VM, you should look for this file inside your host VM).
For example for Oracle in the VirtualBox the command to see this file is:
nano /u01/app/oracle/product/version/db_1/network/admin/tnsnames.ora
In my case for Linux environment, the oracle file at ORACLE_HOME/bin was highlighted in "Red" color with different permissions as below:
I changed the permissions of this file as below:
1) Stop Oracle -> sudo systemctl stop oracle.service
2) Change the permission of oracle file at ORACLE_HOME/bin directory as "sudo chmod 777 oracle"
3) Start Oracle -> sudo systemctl start oracle.service
Then after this change, I checked the status of listener using lsnrctl status.Here, I can see the db instances loaded successfully.
However, I can connect using sqldeveloper only, with sqlplus command line I'm getting ORA-12547: TNS Lost Contact error. So, this can a quick workaround to use sqldeveloper.
Note: Take a backup of oracle file before changing the permissions.

connecting SQL SERVER 2005 from Oracle

i am running Oracle and SQL SERVER 2oo5 on the same server.
Plstform win 2003 Enterprise.
i have created a System file DSN.
Make the entry in listener.ora and tnsnames.ora.
but when i m tring to ping my dsn system dont responds. and when i m trying to create a database link using my dsn, it gives error.
What to do ?
thanks for help in advance.
Sunil
You have to:
-Create the UDL file
-Configure the heterogeneus services ($ORACLE_HOME\hs\admin) and create a file like initDATAB.ora with this content:
HS_FDS_CONNECT_INFO="UDLFILE=C:\\ccc\\SQLSERVER.udl
-Add entry on listener.ora on SID_LIST_LISTENER like this:
(SID_DESC=
(SID_NAME=DATAB)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM=hsolesql)
)
-Create an entry on tnsnames.ora:
SQLSERVERDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = riereta)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME=DATAB)
)
(HS=OK)
)
-Create a database link pointing to SQLSERVERDB
References:
-Oracle® Database Heterogeneous Connectivity Administrator's Guide
-Oracle® Database Net Services Reference
-CREATE DATABASE LINK on Oracle® Database SQL Reference

Resources