0

I have (literally) spent days trying to find out if and how it is possible to SETUP OCI on a PI.

"Ask vague questions?" --> "Get vague answers!"... I know that. But all ressources I found are related to win/macos or other unix systems; I could paste 100s of pages of web history built up in the last couple of weeks...

there is this guy, building a java piece to achieve db connection (4 years old): https://tonoriesco.wordpress.com/2013/11/14/raspberry-pi-and-oracle/...

Anybody out there who definitely knows if there is a way to connect and interact with a remote oracle db via php/apache setup, running on a raspberry pi, or not? I mean, we DO have 2017, with all the iot marketing buzz going on, shouldn't Oracle care?

(PHP Version 5.6.29-0+deb8u1)

Manuelfad
  • 1
  • 2
  • ... but the Pi *is* a Unix-a-like system isn't it? Raspbian, the default OS, is based on Debian. – CD001 Sep 21 '17 at 13:45
  • @CD001 yes, but confusion is nurtured, eg by this post (3 years old): [link](https://stackoverflow.com/questions/26167682/oracle-instant-client-for-arm-based-debian-device) – Manuelfad Sep 21 '17 at 13:48
  • If it's a remote Oracle server then surely you're just connecting to it via `oci_connect()` (you could use `PDO` with a dsn like *oci:dbname=//192.168.0.10:1521/db*); the Pi is just running your Apache/PHP environment - Oracle would be running remotely on another machine on the same network presumably? – CD001 Sep 21 '17 at 13:55
  • The Oracle server is not on the same network; It is no syntax issue (as I know from developing and testing my projects on another machines, successfully establishing connections to and manipulating data of the DB); – Manuelfad Sep 21 '17 at 13:59
  • ... I see what you mean ... there's no ARM compatible version of Instant Client and your options for connecting to an Oracle database without that seem to be extremely limited; there appears to be some workarounds with ODBC, .NET or Java - PHP, not so much. [ADOdb](http://adodb.org/dokuwiki/doku.php?id=v5:database:oracle) *might* work. – CD001 Sep 21 '17 at 15:44
  • I suspect that the only reasonably practicable way to approach this problem is to implement a general database server in Java, that receives SQL statements in (say) XML, and returns the results (if any) in (say) XML. Or JSON, or something else that can be handled in PHP. The other possibility that comes to mind is to write a wrapper library in C that calls Java methods that do database operations, via the JNI mechanism. You could then call the C library from PHP. Frankly, it's probably easier just to implement the whole application in Java, for better or worse. – Kevin Boone Sep 21 '17 at 17:20
  • @CD001I looked into the link you posted, but I don't seem to understand... ADO "just" -uses- the oci8 driver, it's not an alternative, or how do you think it might work? – Manuelfad Sep 21 '17 at 18:30
  • @KevinBoone also thank you for your post - so can I assume it's a waste of time to look into options of getting it to run natively? - because there doesn't seem to be a download provided by oracle themselves – Manuelfad Sep 21 '17 at 18:30
  • I see your point (building in Java or .net, providing sth like json that can be picked up on by php..), but I'm afraid that's not an option (complexity in workflow and my guess is it would be much harder to optimize performance); and it's probably easier to use another webserver or dbms instead of switching frameworks (just would've been so nice to use this cheap server that does so many other things so reliable) – Manuelfad Sep 21 '17 at 18:32
  • My bad - I thought it was Instant Client that was the issue rather than the driver so I figured you could circumvent it... for some reason *.wordpress.com is blocked here so I didn't check the articles on tonoriesco.wordpress.com (just web proxied in) - his solutions all involve Java. As you can tell, my experience with Oracle is basically non-existent; conceptually though it didn't seem like it should be an issue... I didn't factor in Oracle being Oracle though. – CD001 Sep 22 '17 at 08:57
  • 1
    @Manuelfad So far as I know, Oracle never produced an ARM version of the OCI driver, let alone a specific version for the Pi. My impression is that OCI in general is dying, although I accept that there's still a lot of it in the field. Maybe one day Oracle will release the source, but I don't think we should hold our breath. I could be wrong about every part of this, of course. – Kevin Boone Sep 22 '17 at 10:02
  • @KevinBoone OCI is far from dying. It's being used in more and more places directly and in wrappers in libraries like OCILIB and Oracle's own ODPI-C. (Both these are open source, BTW) – Christopher Jones Sep 25 '17 at 17:02
  • @Christopher Jones : fair enough. I'm basing my ramblings on observations from the time when I worked for Oracle on the maintenance of its JDBC drivers. That was a few years ago, to be sure. At that time, I would guess that customer calls concerning the type-4 Java driver outnumbered calls concerning OCI by about twenty to one. I would have expected the bias in favour of Java to increase, but I don't work in that area any more, so I could be wrong. If I am wrong, then maybe it's still possible that Oracle will produce an ARM OCI, but who knows? Right now, there isn't one. – Kevin Boone Sep 26 '17 at 07:49

1 Answers1

0

Use REST calls to something like ORDS or your own mid-tier server/service.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48