⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postgresql-howto-11.html

📁 Linux初学者最好的老师就是howto了。相当于函数man。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<H3>编译错误或「测试失败」</H3><P>如果发生讯息转储 (core dump),尝试使用 Devel::CoreStack 模块来产生讯息转储的堆叠追踪 (stack trace)。Devel::CoreStack 可在 CPAN 找到∶<UL><LI>              <A HREF="javascript:if(confirm('http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack'" tppabs="http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack">http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack</A></LI></UL><P>把堆叠追踪、模块版本、perl 版本、测试个案、操作系统版本及任何其他适用的资料电邮到 dbi-users 通信论坛。寄出的资料越齐全,开发人员越快解决问题。如果你不告诉我们,不要期望得到答案。<H3>视窗 95/NT 有没有 DBI 支持?</H3><P>DBI 和 DBD::Oracle 的 Win32 版本已成为 DBI 的标准部分。因此,比 DBI 0.81 高的版本应该会正常运作。透过 ODBC,你可以存取微软 Access 和 SQL-Server 资料库。在 DBI-0.79(及以後)有一个实验性质的 Win32::ODBC DBI 模拟层。它名为 DBI::W32ODBC。你需要使用 Win32::odbc 模块。<UL><LI> Win32 DBI   <A HREF="javascript:if(confirm('http://www.hermetica.com/technologia/perl/DBI/win32  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.hermetica.com/technologia/perl/DBI/win32'" tppabs="http://www.hermetica.com/technologia/perl/DBI/win32">http://www.hermetica.com/technologia/perl/DBI/win32</A></LI><LI> Win32 ODBC   <A HREF="javascript:if(confirm('http://www.roth.net/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.roth.net/'" tppabs="http://www.roth.net/">http://www.roth.net</A></LI></UL><H3>何谓 DBM?为何要用 DBI?</H3><P>UNIX 原本是使用简单以档案为基础的「资料库」,即 dbm 系统。dbm 容许你在档案快速地存取资料。不过,它有数个严重的缺点。<P>档案封锁 (File Locking)<P>dbm 系统不容许特别全面的档案封锁能力,也没有修正同时写入资料库引起的问题的能力。<P>随意的资料结构<P>dbm 系统只容许单一固定的资料结构∶链-数值对 (key-value pair)。那数值可以是复杂的物件,如一个 C 的 struct,但链必须是独一无二的。这对 dbm 系统的用途造成很大限制。<P>不过,dbm 系统仍为使用简单资料及资源有限的用家提供了有用的功能,因为它快速、全面及经过极严谨的测试。存取 dbm 系统的模块现已经 AnyDBM_File 模块整合到 Perl 的核心散布中。<P>总括一句,对近乎是唯读的资料库或小型而简单的资料来说,dbm 是一个非常令人满意的解决方法。不过,对更强大和可增减 (scalable) 的资料集来说,用家最好使用 DBI。至于全面的交易封锁 (transactional locking),就更不用说了。□<P><H3>DBI 是否支持&lt;这项功能&gt;?</H3><P>根据所提出的功能是一个并不标准,而只为部分资料库所独有的假设,答案是否。<P>DBI 反映一个通用而可在大部分资料库使用的 API,而没有资料库独有的功能。<P>不过,如果驱动程序的作者有兴趣,他们可以籍 DBI 界面所定义的 func method 来加上资料库独有的功能。命令稿的开发人员要注意籍 func methods 提供的功能一般不能在不同资料库间移植。<H3>对 CGI 来说,dbi 有没有用?</H3><P>一个字∶有!DBI 对 CGI 程序设计非常有用!事实上,CGI 是 DBI 最重要的用途之一。<P>DBI 让 CGI 程序设计师设计功能强大的互联网前端资料库给他们的用家,从而提供大量按次序排列的资料。DBI 也容许在网站的资料库服务器超过负荷时,管理人员在无须更改 CGI 命令稿的情况下将之升级。<H3>我如何加快 CGI 与 DBD Oracle 的连接速度?</H3><P>Apache httpd 管理一组子 httpd (httpd children) 来服务客户。籍著 Doug MacEachern 的 Apache mod_perl 模块,perl 翻译器已嵌入到子 httpd 中。CGI、DBI 和你喜欢的模块会在儿子诞生时载入。这些模块直到在磁碟上的版本被更改时才会再被载入。要知道更多有关 Apache 的资料,请看 Apache 计划的网站∶<UL><LI> Apache 计划的网站 <A HREF="javascript:if(confirm('http://www.apache.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.apache.org/'" tppabs="http://www.apache.org/">http://www.apache.org</A></LI><LI> Mod_perl 模块 <A HREF="javascript:if(confirm('http://www.perl.com/cgi-bin/cpan_mod?module=mod_perl  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/cgi-bin/cpan_mod?module=mod_perl'" tppabs="http://www.perl.com/cgi-bin/cpan_mod?module=mod_perl">http://www.perl.com/cgi-bin/cpan_mod?module=mod_perl</A></LI></UL><H3>如何使 DBI 和 CGI 持续连接?</H3><P>籍著 Edmund Mergl 的 Apache::DBI 模块,每个子 httpd 会把资料库登入储存在杂凑 (hash) 中。如果你的应用程序只有一个资料库用家,每一个儿子都可开始连连。目前,儿子之间并不会分享资料库连接。Apache::DBI 可从 CPAN 下载∶<UL><LI>    <A HREF="javascript:if(confirm('http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI'" tppabs="http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI">http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI</A></LI></UL><H3>“我在指令行执行一个 perl 命令稿时,并无问题。不过,当我在 http 执行它时,它会失败!”何解?</H3><P>基本上,这很有可能是因为从指令行执行命令稿的使用者已把环境变数设定好,以 DBD::Oracle 来说,即 $ORACLE_HOME, $ORACLE_SID 或 TWO_TASK。httpd 行程通常是以 nobody 的身份执行,即没有了设定好的环境。任何在这情况下尝试执行的手稿都会正确地失败。要解决这问题,在你的命令稿的开头用一个 BEGIN() 区块设定环境。这样便会解决问题。同样地,你要检查你的 httpd 错误纪录档以寻找线索,以及阅读“Idiot's Guide To Solving Perl / CGI Problems”和“Perl CGI Programming FAQ”以寻找更多资料。这问题大概不会和 DBI 有关。请两份文件都小心阅读!<UL><LI> Idiot's Guide to Solving Perl / CGI problems <A HREF="javascript:if(confirm('http://www.perl.com/perl/faq/index.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/perl/faq/index.html'" tppabs="http://www.perl.com/perl/faq/index.html">http://www.perl.com/perl/faq/index.html</A></LI></UL><H3>使用 DBI 时,我能否进行多流处理 (multi-threading)?</H3><P>目前不能。Perl 并不支持多流处理。不过,据估计,多流处理会成为 5.005 版的基本散布的一部分,即不久之後,DBI 可能会支持多流处理。要看一些使用多流 SELECT 句子的 Oracle OCI □例程序,请参阅∶<UL><LI>    <A HREF="javascript:if(confirm('http://www.hermetica.com/technologia/oracle/oci/orathreads.tar.gz  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.hermetica.com/technologia/oracle/oci/orathreads.tar.gz'" tppabs="http://www.hermetica.com/technologia/oracle/oci/orathreads.tar.gz">http://www.hermetica.com/technologia/oracle/oci/orathreads.tar.gz</A></LI></UL><H3>我如何用 DBI 呼叫内储程序 (stored procedure)?</H3><P>假设你在目标资料库,例如一个 Oracle 资料库中建立了内储程序,你可使用 $dbh->do 来使程序立即执行。例如∶<P>$dbh->do( "BEGIN someProcedure END" );<H3>在 DBI 中,我如何取回内储程序的返回值?</H3><P>记著还要检查错误!<BLOCKQUOTE><CODE><PRE>    $sth = $dbh->prepare( "BEGIN foo(:1, :2, :3); END;" );    $sth->bind_param(1, $a);    $sth->bind_param_inout(2, \$path, 2000);    $sth->bind_param_inout(3, \$success, 2000);    $sth->execute;</PRE></CODE></BLOCKQUOTE><H3>我可否用 DBI 来丢弃一个资料库?</H3><P>对 DBI 来说,要适当地支持资料库的建立和丢弃太抽象了。例如,Oracle 根本不支持丢弃资料库!此外,在 Oracle 中,资料库服务器基本上就是资料库,但在 mSQL,即使没有资料库,服务器也能顺利地执行。这问题牵连太广了。正因如此,部分驱动程序透过私家 func 方法来建立和删除资料库。你要检查驱动程序的文件来了解它有没有支持这机制。<H3>DBI 怎样处理 NULL 值?</H3><P>DBI 被指定把 NULL 值当作 undef 值处理。NULL 可以 NULL 的数值来加入到资料库中,例如∶<BLOCKQUOTE><CODE><PRE>    $rv = $dbh->do( "INSERT INTO table VALUES( NULL )" );</PRE></CODE></BLOCKQUOTE>不过当查询时,NULL 要和 undef 比较。这是所有驱动程序都适用的标准。<H3>这些 func 方法是做什么的?</H3><P>DBI 把 func 方法定义为资料库独有功能的进入点,例如建立和丢弃一个资料库。使用这些驱动程序独有方法十分简单,例如,要使用一个 createDatabase 方法输入一个引数 (argument) ,我们会写∶<BLOCKQUOTE><CODE><PRE>    $rv = $dbh->func( 'argument', 'createDatabase' );</PRE></CODE></BLOCKQUOTE>软件开发人员要注意 func 方法不能在不同资料库间移植。<H3>商业支持及训练</H3><P>Perl5 资料库界面是自由软件。它并没有任何担保 (warranty)。不过,有些机构提供了 DBI 的技术支持或培训计划。<P><B>PERL CLINIC : </B>Perl Clinic 以合约形式为 Perl、DBI、DBD::Oracle 和 Oraperl 提供商业支持。这些支持是由 DBI 作者 Tim Bunce 工作的公司提供的。欲知详情,请看∶<UL><LI>         <A HREF="javascript:if(confirm('http://www.perl.co.uk/tpc  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.perl.co.uk/tpc'" tppabs="http://www.perl.co.uk/tpc">http://www.perl.co.uk/tpc</A></LI></UL><HR><A HREF="PostgreSQL-HOWTO-12.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-12.html"><IMG SRC="next.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/next.gif" ALT="Next"></A><A HREF="PostgreSQL-HOWTO-10.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-10.html"><IMG SRC="prev.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/prev.gif" ALT="Previous"></A><A HREF="PostgreSQL-HOWTO.html#toc11" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO.html#toc11"><IMG SRC="toc.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/toc.gif" ALT="Contents"></A>  </BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -