oracle 甲骨文,PDO_OCI 与 OCI8
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2563732/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle, PDO_OCI vs OCI8
提问by jarcoal
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.
我工作的公司目前使用一些基本功能来抽象 OCI 库作为数据库连接的一种手段。我们正在考虑切换到 PHP 的 PDO 对象,但从一些快速搜索来看,Oracle 驱动程序似乎比其他 PDO 驱动程序成熟一些。我很感激在生产环境中使用过 PDO/oci8 的任何人的一些优点/缺点。
Thanks!
谢谢!
采纳答案by eRadical
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. :)
在我看来,Oracle 对为 PDO 开发驱动程序不感兴趣,它正在开发自己的驱动程序以使您接近 oracle 数据库……到 oracle 驱动程序……等等。:)
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.
据我所知,如果你能应付 max. 4000 CHARS 的 VARCHAR2 文本。如果您需要 CLOB(和/或更大),请不要使用 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.
我创建了一套“PDOSurrogate”类作为 Oracle 的 PDO 替代品。当 PDO 足够成熟时,我可以使用 Refactor->Rename 将其更改为 PDO。
回答by álvaro González
I don't have personal experience with the PDO driver (being tagged as experimentalwas enough for not even considering it). But in The Underground PHP and Oracle Manualwe can read the following, as preface to the PHP PDO Extensionchapter:
我没有使用 PDO 驱动程序的个人经验(被标记为实验性就足以不考虑它了)。但是在The Underground PHP and Oracle Manual 中,我们可以阅读以下内容,作为PHP PDO 扩展章节的序言:
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.
PDO 扩展和 PDO_OCI 驱动程序是开源的并包含在 PHP 5.1 中。Oracle 不对 PDO_OCI 做出贡献。
PHP 社区让 PDO 项目陷入困境,Oracle 建议尽可能使用 OCI8,因为它具有更好的特性集、性能、可靠性和稳定性。不建议将 PDO_OCI 用于通用应用。
The extension is not finished, it's probably poorly maintained (although some bug fixesget through now and then) and it's been that way for years. I would not put my eggs in that basket.
回答by Prasad
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 ..
可能是我来晚了……只是想为讨论增加一些价值。我在 OCI8 和 OCI8_11 扩展方面经验丰富,并且使用存储过程/包、CLOB/BLOB 和 XML 完成了一些大量工作,我从来没有用完选项......此外,它似乎非常可靠并且可以处理大量负载,我什至使用过曾经用于 ETL(提取转换负载)应用程序来处理繁重的工作负载...还相信 oci8 是广泛使用的扩展...比 pdo ..