Ittook me about two hours to install this instant client. Then I figured out that there is a great graphical client available for Oracle DB, which would suit my needs better then oracle instant client. In case you are interested, here is info on how to install it on Ubuntu:
Another solution referenced a few github repos that automated it, but the most recent one was not updated for python3, and it didn't run anymore. I updated it and fixed it, but I cannot comment on that one as I don't have the reputation to support it.
NOTE: It installs libaio1 which is the libaio's name at least in Ubuntu (and I think in Debian too). Other distributions may need to adjust this package name to "libaio" or whatever the corresponding package name would be.
Of course the correct installation is from official packages like above (download Instant Client Downloads), but you can get a full working sqlplus just by copying these files (you can found it in any computer with oracle client installed), and some msb are optitional:
This guide might help to compile the pdo_oci module from source, since PECL version is now obsolete. I wrote the original post for CentOS 6.6, PHP v5.3.3 and Oracle Instant client v.12.1, but it should be easy to apply it for your case also.
Since we are running an Oracle client version 12.1, which is not supported out-of-box by the extension, we need to do some hacking. Our Instant Client version number needs to be added to config.m4 file, otherwise configure will fail with the following error message
Now, make will most probably fail complaining that it cannot find the Oracle header files, e.g. oci.h. That is because, unless you installed the Oracle server, or Instant client in developer mode, the files do not exist on the server.
Now there are a couple of ways to enable the module. One is by including it in the main php.ini file, but in my case I created a separate .ini file in a folder where other .ini files of other modules are residing and which are included by PHP upon startup.
In case you have PHP CLI installed, you can check the list of loaded modules, otherwise create a PHP file with phpinfo() in it and check the outputs. If you see PDO_OCI in the output - congratulations!
I've spent a lot of time to try to do this following several approach with no luck, and finally find it out by myself a clean way to do this: compile & install the extensions from PHP source.
installing with PECL is deprecated, don't use it. Here is a good tutorial step by step how to install PDO_OCI and Oracle instant client on linux machine: -install-oracle-instant-client-php-pdo_oci-library/
Viewed 1000+ timesYou Asked I need to install SQL Loader in ubuntu to access the Oracle 12c r1 on different box.
My understanding is that Ubuntu is not certified for Oracle . Want to confirm my understanding .
If yes , please provide the link to install instructions.
and Connor said...Check on
support.oracle.com, because certified platforms and versions change periodically.
Also, there is obviously a difference between supported and experimentation. If it is just for personal use or experimenting with the product, then there is of course nothing to stop you from trying to install it on any linux platform.
oracle-base.com has a number of nice blog posts on installing the database on various linux flavours.
Rating (1 rating)
Is this answer out of date? If it is, please let us know via a Comment Comments Comment Looking forward to 12.2Gary, December 07, 2016 - 11:22 pm UTC
Connor and Chris don't just spend all day on AskTOM. You can also catch regular content via Connor's blog and Chris's blog. Or if video is more your thing, check out Connor's latest video and Chris's latest video from their Youtube channels. And of course, keep up to date with AskTOM via the official twitter account. More to Explore Live SQLShare and learn SQL and PL/SQL; free access to the latest version of Oracle Database!
A simple connection to the database requires an OracleDatabase user name and password and a databaseconnection string. For python-oracledb, a commonconnection string format is hostname:port/servicename, using the hostname where the database is running, the Oracle Database service name of thedatabase instance, and the port that the database is using. If the defaultport 1521 is being used, then this component of the connection string isoften omitted.
When python-oracledb is used in the default Thin mode, it connects directly tothe Oracle Database and does not require Oracle Client libraries. Connectionsin this mode can be made to Oracle Database 12.1 or later.
Any attempt to use Oracle Database features that are not supported by aparticular mode or client library/database combination will result in runtimeerrors. The python-oracledb attribute Connection.thin can be used tosee what mode a connection is in. In the Thick mode, the functionoracledb.clientversion() can be used to determine which Oracle Clientversion is in use. The attribute Connection.version can be used todetermine which Oracle Database version a connection is accessing. Theseattributes can then be used to adjust the application behavior accordingly.
The Python cryptography package. This package is automatically installed as adependency of python-oracledb. It is strongly recommended that you keep thecryptography package up to date whenever new versions are released. If thecryptography package is not available, you can still install python-oracledbbut can only use it in Thick mode, see Installing python-oracledb without the Cryptography Package.
This will download and install a pre-compiled binary from PyPI if one is available for yourarchitecture. Otherwise, the source will be downloaded, compiled, and theresulting binary installed. Compiling python-oracledb requires thePython.h header file. If you are using the default python package,this file is in the python-devel package or equivalent.
By default, python-oracledb runs in a Thin mode which connects directly toOracle Database so no further installation steps are required. However, to useadditional features available in Thick mode you needOracle Client libraries installed. Oracle Client versions 23, 21, 19, 18, 12and 11.2 are supported.
Oracle Instant Client 23ai will connect to Oracle Database 19 or later.Oracle Instant Client 21c will connect to Oracle Database 12.1 or later.Oracle Instant Client 19c will connect to Oracle Database 11.2 or later.
It is recommended to keep up to date with the latest Oracle Instant Clientrelease updates of your desired major version. Oracle Database 23ai and 19care Long Term Support Releases whereas Oracle Database 21c is an InnovationRelease.
If you use optional Oracle configuration files such as tnsnames.ora,sqlnet.ora, or oraaccess.xml with Instant Client, then put the filesin an accessible directory, for example in/opt/oracle/your_config_dir. Then use:
Alternatively, put the files in the network/admin subdirectory of InstantClient, for example in /opt/oracle/instantclient_21_6/network/admin.This is the default Oracle configuration directory for executables linkedwith this Instant Client.
Alternatively, for version 18 and earlier, every shell runningPython will need to have the environment variableLD_LIBRARY_PATH set to the appropriate directory for theInstant Client version. For example:
If you use optional Oracle configuration files such as tnsnames.ora,sqlnet.ora or oraaccess.xml with Instant Client, then put the filesin an accessible directory, for example in/opt/oracle/your_config_dir. Then your application code can use:
Alternatively, put the files in the network/admin subdirectory of InstantClient, for example in /usr/lib/oracle/21/client64/lib/network/admin.This is the default Oracle configuration directory for executables linkedwith this Instant Client.
The libraries must be either 32-bit or 64-bit, matching your Pythonarchitecture. Note Oracle Database 23ai 32-bit clients are not available on anyplatform, however, you can use older 32-bit clients to connect to OracleDatabase 23ai.
This will download and install a pre-compiled binary if one is available for your architecture. If apre-compiled binary is not available, the source will be downloaded, compiled,and the resulting binary installed.
By default, python-oracledb runs in a Thin mode which connects directly toOracle Database so no further installation steps are required. However, to useadditional features available in Thick mode you needOracle Client libraries installed. Oracle Client versions 21, 19, 18, 12, and11.2 are supported.
If you use optional Oracle configuration files such as tnsnames.ora,sqlnet.ora, or oraaccess.xml with Instant Client, then put the filesin an accessible directory, for example inC:\oracle\your_config_dir. Then use:
Alternatively, put the files in a network\admin subdirectory of InstantClient, for example in C:\oracle\instantclient_19_22\network\admin.This is the default Oracle configuration directory for executables linkedwith this Instant Client.
The Oracle libraries must be either 32-bit or 64-bit, matching your Pythonarchitecture. Note Oracle Database 23ai 32-bit clients are not available onany platform, however, you can use older 32-bit clients to connect to OracleDatabase 23ai.
By default, python-oracledb runs in a Thin mode which connects directly toOracle Database so no further installation steps are required. However, to useadditional features available in Thick mode you needOracle Client libraries installed.
3a8082e126