Oracle SQL Developer 12505 error since change of network - oracle

since I changed my standard landline connection with a wireless one via a 3g hotspot I cannot open my db in Sql Developer. I get the error :
"Listener refused the connection with the following error: ORA-12505 TNS:listener does not currently know of SID given in the connect descriptor"
I changed the hostname values in the listener.ora and tnsnames.ora files and I think it has something to do with the hostname given there. Also I have 2 copies of listener.ora and tnsnames.ora files. 1 copy in the admin folder and another in the sample folder it contains. Should I modify all files?

Files in the sample folder are just that - samples. Oracle never actually uses them. The error you are getting is definitive proof that your request actually reached a listener. So I'd expect that you changed something besides just your underlying network. You said you changed your hostname in tnsnames.ora. Why? If you changed it to some other machine, one that obviously happens to have an oracle listener (else you could not have gotten ORA-12505), then I would not expect that listener to know about about your database, which resides on the host that was originally specified in your tnsnames, before you changed it. And why change HOSTNAME in your listener.ora file? Changing from a "landline" to a wifi connection does not change the names of the servers or the databases, or anything else.

Related

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.

Configuring IBM DB2 ODBC - Changing the Host IP / Alias already exists

I've created an IBM ODBC connection to my server via Microsoft's own ODBC Administrator. After initially finding difficulties on where to put in the IP Address (otherwise, the ODBC uses my local database server), it finally managed to connect to my server PC successfully.
During this process, however, I did not put in a Database Alias, as I did not know what it means, nor what it is for. The ODBC still works fine.
The server, however, changed its IP Address. I don't know how or why it does that, and how to stop it, but now my previously working ODBC is now unable to connect, saying it gave an error message at 192.168.1.127, the server's previous IP Address.
I tried, and failed, to find out how to change the Host IP via the ODBC configuration.
In frustration, I deleted the ODBC connection, created a new one under System DSN, etc., etc., but upon clicking finish, it says the alias URCDB already exists.
How can I solve these problems?
Note:
URCDB is the name of my database. In both occasions, I did not put
anything in the alias field.
There are two URCDBs during the ODBC creation process. One was for
the local test database I used to have on my PC (deleted), the other,
I guess, was the left over from the recently deleted ODBC to my
Server.
You have two options:
1. Create a DSN with different alias.
When creating DSN give the original database name in database name filed and in alias field provide different name other than origina database name.
uncatalog the database name using the below command
go to run --> type db2cmd
db2 uncatalog database database name
now open ODBC create the DSN with giving DSN name and alias name as original database name
Most likely your server has DHCP enabled whereas servers shoud have a static IP address. Hope this helps. DHCP addresses are usually consistent but depending on what level network protocols are in place, the can and will likely change at some point.

I can access my oracle database by command line, but cannot by navicat, ORA-12514 error

I use the command prompt to connect my Oracle database. All functions work, but when I try to use my Navicat to connect to the database, it shows the following error message:
ORA-12514:TNS:listener does not currently know of service requested in
connect descriptor.
My general settings for Navicat are:
host type:basic
ip address:127.0.0.1(also try my ip, but still have same problem)
port:1521
service name:orcl
By "all functions work", I assume you mean you are able to connect to the database and query.
Can you show us the connect that you use.
If you are using sqlplus in this fashion,
sqlplus userid/password#database1
it means your current client is pointing to the correct tnsnames.ora. May be navicat does not point to the correct tnsnames.ora file? The error indicates that you want to connect to, say database1, and Oracle is not able to map "database1" to the correct server, host and port number.
Have you gone through the connectiond details here?
http://www.navicat.com/en/products/navicat_oracle/oracle_detail_win.html
What is your operating system version and oracle version?

Getting ORA-12560 with Oracle Express 10g

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

Oracle TNS: net service name is incorrecly specified

I'm trying to access an Oracle database on an old server we inherited for a client.
I'm confident I have the Oracle database and listener started and working, but when trying to access sqlplus or the exp commands, I'm getting the following error:
ORA-12162: TNS:net service name is incorrectly specified
I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather than an external URL and I am able to successfully tnsping my connection, but am not getting much further.
Try setting the Oracle SID
set ORACLE_SID=database name
export ORACLE_SID=bvteng worked for me, where bvteng was the service name.
Are you trying a local connection (e.g. "sqlplus u/p") or a network connection (e.g. "sqlplus u/p#pnews10s.world")? Are they both giving you the same error?
The TNSPING by definition is using a network connection. I see some references that indicate you can get the 12612 error when using a local connection. So that is a possible explanation why you are seeing the error from SQLPlus but not TNSPING. If so, try doing a network connection instead.
The local connection not working is probably due to ORACLE_SID not being set correctly as John suggested, but his syntax may not be the right method for whatever shell you are using. Make sure you are using the correct method for the given shell, such as "export ORACLE_SID=name" or "setenv ORACLE_SID name".
I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather
than an external url and am able to successfully tnsping my connection, but am not getting much further.
The last time that happened to me (tnsping works but sqlplus does not, same error message you got), the issue was that someone had copied the tnsnames.ora file from a Windows machine, and left the wrong line feed codes in.
If that is the case, you need to do some dos2unix.
These files are very sensitive to "correct" white-space and tabbing.
Someone should complain to Oracle about that.
Dave Costa has presented you with 2 important question. Are you trying to connect via net8 or locally via extproc? Is the listener on the local machine(127.0.0.1 -- loop back device) setup for extproc connection?
To use the net8 or tcp connection protocol, you need to specify user/pw#tns_alias. To connect locally via extproc you should specify the oracle_sid parameter and then connect via name/pw.
I also notice the tnsalias has the .world domain appended to it, but the sqlnet.ora file does not contain a reference to NAMES.DEFAULT_DOMAIN as being "world".
Also what is the env parameter for TNS_ADMIN? Make sure your tools are looking at the correct tnsnames.ora file. Too many time people modify one tnsnames.ora and the programs/software is looking at another.
Check the tnsnames.ora file, in my case, took me days to find out there were either tab characters in the connection string or other invisible special characters that were causing it to fail.
In my case, the problem was that the DSN and the ServiceName was configured as the same in the odbc.ini file.This should not be a problem, but only after changing the DSN name, I was able to connect to the database through isql.

Resources