Oracle、PDO_OCI 与 OCI8

发布于 2024-08-27 19:23:18 字数 171 浏览 10 评论 0原文

我工作的公司目前使用一些基本函数来抽象 OCI 库,作为数据库连接的手段。我们正在考虑切换到 PHP 的 PDO 对象,但从一些快速搜索来看,Oracle 驱动程序似乎比其他 PDO 驱动程序不太成熟。我希望任何在生产环境中使用过 PDO/oci8 的人能够提供一些关于 PDO/oci8 的优点/缺点。

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

心作怪 2024-09-03 19:23:18

在我看来,Oracle 对开发 PDO 驱动程序不感兴趣,它正在开发自己的驱动程序,以使您接近 oracle 数据库...oracle 驱动程序...等等:)

据我所知,没有如果你能应付最大的问题。 4000 个字符的 VARCHAR2 文本。如果您需要 CLOB(和/或更大),请不要使用 PDO_OCI。

我创建了一套“PDOSurrogate”类,作为 Oracle 中 PDO 的替代品。
当PDO足够成熟时我可以使用Refactor->Rename将其更改为PDO。

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.

嗫嚅 2024-09-03 19:23:18

我没有使用 PDO 驱动程序的个人经验(被标记为 实验 就足够了,甚至不考虑它)。但在 地下 PHP 和 Oracle 手册 我们可以阅读以下内容,作为 PHP PDO 扩展章节的序言:

PDO 扩展和 PDO_OCI 驱动程序是开源的并包含在
PHP 5.1 及以上版本。 Oracle 不参与 PDO_OCI。

PHP 社区让 PDO 项目陷入困境,Oracle 建议使用
尽可能使用 OCI8,因为它具有更好的功能集,
性能、可靠性和稳定性。 PDO_OCI 的一般用途
不推荐专用应用程序。

该扩展尚未完成,可能维护不善(尽管有些 错误修复时不时地完成),多年来一直如此。我不会把鸡蛋放在那个篮子里。

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.

桜花祭 2024-09-03 19:23:18

可能是我参加聚会太晚了..只是想为讨论增加一些价值。我在 OCI8 和 OCI8_11 扩展方面经验丰富,并且使用存储过程/包、CLOB/BLOB 和 XML 完成了一些大量的工作量,我从来没有用完选项..此外,它看起来非常可靠,可以处理大量的负载,我什至使用过曾经用于 ETL(提取转换加载)应用程序来处理繁重的工作负载...也相信 oci8 是广泛使用的扩展..比 pdo ..

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 ..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文