Web Interface to Oracle Database

· klm's blog


Original post is here: eklausmeier.goip.de

I had to provide access to an Oracle database but the standard port at 1521 was hindered by company firewall and company proxy rules.

In previous times there was iSQL*Plus, but this product no longer seems to be available. I found Adminer as an alternative. It is written by Jakub Vrána. It is very easy to install: it is just one single PHP file consisting of less than 2000 lines. Originally made for MySQL/MariaDB, but it works for Oracle quite well. It provides access to tables and views, although it has problems editing PL/SQL procedures and triggers. It is termed as beta software for Oracle. Nevertheless, I found it to be very useful for Oracle.

To use one must add one file etc/php/conf.d/oci8.ini

1extension=oci8.so

Make sure OCI8 is available for PHP, therefore install AUR package php-oci8. When you run php -i (equivalent to calling phpinfo()) you'll see:

 1Additional .ini files parsed => /etc/php/conf.d/oci8.ini
 2
 3oci8
 4
 5OCI8 Support => enabled
 6OCI8 DTrace Support => disabled
 7OCI8 Version => 2.1.8
 8Revision => $Id: 8a26cf66ca0f9556b6376408c8f71ead69bdbcbf $
 9Oracle Run-time Client Library Version => 12.2.0.1.0
10Oracle Compile-time Instant Client Version => 12.2
11
12Directive => Local Value => Master Value
13oci8.connection_class => no value => no value
14oci8.default_prefetch => 100 => 100
15oci8.events => Off => Off
16oci8.max_persistent => -1 => -1
17oci8.old_oci_close_semantics => Off => Off
18oci8.persistent_timeout => -1 => -1
19oci8.ping_interval => 60 => 60
20oci8.privileged_connect => Off => Off
21oci8.statement_cache_size => 20 => 20

For this you need to install Oracle instant client. In ArchLinux AUR these are the packages oracle-instantclient-basic and oracle-instantclient-sdk. The first package installs

1/usr/lib/libclntsh.so

If you encounter "URI too long" error messages, then downgrade to version 4.6.3, see Adminer releases. Latest version 4.7.0 still seems to be unstable, while 4.6.3 is fine.