Getting ORA-12560 with Oracle Express 10g - oracle

I started to receive this error while I`m using C# with Oracle 10g.
ORA-12560 and I really need to solve it as I`m running out of time on my grad project.

ORA-12560 is a configuration issue. This makes it difficult to diagnose remotely. I have answered a similar question on SO before. my advice is general enough that it should help you too. Find out more.
If it doesn't you'll need to post more details of your listener.ora, tnsnames.ora and perhaps your hosts files.
edit
"All the files are hosted here:"
Hmmmm. Both listener.ora andtnsnames.ora reference HOST = SIKAS-TOSH but server is not included in the hosts file.
edit 2
"the Oracle 10g Express Edition is
installed on my PC"
If your database is on your PC then the files on some web-server are irrelevant. It is the listener.ora andtnsnames.ora on your PC which matter. Those versions of the file need to reference HOST = localhost or else your hosts needs to include SIKAS-TOSH as an alias for 127.0.0.1.

Make sure your listener is running. If it is, try restarting it and re-registering your database with it (through sqlplus as sysdba, type the command alter system register;). Also, make sure that if you run a local firewall you have allowed the port 1521 for incoming traffic (or your custom port if you have changed this).
In Windows the listener is a service, prefixed with the oracle home name + TNSListener.
In Linux, set your oracle home environment and type:
lsnrctl stop
lsnrctl start

