vacuumdb.sgml
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:8k
源码类别:

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="APP-VACUUMDB">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    <application>vacuumdb</application>
  5.   </refentrytitle>
  6.   <refmiscinfo>Application</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname id="vacuumdb">
  10.    <application>vacuumdb</application>
  11.   </refname>
  12.   <refpurpose>
  13.    Clean and analyze a <productname>Postgres</productname> database
  14.   </refpurpose>
  15.  </refnamediv>
  16.  <refsynopsisdiv>
  17.   <refsynopsisdivinfo>
  18.    <date>1998-10-04</date>
  19.   </refsynopsisdivinfo>
  20.   <synopsis>
  21. vacuumdb [ --analyze | -z ] [ --verbose | -v ] [ <replaceable
  22.     class="parameter">dbname</replaceable> ]
  23. vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p
  24.    <replaceable class="parameter">port</replaceable> ]
  25.     [ --table '<replaceable class="parameter">table</replaceable> [ (
  26.    <replaceable class="parameter">column</replaceable> [,...] ) ]' ]
  27.     [ <replaceable class="parameter">dbname</replaceable> ]
  28.   </synopsis>
  29.   <refsect2 id="R2-APP-VACUUMDB-1">
  30.    <refsect2info>
  31.     <date>1998-10-04</date>
  32.    </refsect2info>
  33.    <title>
  34.     Inputs
  35.    </title>
  36.    <para>
  37.     <application>vacuumdb</application> accepts the following command line arguments:
  38.     
  39.     <variablelist>
  40.      <varlistentry>
  41.       <term>
  42.        <replaceable class="parameter">dbname</replaceable>
  43.       </term>
  44.       <listitem>
  45.        <para>
  46. Specifies the name of the database to be cleaned or analyzed.
  47. <replaceable class="parameter">dbname</replaceable>
  48. defaults to the value of the
  49. <envar>USER</envar>
  50. environment variable.
  51.        </para>
  52.       </listitem>
  53.      </varlistentry>
  54.      
  55.      <varlistentry>
  56.       <term>
  57.        --analyze
  58.       </term>
  59.       <term>
  60.        -z
  61.       </term>
  62.       <listitem>
  63.        <para>
  64. Calculate statistics on the database for use by the optimizer.
  65.        </para>
  66.       </listitem>
  67.      </varlistentry>
  68.      
  69.      <varlistentry>
  70.       <term>
  71.        --verbose
  72.       </term>
  73.       <term>
  74.        -v
  75.       </term>
  76.       <listitem>
  77.        <para>
  78. Print detailed information during processing.
  79.        </para>
  80.       </listitem>
  81.      </varlistentry>
  82.      
  83.      <varlistentry>
  84.       <term>
  85.        --table <replaceable class="parameter">table</replaceable> [
  86.        (<replaceable class="parameter">column</replaceable> [,...]) ]
  87.       </term>
  88.       <term>
  89.        -t <replaceable class="parameter">table</replaceable> [
  90.        (<replaceable class="parameter">column</replaceable> [,...]) ]
  91.       </term>
  92.       <listitem>
  93.        <para>
  94. Clean or analyze <replaceable class="parameter">table</replaceable> only.
  95. Column names may be specified only in conjunction with
  96. the <option>--analyze</option> option.
  97.        </para>
  98.       </listitem>
  99.      </varlistentry>
  100.      
  101.     </variablelist>
  102.    </para>
  103.    <para>
  104.     <application>vacuumdb</application> also accepts 
  105.     the following command line arguments for connection parameters:
  106.     
  107.     <variablelist>
  108.      <varlistentry>
  109.       <term>
  110.        -h <replaceable class="parameter">host</replaceable>
  111.       </term>
  112.       <listitem>
  113.        <para>
  114. Specifies the hostname of the machine on which the 
  115. <application>postmaster</application>
  116. is running.  Defaults to using a local Unix domain socket
  117. rather than an IP connection..
  118.        </para>
  119.       </listitem>
  120.      </varlistentry>
  121.      
  122.      <varlistentry>
  123.       <term>
  124.        -p <replaceable class="parameter">port</replaceable>
  125.       </term>
  126.       <listitem>
  127.        <para>
  128. Specifies the Internet TCP/IP port or local Unix domain socket file 
  129. extension on which the <application>postmaster</application>
  130. is listening for connections.  The port number defaults to 5432,
  131. or the value of the <envar>PGPORT</envar>
  132. environment variable (if set).
  133.        </para>
  134.       </listitem>
  135.      </varlistentry>
  136.      
  137.      <varlistentry>
  138.       <term>
  139.        -u
  140.       </term>
  141.       <listitem>
  142.        <para>
  143. Use password authentication. 
  144. Prompts for
  145. <replaceable class="parameter">username</replaceable>
  146. and <replaceable class="parameter">password</replaceable>.
  147.        </para>
  148.       </listitem>
  149.      </varlistentry>
  150.     </variablelist>
  151.    </para>
  152.   </refsect2>
  153.   <refsect2 id="R2-APP-VACUUMDB-2">
  154.    <refsect2info>
  155.     <date>1998-10-04</date>
  156.    </refsect2info>
  157.    <title>
  158.     Outputs
  159.    </title>
  160.    <para>
  161.     <application>vacuumdb</application> executes a <command>VACUUM</command> command
  162.     on the specified database, so has not explicit external output.
  163.     <variablelist>
  164.      <varlistentry>
  165.       <term>
  166.        ERROR:  Can't vacuum columns, only tables.  You can 'vacuum analyze' columns.
  167.        vacuumdb: database vacuum failed on <replaceable
  168. class="parameter">dbname</replaceable>.
  169.       </term>
  170.       <listitem>
  171.        <para>
  172. The non-analyze mode requires cleaning full tables or databases.
  173. Individual columns may be specified only when analyzing a specific table.
  174.        </para>
  175.       </listitem>
  176.      </varlistentry>
  177.      <varlistentry>
  178.       <term>
  179.        Connection to database 'template1' failed.
  180.        connectDB() failed: Is the postmaster running and accepting connections
  181.        at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
  182.       </term>
  183.       <listitem>
  184.        <para>
  185. <application>vacuumdb</application> could not attach to the 
  186. <application>postmaster</application> 
  187. process on the specified host and port.  If you see this message,
  188. ensure that the <application>postmaster</application> 
  189. is running on the proper host and that you have specified the proper
  190. port.  If your site uses an authentication system, ensure that you
  191. have obtained the required authentication credentials.
  192.        </para>
  193.       </listitem>
  194.      </varlistentry>
  195.      <varlistentry>
  196.       <term>
  197.        Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
  198.        FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
  199.       </term>
  200.       <listitem>
  201.        <para>
  202. You do not have a valid entry in the relation <literal>pg_shadow</literal>
  203. and and will not be allowed to access <productname>Postgres</productname>. 
  204. Contact your <productname>Postgres</productname> administrator.
  205.        </para>
  206.       </listitem>
  207.      </varlistentry>
  208.      
  209.     </variablelist>
  210.    </para>
  211.    <note>
  212.     <para>
  213.      <application>vacuumdb</application> internally executes a
  214.      <command>VACUUM</command> <acronym>SQL</acronym> statement. 
  215.      If you have problems running <application>vacuumdb</application>,
  216.      make sure you are able to run <command>VACUUM</command> on the database using, for
  217.      example, <application>psql</application>.
  218.     </para>
  219.    </note>
  220.   </refsect2>
  221.  </refsynopsisdiv>
  222.  
  223.  <refsect1 id="R1-APP-VACUUMDB-1">
  224.   <refsect1info>
  225.    <date>1998-10-04</date>
  226.   </refsect1info>
  227.   <title>
  228.    Description
  229.   </title>
  230.   
  231.   <para>
  232.    <application>vacuumdb</application> is a utility for cleaning a
  233.    <productname>Postgres</productname> database.
  234.    <application>vacuumdb</application> will also generate internal statistics
  235.    used by the <productname>Postgres</productname> query optimizer.
  236.   </para>
  237.  </refsect1>
  238.  <refsect1 id="R1-APP-VACUUMDB-2">
  239.   <refsect1info>
  240.    <date>1998-10-04</date>
  241.   </refsect1info>
  242.   <title>
  243.    Notes
  244.   </title>
  245.   
  246.   <para>
  247.    See <xref endterm="vacuum" linkend="vacuum"> for more details.
  248.   </para>
  249.  </refsect1>
  250.  
  251.  <refsect1 id="R1-APP-VACUUMDB-3">
  252.   <refsect1info>
  253.    <date>1998-10-04</date>
  254.   </refsect1info>
  255.   <title>
  256.    Usage
  257.   </title>
  258.   <para>
  259.    To clean a database of the same name as the user:
  260.    
  261.    <programlisting>
  262.     % vacuumdb
  263.    </programlisting>
  264.   </para>
  265.   <para>
  266.    To analyze a database named <literal>bigdb</literal> for the optimizer:
  267.    <programlisting>
  268.     % vacuumdb --analyze bigdb
  269.    </programlisting>
  270.   </para>
  271.   <para>
  272.    To analyze a single column <literal>bar</literal> in table <literal>foo</literal>
  273.    in a database named <literal>xyzzy</literal> for the optimizer:
  274.    
  275.    <programlisting>
  276.     % vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy
  277.    </programlisting>
  278.   </para>
  279.  </refsect1>
  280. </refentry>
  281. <!-- Keep this comment at the end of the file
  282. Local variables:
  283. mode: sgml
  284. sgml-omittag:nil
  285. sgml-shorttag:t
  286. sgml-minimize-attributes:nil
  287. sgml-always-quote-attributes:t
  288. sgml-indent-step:1
  289. sgml-indent-data:t
  290. sgml-parent-document:nil
  291. sgml-default-dtd-file:"../reference.ced"
  292. sgml-exposed-tags:nil
  293. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  294. sgml-local-ecat-files:nil
  295. End:
  296. -->