Direkt zum Hauptbereich

Using ORE 1.4 on Oracle 12.1c with pluggable databases

It is possible to use Oracle database tables in the R statistical software. And this is a very useful approach (if you know R's capabilities). The fact that you are on this blog now may means that you had no success trying to use tables in R and that you received ORA-12541 once more. To solve this problem, you can omit the next paragraph. However, for getting started with Oracle 12c and R you should take a look at the documentation provided by Oracle. Clear and brief it says that you have to do the following things to use Oracle database in R:

First steps in R

Finally you should be able to connect to the Oracle database by loading the ORE package in R
library(ORE)
and then using the following command to connect:
ore.connect(user="RQUSER", sid="orcl", host="SVR3", password="RQUSERpsw", port=1521, all=TRUE) 

First problems in Oracle 12.1c

But this won't work on Oracle 12.1c with plugable databases (aka. Multi-Tenant). The problem on Oracle 12.1c is, that the host will always be the container database and not the plugged database containing the data you want to use. You need the TNS service name to connect. And despite you might have a well-configurated TNSNAMES.ORA file and all paths set, a connection with the statement
ore.connect(user="RQUSER", service_name="service", password="RQUSERpsw", all=TRUE) will not work and you will always receive an error message: Error in .oci.Connect(.oci.drv(), username = username, password = password, : ORA-12541: TNS: No Listener 

The solution for oracle 12.1c

The actual problem is, that you need to specify also the host name, though you have a TNSNAMES.ORA file. It seems like R isn't using this file and instead it uses the host and the service name directly. So You have to modify the statement by assigning the host name from the TNSNAMES.ORA file:
ore.connect(user="user name", service_name="service", host="host" password="password", all=TRUE)

Where you can find both, the service_name and the host in the corresponding attributes in the file.

Kommentare

Beliebte Posts aus diesem Blog

Pi And More 11 - QMC5883 Magnetic Field Sensor Class

A little aside from the analytical topics of this blog, I also was occupied with a little ubiquitous computing project. It was about machine learning with a magnetic field sensor, the QMC5883. In the Arduino module GY-271, usually the chip HMC5883 is equipped. Unfortunately, in cheap modules from china, another chip is used: the QMC5883. And, as a matter of course, the software library used for the HMC5883 does not work with the QMC version, because the I2C adress and the usage is a little bit different. Another problem to me was, that I  didn't find any proper working source codes for that little magnetic field device, and so I had to debug a source code I found for Arduino at Github  (thanks to dthain ). Unfortunately it didn't work properly at this time, and to change it for the Raspberry Pi into Python. Below you can find the "driver" module for the GY-271 with the QMC5883 chip. Sorry for the bad documentation, but at least it will work on a Raspberry Pi 3. ...

How to use TOracleConnection under Lazarus for Win64

Lazarus Programmers have had no possibility to use TOracleConnection under 64 Bit Windows and Lazarus for years. Even if you tried to use the TOracleConnection with a correctly configured Oracle 11g client, you were not able to connect to the Oracle Database. The error message was always: ORA-12154: TNS:could not resolve the connect identifier specified Today I found a simple workaround to fix this problem. It seems like the OCI.DLL from Oracle Client 11g2 is buggy. All my attempts to find identify the error ended here. I could exclude problems with the TNS systems in Oracle - or the Free Pascal file oracleconnection.pp though the error messages suggestes those problems. After investigating the function calls with Process Monitor (Procmon) I found out, that even the file TNSNAMES.ORA was found and read correctly by the Lazarus Test applictaion. So trouble with files not found or wrong Registry keys could also be eliminated. Finally I installed the Oracle Instant Client 12.1c - aft...

How To Set Up A Rock Pi S - Part 3: The Sound

After the 2nd part of the Rock Pi S setup , I was confident to get some sound out of the board after I made a little hardware hack and connected it to my speaker (with amplifier). Unfortunately, the command speaker-test -t wav -c 2 did not bring any sound out of the Rock Pi S. So there still was a problem left and I had to google it once more.  Thanks to DIYprojecz in Radxa Forum ... I was once more able to fix a problem. For details see  https://forum.radxa.com/t/audio-support-rock-pi-s/1686/28 . What needs to be done: sudo su route add default gw <your.gateway.ip.address> eth0 echo "deb http://apt.radxa.com/stretch-testing/ stretch main" | sudo tee /etc/apt/sources.list.d/apt-radxa-com.list wget -O -  apt.radxa.com/stretch-testing/public.key | sudo apt-key add - apt-get update apt-get upgrade apt-get install -y rockchip-overlay rockchip-fstab apt-get install -y linux-4.4-rockpis-latest rockpis-dtbo apt-get autoremove chmod a+r /etc/group The N...