Oracle Instant Client


(Noel) #1

Hi,


I am having a problem with php occaisonally crashing when using oracle as database (did not happen with postgres, but speed with postgres was quite slow).



I am now trying to compile php with oracle instant client, but i am getting database errors. Can anyone give me some help please?


(Avi Miller) #2

What database errors are you getting?


Edited to add that we find a properly configured PostgreSQL server as fast as Oracle on equivelent hardware. However, the default PostgreSQL configuration options are pretty bad when it comes to performance. I would recommend searching Google for "Tuning PostgreSQL" for assistance on improving the performance of your PostgreSQL server.


(Noel) #3

when compiled with instanclient, i get


MySource Error

File: [SYSTEM_ROOT]/core/include/mysource.inc Line: 1968

Message: DB Error: connect failed



phpinfo shows:



OCI8 Support enabled

Revision $Revision: 1.183.2.18.2.3 $

Oracle Version 10.1

Compile-time ORACLE_HOME /usr/lib/oracle/xe/instantclient_10_2

Libraries Used no value





With postgres (after optimisation), with rollback enabled, system was very slow when compared to oracle. (i tested oracle using the normal client libraries, not the instant client, but this is causing php to crash, especially during hipo jobs).


(Avi Miller) #4

What kind of DSN are you using? Instant Client probably has a different default location for tnsnames.ora and doesn't read the ORACLE_SID properly. You might have better luck using a more specific DSN. I have a few on my servers, so I'll post an example tomorrow.


It is interesting to hear that Oracle was faster than PostgreSQL. My experience is usually the reverse. :slight_smile:


(Avi Miller) #5

This is the DSN I use with the Oracle Instant Client:

    define('SQ_CONF_DB_DSN', 'oci8://username:password@(
                DESCRIPTION=(
                            ADDRESS_LIST=(
                                            ADDRESS=(PROTOCOL=TCP)
                                            (HOST=192.168.1.1)
                                            (PORT=1521))
                            )
                            (CONNECT_DATA=(SID=ORCL)
                            (SERVER=DEDICATED))
                )');


Obviously, you need to tailor that to your Oracle values. :) You do need all three DSNs configured, so just use the same DSN for all three definitions.

(Noel) #6

hey thanks. managed to connect, however still have the issue of pHP doing Segmentation fault. (as happens when using the normal oracle php interface)


Is there a know version php and version of client libraries which are known to work well together?


(Avi Miller) #7

We're using PHP with Oracle on RHEL4, so that's PHP 4.3.9. What distro are you using?


(Noel) #8

I'm using Fedora core 4, with php 4.4.4 manually compiled (since core 4 comes with php 5).


As for oracle, i'm using Oracle 10g express.


(Avi Miller) #9

Any particular reason why you're not using PostgreSQL on Fedora Core? Its a lot simpler to manage than Oracle. :slight_smile:


(Noel) #10

As I said earlier, with rollback turned on, matrix slows down with progres. (example… to create a 3x3 table asset in a page, postgres goes processing for over 2 minutes, which is unacceptable). With rollback turned off, speed is quite ok.


Same operation with rollback on, with oracle on same machine, was way faster, so unless there is a way to speed up postgres, i guess i have to stick with oracle.



the problem is php is not stable with oracle :cry:


(Avi Miller) #11

All of our largest sites use PostgreSQL, most with rollback enabled. The default configuration that ships with PostgreSQL is unacceptable for performance. You need to tune PostgreSQL for your machine’s available resources.


This page: http://www.varlena.com/GeneralBits/Tidbits/perf.html has a lot of great information, including an annotated guide to postgresql.conf



As an aside, you should never create Table Containers in Matrix: They are slow, inefficient and non-XHTML compliant. Rather, use the Table Editor inside the WYSIWYG cell to create tabular data. :slight_smile:


(Noel) #12

I see. I will have a go at re-tuning postgres. Thanks about the tip re table… is there a way of not disabling the option of table containers?


(Noel) #13

Any answer to my previous question please?


(Avi Miller) #14

I'm not sure what you're asking, to be honest. You can't disable the table containers in Matrix without removing them from the codebase.


However, there is no way to enable/disable them in the Admin Interface.


(Noel) #15

Hi all again. i have tried the system under different contitions… Fedora core 5 64-bit under vmware server virtual instance under windows vista rc2 32-bit on an AMD athlon 3500+. I compiled a 64-bit version of php, and used the supplied version of 64-bit postgesql (8.1.4) and default conifg.


System with rollback enabled is now much faster, possibly faster than the 32-bit orcale system i tried before. Can anyone shed some light on this? as i would have assumed system would be worse…