I have two computers, Computer A has IP (10.11.11.2) which contain oracle database 11g R2 and Computer B has IP (10.11.11.18). I searched alot and make some changes in Tnsnames.ora and listener.ora files but cannot connect. But when I tnsping 10.11.11.2 from client it gives me OK output. That's mean database is accessible from client but I am unable to connect database using Toad or Sqldeveloper.
Error is given :
tns does not currently know of service requested
My Computer A (10.11.11.2) tnsname.ora and listener.ora files paste below:
Tnsnames.ora file
# tnsnames.ora Network Configuration File: D:\app\Mobilityusr\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
listener.ora file
# listener.ora Network Configuration File: D:\app\Mobilityusr\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Mobilityusr\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Mobilityusr\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.11.11.2)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Mobilityusr
My Computer B (10.11.11.18) tnsname.ora and listener.ora files paste below:
tnsnames.ora file
# tnsnames.ora Network Configuration File: D:\app\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
listener.ora
# listener.ora Network Configuration File: D:\app\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app
Image of tnsping from computer B to oracle database (installed on Comupter A) is also attached:
Error image also attached
After a lot of research I solved the problem.And I must share it with you too so that any one who have this problem can solve it easily.
Listener.ora file is used to listen requests. We must add two entries(one for SID and other for machine IP address) in listener.ora if we want to access database from another computer.
Computer A files(listener.ora and tnsnames.ora) setting are given below:
Listener.ora
# listener.ora Network Configuration File: D:\app\Mobilityusr\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Mobilityusr\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Mobilityusr\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = D:\app\Mobilityusr\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.11.11.2)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Mobilityusr
SID_LIST_LISTENER contains two entries first SID_DESC is by default entry and we must add 2nd SID_DESC in order to identify orcl SID otherwise following error will be given by Sqldeveloper or toad or sqlplus when connecting database from other machine:
error: sid does not currently know
Now Listener contain two entries one by default for localhost and we must add 2nd entry which contain server machine IP. By this entry database on server machine can listen coming connections which contain this IP address will be connected to server database.Otherwise database will not be connected.
Note: You can use these configurations but don't forget to change IPs and oracle_home path
and tnsnames.ora file is used to define alias of any database parameters(SID,PORT,HOST). But it is not compulsory to change tnsnames.ora to connect server and client so I am not modifying tnsnames.ora located at server machine.
Computer B tnsnames.ora is same as above mentioned in question.
Computer B listener.ora is same as above mentioned in question.
Summary:
You only need to change listener.ora file located at server machine (Oracle_home/network/admin/).and add two entries one in SID_LIST_LISTENER to add SID detail and 2nd in LISTENER to add machine IP description.
Also check environment variables (ORACLE_UNQNAME,ORACLE_SID,ORACLE_HOME,TNS_ADMIN etc)
One more important thing You must check that Listener service is up and running
use these commands(Open CMD and type) :
**lsnrctl status **
**lsnrctl start **
**lsnrctl stop **
and when you change listener.ora file you must stop and then start lsnrctl service in order to changes effect.
In SQLDeveloper, instead of specifying SID, choose Service Name.
I had lots of trouble with same problem but with Oracle 12C. Finally got it working with almost similar solution.
My database server is on 192.168.1.165 with port 1526.
Also had to open port 1526 in Windows server firewall.
# listener.ora Network Configuration File: G:\app\db12\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 = G:\app\db12\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:G:\app\db12\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1526))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1526))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1526))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.165)(PORT = 1526))
)
)
Related
while I am login to sqlplus using command prompt getting protocol adapter error.
But, if I login using SQLPlus of oracle then it will login successfully.
Because of this issue, even i am not able to access TOAD.
Can anyone help me for to resolve the issue.
CHECK THE SCREENSHOT HERE
Copying text of LISTENER.ORA and TNSNAMES.ORA
LISTENER.ORA
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\ProgramFiles\oracle12c\app\oracle\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\ProgramFiles\oracle12c\app\oracle\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = XXXXX-pc)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
TNSNAMES.ORA
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
If you are ensure your configration is true,
Maybe, the notepad which you edit your tnsnames.ora, listener.ora files can put '....'(dots) front of each newline.
For example:
ORACLR_CONNECTION_DATA =
...(DESCRIPTION =
.....(ADDRESS_LIST =
.......(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
....)
....(CONNECT_DATA =
....(SID = CLRExtProc)
........(PRESENTATION = RO)
....)
..)
you can check this case with notepad++ selecting 'Show All Charecters'.
I am getting this error when trying to connect to freshly installed Oracle Enterprise from either SQL Developer or Net Manager. I did try every solution that I could find with no luck.
I am trying to connect with a system account and I am able to log in with sqlplus, so I know that my credentials are correct.
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\OracleUser\product\12.1.0\dbhome_2\bin\oraclr12.dll")
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Oracle\OracleUser\product\12.1.0\dbhome_2)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\Oracle\OracleUser\product\12.1.0\dbhome_2\log
tnsnames.ora
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
error inside the ...\product\12.1.0\dbhome_2\log\diag\tnslsnr\iper410a\listener\trace\listener.log
24-APR-2016 19:10:33 * (CONNECT_DATA=(CID=(PROGRAM=null)(HOST=__jdbc__)(USER=null))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1195)) * establish * orcl * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
24-APR-2016 19:10:40 * (CONNECT_DATA=(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=my_windows_login))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1198)) * establish * orcl * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
It confuses me that instead of 'system' Oracle account, the error is listing my windows login account (my_windows_login).
Please advise!
It seems you have two oracle homes.
Check the output of cmd -> tnsping orcl command. You can see which oracle directory is being used.
Then you can check Environment Variables -> System Variable -> Path and reorder Oracle Home directories. This worked in my case.
Yesterday I restarted my machine and now my DB is unavailable.
I had already some difficulties to run it the first time because there were two different installations of Oracle DB.
The windows services that I suppose they should run:
OracleJobSchedulerFOOBAR
OracleOraDB12Home3MTSRecoveryService
OracleOraDB12Home3TNSListener : OracleOraDB12Home3TNSListener service on your local computer start and stopped. Some service stop automatically if they are not in use by other services or programs.
OracleServiceFOOBAR
OracleVssWriterFOOBAR
So as you can see : I can not start the OracleOraDB12Home3TNSListener service.
I changed the file tnsnames.ora :
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
FOOBAR=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myurl.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = FOOBAR)
)
)
And my listener.ora is
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\OracleDB\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myurl.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
I already try a lot of things like :
sqlplus / as sysdba and startup but I got
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_FOOBAR'
alter system set local_listener='FOOBAR'; scope=spflile; but I got
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
When I check I the Oracle Administration Assistance for the OracleDB12Home3 :
ORACLE_SDI = FOOBAR
ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1
Does someone has any idea on how to help me?
After long investigations, thanks the help of a colleague, it's working.
To sum up how we did to solve it :
So to fix my first issue 'OracleOraDB12Home3TNSListener can not start' was due to that I had a new IP. So I changed it in my config (...\NETWORK\ADMIN
): https://community.oracle.com/thread/855326
when I was trying to connect with sql developer (after the restart of my computer). I had the error: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist. That was meaning that my DB was not started (http://www.dba-oracle.com/sf_ora_01034_oracle_not_available.htm).
So I try start the db manually sqlplus / as sysdba and startup but I had always this output :
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_FOOBAR'
To fix I tried to work on the LISTENER.ORA and TNSNAMES.ORA files :
LISTENER.ORA
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\OracleDB\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC =
(GLOBAL_DBNAME=FOOBAR)
(ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
(SID_NAME = FOOBAR)
)
)
LISTENER_FOOBAR =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
TNSNAMES.ORA
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
FOOBAR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = FOOBAR)
)
)
I try to restart the right windows service several times : OracleServiceFOOBAR but nothing was changing. I had always the same issue. I remember that I did pfile configuration.
So I decided to change the pfile configuration with something like alter system set LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' scope=both;. Right but I can't apply any command line because the database don't start...
so i created a pfile called init.ora with *.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' trick from ORA-00119: invalid specification ORA-00132: syntax error. And I started the DB wit this file in parameter SQL> startup pfile=c:\oracledb\admin\XXX\pfile\init.ora
And then it was working.
I have a virtual box machine with server 2008 where Orcale 11g 64 bit is installed, and I can login using sqlplus in the vm.
The vm use the NAT networking and the ip of the vm is '10.0.2.15' (My host ip is 192.168.2.10).
Then I open the Network port forwarding to forward port 1521 in my host to 1521 in the vm .
Then I test the forwarding in my host:
telnet localhost 1521
It is successful.
However when I treid to create a local net serivce through the Net Configuration Assistant, but I meet the error:
ORA-12547: TNS lost contact.
What's going on?
listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Administrator
tnsnames.ora
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
I am not sure what happened, but after I change the localhost to machinename in the listener.ora, it works.
For guys who meet the same problem, you can have a try.
I am currently running Oracle 11g on a Windows 2012 Environment.
I recently added another NIC to allow for failover, however I am not sure as to what to do with my listener.ora file and my tnsnames.ora file. Could someone offer guidance? For reference, the current IP I am using is 192.168.0.52 and the IP of the second NIC that I would like to add has the IP of 192.168.0.53.
Below is my listener.ora file:
# listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Administrator
Below is my tnsnames.ora file:
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
Thanks for all your help!
Well, you can specify multiple ADDRESS entries in the listener.ora:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.53)(PORT = 1521))
)
)
And in tnsnames.ora:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.53)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
When I specify multiple addresses for listener, it listens on all interfaces listed. And when at least one address in tnsnames can be connected to -- it connects. I have 11g available for testing both on the client-side and on the server-side. I checked the documentation (Multiple Address Lists in tnsnames.ora) and it states that parameter (FAILOVER=on) can be specified in tnsnames.ora explicitly.