I have unintalled and re-installed the oracle 10g many times as well as the ODAC112011beta, last time I didn`t install the ODAC112011beta, instead, I used the Oracle.DataAccess.Client file found in the C:\oraclexe\app\oracle\product\10.2.0\server\BIN\Oracle.DataAccess.dll ... then I started the service from START->All Programs->Oracle Database 10g Express Edition->Start Database as administrator ... now I can connect to the Oracle through C# ... I hope I face no more problems

Related

Point local TNS listener to remote database

I'm using neXtep to compare databases, and I'd like to use it for version control for an Oracle database. The connect string
REPORT_DEV2 = (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dbs-nprd1-vm-002.mycompany.com)(PORT=1550))(CONNECT_DATA=(SERVICE_NAME=DEV.MYCOMPANY.COM)))
works with tnsping
TNS Ping Utility for 64-bit Windows: Version 18.0.0.0.0 - Production on 02-DEC-2019 21:22:55
Copyright (c) 1997, 2018, Oracle. All rights reserved.
Used parameter files:
C:\app\woodsman\product\18.0.0\dbhomeXE\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dbs-nprd1-vm-002.mycompany.com)(PORT=1550))(CONNECT_DATA=(SERVICE_NAME=DEV.MYCOMPANY.COM)))
OK (20 msec)
The dialog
Is misleading. When I give it the service name as the database name, it says:
ORA-12505, TNS:listener does not currently know of a SID in the given connect descriptor.
I have no way of telling it to use a service name and not a SID. I'm hoping I can set up a TNS Listener entry in my local tnsnames.ora file that points to the service name that I want to use. Oh, and the neXtep program is on github, but is no longer being supported. Worse, I've tried but cannot figure out how to build it myself so that I can fix it.
I was able to find a SID to use. It seems that while I normally use a service name, somehow there's a local SID that gets built as part of the Oracle installation process. Nonetheless, for anyone who uses nexTep for Oracle, please make sure you have access to the SID name.
The Database name prompt in the nexTep dialog is really asking for a SID name. Bonus points to anyone willing to fix this one issue with nexTep so people can, out of the box, use an Oracle service name. Even better if they can change it to allow a straight up JDBC URL like every other Java based program.

SQL Server 2016 linked Oracle Server - Suddenly stopped working

After rebooting my Windows Server 2016 Standard (SQL Server 2016) my SSIS process that runs this query:
select * from openquery(HRMPROD, 'SELECT QUERY HERE' )
started failing with this error:
I get the same error if I try to run the query in SSMS. I have the same linked server set up on my test instance and the query is successful when I run it there. I have compared the linked server create script on both instances and it is the same.
Any idea where I should look for what is causing the connection issue on the one server but not the other?
Thank you.
Saying the answer is on the Oracle side is just like pointing fingers across the way. Let's just fix the issue here.
There is a connection string that is used from SSIS, (which you also used in SSMS) The connection string contains three main components to connect and would result in the 12154 error if any of them were incorrect:
Host
Instance name (different than Instance on Sql Server, think database name)
port
The port most likely hasn't change, neither has the database name, but the host...No, hasn't changed, but the DNS server used to connect most likely has! I would ping the host and see what returns from the SSIS and your SSMS host that you're using. I would expect it to fail. Find out what IP address the host is using and ping that - see if it returns. I'm guessing that's the change that needs to be updated or your Network folks need to fix a DNS configuration/server issue.
Hope this helps!
Kellyn
Since you are getting a response from the TNS Listener, the problem lies on the Oracle side. See Architecture of Oracle Network Services for an overview of how the Oracle networking handles things. Keep in mind that based on the error message you've reached the TNS Listener, so you only need to check things between TNS and the Oracle database... In other words, your networking and SQL Server settings are fine or you wouldn't be able to get this error message.
I would agree with above that the issue might have to do with the network. I have come across that a few times, where we can set everything up, but a firewall is blocking communication between the two servers.
Open up powershell on the new server and run a tracert to the target to see the hops and identify if is connecting across the network.
If it is, then run a test-netconnect on the specific port, to see if the port is open from the firewalls.
Cheers!

ORA-12541 TNS :no listener on 1 specific remote database, but not on others

Some context: I'm setting up an environment to run some Ruby code our Lead wrote to connect to some remote Databases. I'm using Win10 and have WSL installed. I have installed SQL*Plus, docker, and Ruby, and am sure I have installed all the dependent gems (actually at this point I know for a fact its not a ruby problem). I'm using Docker to use a pre-built image of an Oracle Database, and I have populated it with data.
Obfuscated company DB information:
'Broken' DB (TNS no listener)
Username: W-WORK-DEV
Password: password
Host: host1
Port: 999
SID: W-WORK-DB.tech.company
'Working' DB (can connect just fine)
Username: C-OLD-DEV
Password: password
Host: host2
Port: 999
SID: C-OLD-DB.tech.company
Please note the names I have provided here are purely for obfuscation, they do not represent anything about age or even config. They are essentially the same, just different databases on different hosts. Also note this is a corporate company and would have a lot of base infrastructure for their internal network.
The issue I am having is that with the specific database I am working on, I cannot connect to it. I connect to the company intranet via a VPN (I work offsite) and have issues connecting to WORK-DB.tech.company, though I can connect to C-OLD-DB.tech.company. Methods I have tried to connect with:
Oracle SQL Developer
I have inputted all the correct jdbc strings and username / password. Have even asked other people to attempt to connect (at least 3 others). They can all access C-OLD-DB as well as W-WORK-DB. When using this method, I get The network adapter could not establish the connection.
Side note: I'm fairly sure I have connected to the DB just fine in the past, though I can't be certain because I'm fairly new to this team and have only accessed it once, if that.
SQL*Plus via WSL
I installed SQL*Plus because I think Ruby was accessing it in some capacity when running the script. I got to the point where the script was able to connect to my local docker Database, but when it tried to connect to the remote database, it would return TNS: no listener. I attempted this using sqlplus as well and got the same error.
Example:
sqlplus C-OLD-DEV/password#host2:999/C-OLD-DB.tech.company
This command works and connected to the DB jsut fine.
sqlplus W-WORK-DEV/password#host1:999/W-WORK-DB.tech.company
This command gave me TNS: no listener.
During my research I had found mentions about tnsnames.ora, sqlnet.ora, and listener.ora. I have found relevant files around the company intranet and attempted to use them in my own personal environment to no avail (one of the sqlnet.ora files actually stopped me from being able to connect to any) I found mention about a config/database.yml file related to ruby, but our code already has the database information set up and I seem to be getting to the same solution as the script when trying to manually connect via sqlplus.
Here are some relevant environment variables I have set up when doing these installs. I'm thinking that at some point when trying to set up my environment, I messed up some config that changed the way sqldeveloper or sql plus would connect to that database.
$ echo $ORACLE_HOME: /usr/lib/oracle/12.2/client64/
$ echo $TNS_ADMIN: /usr/lib/oracle/12.2/client64/network/admin
$ echo $LD_LIBRARY_PATH: /usr/lib/oracle/12.2/client64/lib
I hope I have provided all the information I have come across and have explained clearly what my issue is, if you have any questions feel free to comment about it so I can clear it up. Thank you for any and all your help.
So my problem ended up being a 'firewall/port' issue. In the end i found out that specific port I was connecting to was blocked, but I thought it was only on my system. Turns out the VPN I'm using was the issue blocking that port. Company has a Primary Data Center and a Secondary one, and apparently the SDC VPN was blocking that port from me. I switched to using the PDC VPN and it worked.
Are you using the 64 bit jdbc drivers?

Communication between two databases (Oracle, VirtualBox)

Currently I am trying to understand how can two databases communicate to each other (for instance: get data from one to another).
Detailed description
I have two Oracle databases, one on Windows and latter on Oracle VirtualBox. On Windows DB I have one user (PAI) with single table called TESTME. On VirtualBox, only user (PAI_VB) was created. Now, I want to display the content of the TESTME table from SQL Developer from VB.
I have done
I want to display table TESTME using LINK statement:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))';
Note: data from 'DESCRIPTION' section were taken from tnsname.ora file on Windows.
Having that, via following query I will manage to display table:
SELECT * FROM PAI.TESTME#LINK_TO_PAI;
Unfortunately, it does not work.
Error from console
ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "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
Questions
Could you please propose solution to my problem (I know that in *Action section there is a hint but still I cannot solve it).
Maybe, you could introduce me another way to make communication between two databases possible.
EDIT
I managed to connect from my VB machine to one on Win10 via SQLDeveloper and SQLPlus. Unfortunately, using Oracle LINK I can not access data from database.
SOLVED !!
I managed to solve my issue. The problem laid in LINK. Since following part:
'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))'
was inside tnsnames.ora file i should define my link as follows:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'xe';
After that minor change, I was able to freely us LINK in my example. Cheers :)
Here's what you need to have for a working database link:
Network connectivity between the two hosts.
Oracle Listener process running on the host you want to connect to.
Correct TNS entry while creating the link.
Correct username and password to connect to the remote database.
The TNS-12154 error you're getting means the database running on the virtual host can't get to XE's listener using the description you gave it.
Make sure you're using the correct IP address when trying to connect to your Windows host from your virtual machine.
Run tnsping from your virtual environment to see if it can get to the Windows host listener.
tnsping 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=your_windows_host_ip_from_step_1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE))'
or just tnsping XE if you have the TNS entry stored as XE in tnsnames.ora file on your virtual machine.
See also: Oracle documentation — Testing Connections.
Once you get OK response from tnsping try connecting to XE with sqlplus (sqlplus PAI/PAI#XE) or via SQL Developer running on the virtual host. If you can connect that way your database link should also work with the same TNS entry.
This is a tricky part of oracle because there are a number of diverent ways to make a connection.
I suggest that you begin to make sure that you have a tnsnames.ora file both on windows and in your virtualbox environment. What os are you running in VirtualBox by the way?
In both tnsnames.ora files both databases should be named. Easiest to make them identical.
Then connect with sql*plus from windows to your database in VirtualBox and from VirtualBox to your database on Windows.
Just to make sure your network and tns config are OK.
If this works recreate your db-link with the servce alias from tnsnames after using. This should work.

cannot connect to Oracle Database 11g Express Edition

I am trying to locally connect to Oracle Database 11g Express Edition
Previously when I used to go to Programs > Oracle Database 11g Express Edition > Getting started
it used to show me the page to login in the browser and I could login and view everything.
But now, as soon as I click on Getting started, it goes to the URL
http://127.0.0.1:8080/apex/f?p=4950
but says "...could not connect to 127.0.0.1:8080"
Please help me. I have no idea where to get started. How do I troubleshoot the issue?
Please make sure the service of oracle-xe is running if you are using winOS,
and you could "ps -ef" if you are using linuxOS. If the service and daemon
is up and running then paste the log of your bdump.
where is the Oracle Event Log located?
Shows you the how to.
May be the problem is with the windows authentication mode.
What you can try is editing sqlnet.ora file.
Original - SQLNET.AUTHENTICATION_SERVICES= (NTS)
Change to- SQLNET.AUTHENTICATION_SERVICES= (NONE)
I had similar issue on windows10- could not use the 'Get Started' choice- (which opens APEX admin console). Found I could connect to DB locally (without the #dbname) but not over sqlnet (with #XE). TNS ping found service fine. Issue was windows firewall- turned it off for the local network, and now can connect with sqlplus user/pwd#xe AND the 'Get Started' link to APEX works.

Resources