问题
The company I work for currently uses some basic functions to abstract the OCI libraries as a means for DB connectivity. We're considering switching to PHP's PDO object, but from some quick searches, it looks like the Oracle driver is a bit less mature than the other PDO drivers. I would appreciate some pro/cons for PDO/oci8 from anyone who has used it in a production environment.
Thanks!
回答1:
It seems to me that Oracle is not interested in developing a driver for PDO it's developing it's own driver to keep you close to oracle database... to oracle driver... etc. :)
As far as I've seen there is no problem if you can cope with max. texts of VARCHAR2 of 4000 CHARS. If you need CLOBs (and/or bigger) don't go with PDO_OCI.
I've created a suite of classes "PDOSurrogate" as a drop in replacement for PDO with Oracle. When PDO is mature enough I can use Refactor->Rename to change it to PDO.
回答2:
I don't have personal experience with the PDO driver (being tagged as experimental was enough for not even considering it). But in The Underground PHP and Oracle Manual we can read the following, as preface to the PHP PDO Extension chapter:
The PDO extension and PDO_OCI driver are open source and included in PHP 5.1 onwards. Oracle does not contribute to PDO_OCI.
The PHP community has let the PDO project languish and Oracle recommends using OCI8 instead whenever possible because of its better feature set, performance, reliability and stability. Use of PDO_OCI for general purpose applications is not recommended.
The extension is not finished, it's probably poorly maintained (although some bug fixes get through now and then) and it's been that way for years. I would not put my eggs in that basket.
回答3:
May be I'm too late to the party .. just thought to add some value to the discussion. I am experienced in OCI8 and OCI8_11 extension and have done some extensive workload using stored procedures/packages, CLOB/BLOB's and XML I never had to run out of options .. further it seems very reliable and can handle extensive loads and I have even used once for an ETL(Extract Transform Load) applications to handle heavy workloads... also believe oci8 is the widely used extension .. than pdo ..
来源:https://stackoverflow.com/questions/2563732/oracle-pdo-oci-vs-oci8