Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Ben Wilkoff -
Number of replies: 9
I thought I would put this as its own topic because it took me quite a while to figure out and I hope it can be useful to others.

I have used these instructions and quite a few other resources to create a step by step process for installing Moodle on an Oracle Database with a Red Hat Linux server. Here you will find the Google Doc of the instructions and a screencast to show how I did it.

I hope you have as much fun as I did getting this to work.
Cyfartaledd sgoriau:Useful (1)
In reply to Ben Wilkoff

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Paul O'Donnell -
This was a huge help.

We followed several other tutorials and had lotsa problems, including the "mod assignment type online plugin needs upgrading" error and silly user-errors, like putting the tnsnames.ora file inside the Oracle Instant Client v11 when the box was configured to use Oracle Instant Client v10. (Hence, these instructions put the tnsnames.ora inside the /etc directory, which works, and uses v11.1). Also, no messing with ORACLE_HOME and NS_LANG environment variables, which many other tutorials had us doing.

Anyway, this tutorial was the one that did it for us. Many thanks.

I'm attaching a PDF that outlined the steps we took. They follow Ben Wilkoff's instructions almost to the tee, but with a few tweaks. For example, we needed the 32-bit Oracle Instant Client for our box.

In reply to Ben Wilkoff

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Adam Barbary -
It looks like you really have your head around the Moodle on Oracle setup. Have you been testing a Moodle 2.0 yet. I heard that Martin was not recommending running 2.0 on Oracle and really wanted to get down to the bottom of the issues. We are an Oracle shop and the logical step for us is to run Moodle on Oracle. However, what would be the point if 2.0 has major issues.

Anyone got any more info?

Thanks in advance.
In reply to Adam Barbary

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Lionel Redelinghuys -
I am busy implementing Moodle 1.9.5 for the South African DOD. Before we actually set up I would like to know of any pitfalls I need to look out for when installing on an Oracle database.

The DOD refuses any other DBMS than Oracle so it's a must.

In theory it should be as easy as setting up a DB, user and connect. Right? Just like with MySQL.

It is going to be a clean install.
In reply to Adam Barbary

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Tim Hunt -
Llun o Core developers Llun o Documentation writers Llun o Particularly helpful Moodlers Llun o Peer reviewers Llun o Plugin developers
Eloy is doing further work on the database API for Moodle 2.0 right now. See http://www.ohloh.net/accounts/stronk7/messages/48179. So oracle support will be worked on soon, but it has not been yet.

The issues with Oracle support are:
  • Oracle's SQL is a long way from the ANSI standard, so it requires far more database-specific hacks than anything else
  • The hacks, and problems with the protocol used to connect to Oracle databases, mean that performance on Oracle is much worse than using any other database on equivalent hardware.
  • Very few people use Oracle, so it has has the least testing of any of our supported databases, so you are more likely to be the first person to discover Oracle-specific bugs.
But, it can be done if you have no other choice.
In reply to Tim Hunt

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Lionel Redelinghuys -
Cool

I've just managed today to find an effective way of installing the oci8po module for php on the DOD's concealed network. It is shown in another part of the site. They recommend installing the Zend Core for Oracle. I will try that on the DOD mainframe tomorrow and hopefully I will have some success with regard to get Moodle running.

It's terrible that they won't install anything else. MySQL is so much better. Even MS SQL for that matter. Grrr. Our DOD is so primitive
In reply to Lionel Redelinghuys

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Lionel Redelinghuys -
Ok. That method didn't work but in the meantime I've downloaded Oracle XE and experimented with that. I was able to install Moodle on Oracle with no problems at all. People give all these long explanations etc etc etc.

I've loaded a Linux VM. Installed kernel headers for incase and I've installed the OCI8PO prerequisite compile packages.
So obviously my Oracle DB was installed on the same system as my Application server...

First I set $ORACLE_HOME to the directory where Oracle is located namely /usr/lib/oracle/xe/app/oracle/product/10.2.0/server. Then, because I had the oci8po package at hand I use pear5 install oci8-1.3.5.tgz

I was prompted for the location of Instant client but because I am using ORACLE_HOME I just pressed enter and the location of ORACLE_HOME was automatically loaded. When compile finished, I added extension=oci8.so to the PHP configuration.

After all that I opened my browser at moodle's location, completed the wizard and voila.

For Oracle newcomers. If you use Oracle XE the name of the database will be xe. Username will be system and the password the one you specified during setup. You can create a new user (schema) though the web frontend to be moodle and your favorite password. The the details will be xe, moodle, password.

There are guides on the net that can help you create a new oracle database service to use another name than xe.

Also remember that Oracle in the Moodle setup wizard you do not need to specify the server address. The oci8po PHP module knows where to connect to.

If you are using multiple Oracle installations (databases) you may need to compile oci8po using instant client rather than ORACLE_HOME. Reason being that Instant Client can connect to multiple databases on multiple IPs. Each time only need to add the new DBs details to tnsnames.ora. No need to recompile oci8po for every new database you set up. Generally you may rather wish to have one single oracle installation with different schemas. It's easier to manage and less work to compile the oci8 module.
In reply to Lionel Redelinghuys

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Chris Myers -

If you're running Moodle on Oracle with Apache on Linux, you might have issues with PHP being able to see the system environment variables. To resolve this, you can edit /etc/sysconfig/apache2 and add the following lines to the bottom:

LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2# Set LANG Variables for UTF-8
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
export LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIM NLS_LANG LD_LIBRARY_PATH

Also need to add those two lines to ~/.bashrc so that the PHP command-line client can see it too.

In reply to Chris Myers

Re: Databases: Install Moodle on an Oracle Database (in 25 minutes or less)

gan Marin Sok -

Hi there,

I am running Linux Redhat. I couldn't find this file /etc/sysconfig/apache2. But I see /etc/sysconfig/httpd instead.

I donwloaded Oracle Client and I installed with Administor option.

I pointed the installation to :

/u01/app/oracle/product/11.2.0/client_1

Below are the folds and files for Oracle Clinet.

 

assistants   clone  cv           has               instantclient  jdk   lib      olap     oraInst.loc  perl     rdbms     sqldeveloper  sysman  wwg
bin          crs    dc_ocm       hs                inventory      jlib  network  OPatch   ord          plsql    relnotes  sqlj          ucp     xdk
cdata        csmig  deinstall    install           javavm         jpub  nls      opmn     oui          precomp  root.sh   sqlplus       uix
cfgtoollogs  css    diagnostics  install.platform  jdbc           ldap  odbc     oracore  owm          racg     slax      srvm          utl

 

Please help!

 

Thanks