Oracle on Mac OSX, access from a virtual machine - macos

I've installed Oracle on Mac OSX Snowleopard following the guide of Raimonds Simanovskis, as far as I know the only working installation guide for Snowleopard.
As long as I use Oracle only on the Mac under MacOX itself, it works well, no problems.
Now I have a virtual machine on the Mac (Parallels Desktop 5), and in this VM Windows XP is running. I want to access the Oracle database, which is running on Mac OSX, from the VM under Windows. Logically it is like accessing from a different computer. But always when I try to access from XP, for example with sqlplus
sqlplus iwes/iwes#192.168.3.2:1521/dbname
(192.168.3.2 it the address of MacOS using 'Host only networking'. This address is working well in other applications.)
then I get the error message
ERROR:
ORA-12541: TNS: Kein Listener [German for: "no listener"]
(on Mac OSX both Oracle and the listener are started and working)
What is wrong or missing in my Oracle installation?
Here is my listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = dbname)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(GLOBAL_DBNAME = dbname)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
and my tnsnames.ora
dbname =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = dbname)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

your listener.ora should specify 192.168.3.2 as host, instead of localhost.
your tnsnames.ora should specify 192.168.3.2 as host for alias dbname (if you use tnsnames.ora at all)
In your example you don't use tnsnames.ora but jump directly to the mac's ip-address.
Also check the firewall on the mac.

Related

ORA-12170: TNS:Connect timeout occurred When try to connect from host OS

I have Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production installed on virtual machine(VirtualBox, OS: Oracle Linux 7).
All going normal, when I try to connect from the virtual machine where oracle database installed. (sqlplus sys/sys_password#192.168.56.101/XE as sysdba).
But I have ORA-12170 error when I try to connect to oracle from the host OS (Windown 7 x64) by using the same command.
ping 192.168.56.101 command from host OS is successfull.
Now I'm using host only network, but I had same results with bridged connection.
Here is my tnslistener.ora file:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
What am I doing wrong?
It seems your listener is incorrectly configured. If you use localhost.localdomain as HOST then the listener will bind to loopback interface only.
Try to use actual IP address instead of localhost.localdomain. Also you can use 0.0.0.0 as HOST so the listener will bind to any interface to avoid hardcoded IP address, but I don't recommend this on production server.
Also check if your guest firewall does allow TCP communication on 1521 port.
Following is my working listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)

TNS listener does not correctly know of the SID given in connect descriptor

I went through the posts that suggested solutions to the same error but could not fix. I am on windows 8 and on tryign to runa java program that connects to oracle database by Type 4 driver, I am getting this error:
On running, lsnrctl status
and this is inside my listener.ora
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_2\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_2)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = HP)(PORT = 1521))
)
)
String that I used to connect to it in my java program is as follows:
"jdbc:oracle:thin:#localhost:1521:XE"
How can I fix this?

ora 27101 shared memory real does not exist when connecting to remote server

I have a problem with a remote Oracle database server, it runs in windows and my client runs on linux
if I use sqlplus with the ORACLE_SID it works
sqlplus my_user/my_pass#REMOTEDB
However if I do the same by using the ORACLE_SID environment variable this error appears:
export ORACLE_SID = REMOTEDB
sqlplus my_user/my_pass
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
this is my tnsnames.ora file
REMOTEDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.150)(PORT = 1521))
)
(CONNECT_DATA =
(SID = REMOTEDB)
(SERVER = DEDICATED)
)
)
and this is my listener.ora file
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oracle\product\11.2.0\dbhome)
# (PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\oracle\product\11.2.0\dbhome\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = REMOTEDB)
(ORACLE_HOME = C:\oracle\product\11.2.0\dbhome)
# (PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\oracle\product\11.2.0\dbhome\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.150)(PORT = 1521))
)
)
I'm really stuck with this, any suggestion would be appreciated
ORACLE_SID only works for local databases that use the BEQ adapter (implemented with pipes, not network sockets). Use TWO_TASK instead if you want to connect to a remote database. (And don't question the name TWO_TASK, it has historical reasons ;-)
See, for example, http://ora-exp.blogspot.de/2007/06/oraclesid-and-twotask-environment_21.html (it's a bit old but not outdated).

How to acess locally installed Oracle 11 g throught PL/SQL Developer 9

I need to develop in PL SQL using PL/SQL developer but I don't have idea how to make both oracle 11g and pl/sql developer work in the same machine because pl/sql developer need 32 bit oracle client installed when oracle did not require client when we work in local machine.
This is what I did:
1) I installed oracle 11g 64 bit Enterprise on drive d:\
2) Then I installed oracle client 32 bit on drive c:(pl/sql developer can work only with 32 bit version of oci.dll)
3) After I went to the client_home%->Network->Admin folder and corrected tnsname.ora file and wrote there my connection setting which was copied from my oracle 11 g home_dir..tnsnames.ora
MyOracle =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
After I installed PL/SQL developer in c:\plsqldev\ and rebooted my machine.
So now I can connect to my database with sql*plus located in my oracle database directory , but when I try to connect to my oracle with my client sql*plus it says tns protocol error when I try to connect using pl/sql developer it says could not resolve the connection identifier specified. What should I do? Could you help me please
Added:
I erased TNSNAMES parameter from NAMES.DIRECTORY_PATH (in both - server and client sqlnet.ora files) and now when i login it says: ora-12154 tns could not resolve the connect identifier specified , but it still sucessfully connecting to DB when i try to connect with SERVER - s sql*plus.
Here is my config files:
**servers listener.ora **
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Light\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Light\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\Light
servers sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NONE)
NAMES.DIRECTORY_PATH= (HOSTNAME)
servers tnsname.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)
)
)
Clients sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NONE)
NAMES.DIRECTORY_PATH= (HOSTNAME)
Clients tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
ADD:
Yess!)) Finally i found the solution: :)
We need to use server's config file instead of clients one - but the oci.dll(32bit) must be taken from clients directory. I will describe the basic steps - how i made pl/sql developer 10.0.2 work with locally installed Oracle 11.2 x64:
1) Fist we need to install Oracle (I installed it to d:\app)
2)Then wee need to download and install oracle instant client (i founded that there are not any config files (not even network->admin directory) in the instant client , just needed dll's like oci.dll and etc.. note: the first time i've choosen "administrator" one which have it's own config file inside, seems this kind of client is needed only for remote access to Oracle). I installed(unpacked) my instant client to c:\app\ ;
3) Open PL/SQL developer , go to tools->preferences->connection and set the "Oracle Home" filed to the home directory of your instant client (I puted c:\app), but usually it already exist in the drop down list and we just need to click the drop down list and choose OraClient11g_home1_32bit , by this way i set the oci library path(choosen from drop down list). Click apply and exit from pl/sql developer;
4) Now we need to create two environment variables(the fist one will show the path to folder with connection configs , the second the language(if i'm not right please correct me)) ->
TNS_ADMIN = %SERVER_HOME%\NETWORK\ADMIN\ (i puted D:\app\Light\product\11.2.0\dbhome_1\NETWORK\ADMIN)
TNS_LANG = AMERICAN_CIS.CL8MSWIN1251
5) Reboot (optionally) and then start pl/sql developer - there must be three connection alias , i choosed orcl , entered my login ,password and hiited OK and everything worked )));
Thank's to everyone who answered in this topic, hope it'll help someone
check the port name in tns file it sholud be 1521 and where XE is my local db name
like this E =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Shantu)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

oracle 11XE and ODT32 on windows - multiple issues

I installed Oracle 11 XE on a 64bit Windows 2008R2. This is a development machine, therefore I have also installed Oracle Developer Tools for .NET (32bit). Both these installations come with their own version of SQLplus.
I have set up the tnsnames.ora and sqlnet.ora to be identical for both these oracle products, but I cannot connect to the local XE from either SQLplus. I get ORA-12560 everytime. the Oracle 11 XE home page also doesn't start.
---TNSNAmes.ora ----
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DDSAP236.asxdev.asx.com.au)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
----END TNSNAMEs.ora---
---Listener.Ora ---
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\Oracle\11Express\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\Oracle\11Express\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = DMACHINE.MyDomain.com)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
--End listener.ora----
In services.msc and lsntctrl both shows the XElistener service have started.
I am wondering what else I can check?
Can I run XE (32bit) on Win2008R2?
Can I run XE together with ODTODAC32 on Win2008R2?
How do I resolve ORA-12560 so I can connect to the XE database?
Additional Info
In the registry of this machine under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Note\Oracle I have 5 folders - can someone confirm if this is correct?
The folders are:
KEY_ (not sure if this is correct)
KEY_OracleClient11g_HOME (the Oracle ODT client install's home)
KEY_EX (11g EX install's home)
ODP.Net (part of ODP install )
OracleMTSRecoveryService (part of ODP install)
If that's indeed your TNSNAMES.ORA, your syntax is broken - you have extra spaces in front of the connection aliases (first line of each entry), which might cause your problems. Your TNSNAMES.ORA should look like this:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DDSAP236.asxdev.asx.com.au)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
If your "real" TNSNAMES.ORA is correct, however:
what is the output of lsnrctl status?
what does your listener log contain?
does sqlplus / as sysdba work?

Resources