1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2001-03-17 17:27:31 +01:00
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.16 2001/03/17 16:27:31 petere Exp $
|
1999-07-22 17:09:15 +02:00
|
|
|
Postgres documentation
|
|
|
|
-->
|
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refentry id="APP-VACUUMDB">
|
2000-11-12 00:01:45 +01:00
|
|
|
<docinfo>
|
|
|
|
<date>2000-11-11</date>
|
|
|
|
</docinfo>
|
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refmeta>
|
2000-11-12 00:01:45 +01:00
|
|
|
<refentrytitle id="APP-VACUUMDB-TITLE"><application>vacuumdb</application></refentrytitle>
|
|
|
|
<manvolnum>1</manvolnum>
|
1999-05-26 19:26:32 +02:00
|
|
|
<refmiscinfo>Application</refmiscinfo>
|
|
|
|
</refmeta>
|
2000-11-12 00:01:45 +01:00
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refnamediv>
|
2000-11-12 00:01:45 +01:00
|
|
|
<refname id="vacuumdb">vacuumdb</refname>
|
|
|
|
<refpurpose>Clean and analyze a <productname>Postgres</productname> database</refpurpose>
|
1998-12-29 03:24:47 +01:00
|
|
|
</refnamediv>
|
2000-11-12 00:01:45 +01:00
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refsynopsisdiv>
|
2000-11-12 00:01:45 +01:00
|
|
|
<cmdsynopsis>
|
|
|
|
<command>vacuumdb</command>
|
|
|
|
<arg rep="repeat"><replaceable>connection-options</replaceable></arg>
|
|
|
|
<arg><arg>-d</arg> <replaceable>dbname</replaceable></arg>
|
|
|
|
<group><arg>--analyze</arg><arg>-z</arg></group>
|
|
|
|
<group><arg>--verbose</arg><arg>-v</arg></group>
|
|
|
|
<arg>--table '<replaceable>table</replaceable>
|
|
|
|
<arg>( <replaceable class="parameter">column</replaceable> [,...] )</arg>'
|
|
|
|
</arg>
|
|
|
|
<sbr>
|
|
|
|
<command>vacuumdb</command>
|
|
|
|
<arg rep="repeat"><replaceable>connection-options</replaceable></arg>
|
|
|
|
<group><arg>--all</arg><arg>-a</arg></group>
|
|
|
|
<group><arg>--analyze</arg><arg>-z</arg></group>
|
|
|
|
<group><arg>--verbose</arg><arg>-v</arg></group>
|
|
|
|
</cmdsynopsis>
|
1998-11-14 03:01:40 +01:00
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refsect2 id="R2-APP-VACUUMDB-1">
|
|
|
|
<title>
|
1998-12-29 03:24:47 +01:00
|
|
|
Inputs
|
1999-05-26 19:26:32 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1998-12-29 03:24:47 +01:00
|
|
|
<application>vacuumdb</application> accepts the following command line arguments:
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-d <replaceable class="parameter">dbname</replaceable></term>
|
|
|
|
<term>--dbname <replaceable class="parameter">dbname</replaceable></term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Specifies the name of the database to be cleaned or analyzed.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-z</term>
|
|
|
|
<term>--analyze</term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Calculate statistics on the database for use by the optimizer.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1999-12-18 09:34:50 +01:00
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-a</term>
|
|
|
|
<term>--alldb</term>
|
1999-12-18 09:34:50 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Vacuum all databases.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-v</term>
|
|
|
|
<term>--verbose</term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print detailed information during processing.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-t <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
|
|
|
|
<term>--table <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Clean or analyze <replaceable class="parameter">table</replaceable> only.
|
|
|
|
Column names may be specified only in conjunction with
|
|
|
|
the <option>--analyze</option> option.
|
|
|
|
</para>
|
1999-12-07 23:41:44 +01:00
|
|
|
<tip>
|
|
|
|
<para>
|
|
|
|
If you specify columns to vacuum, you probably have to escape the parentheses
|
|
|
|
from the shell.
|
|
|
|
</para>
|
|
|
|
</tip>
|
1998-12-29 03:24:47 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<para>
|
|
|
|
<application>vacuumdb</application> also accepts
|
|
|
|
the following command line arguments for connection parameters:
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
|
|
|
<term>--host <replaceable class="parameter">host</replaceable></term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Specifies the hostname of the machine on which the
|
|
|
|
<application>postmaster</application>
|
2000-11-14 00:57:20 +01:00
|
|
|
is running. If host begins with a slash, it is used
|
2000-11-22 02:41:14 +01:00
|
|
|
as the directory for the unix domain socket.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
|
|
|
<term>--port <replaceable class="parameter">port</replaceable></term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
|
|
extension on which the <application>postmaster</application>
|
1999-12-07 23:41:44 +01:00
|
|
|
is listening for connections.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-U <replaceable class="parameter">username</replaceable></term>
|
|
|
|
<term>--username <replaceable class="parameter">username</replaceable></term>
|
1999-12-07 23:41:44 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Username to connect as.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-W</term>
|
|
|
|
<term>--password</term>
|
1999-12-07 23:41:44 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Force password prompt.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-e</term>
|
|
|
|
<term>--echo</term>
|
1999-12-07 23:41:44 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Echo the commands that <application>vacuumdb</application> generates
|
|
|
|
and sends to the backend.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<varlistentry>
|
2000-05-02 22:02:03 +02:00
|
|
|
<term>-q</term>
|
|
|
|
<term>--quiet</term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-12-07 23:41:44 +01:00
|
|
|
Do not display a response.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
1998-11-14 03:01:40 +01:00
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refsect2 id="R2-APP-VACUUMDB-2">
|
|
|
|
<title>
|
1998-12-29 03:24:47 +01:00
|
|
|
Outputs
|
1999-05-26 19:26:32 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1998-12-29 03:24:47 +01:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-12-07 23:41:44 +01:00
|
|
|
<term><computeroutput>VACUUM</computeroutput></term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-12-07 23:41:44 +01:00
|
|
|
Everything went well.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1998-11-14 03:01:40 +01:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<varlistentry>
|
1999-12-07 23:41:44 +01:00
|
|
|
<term><computeroutput>vacuumdb: Vacuum failed.</computeroutput></term>
|
1998-12-29 03:24:47 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-12-07 23:41:44 +01:00
|
|
|
Something went wrong. <application>vacuumdb</application> is only a wrapper
|
|
|
|
script. See <xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title">
|
2000-12-26 00:15:27 +01:00
|
|
|
and <xref linkend="APP-PSQL"> for a detailed
|
1999-12-07 23:41:44 +01:00
|
|
|
discussion of error messages and potential problems.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1998-11-14 03:01:40 +01:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
1998-11-14 03:01:40 +01:00
|
|
|
|
1999-12-07 23:41:44 +01:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
</refsect2>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refsect1 id="R1-APP-VACUUMDB-1">
|
|
|
|
<title>
|
1998-12-29 03:24:47 +01:00
|
|
|
Description
|
1999-05-26 19:26:32 +02:00
|
|
|
</title>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<para>
|
1998-12-29 03:24:47 +01:00
|
|
|
<application>vacuumdb</application> is a utility for cleaning a
|
2000-03-27 19:14:43 +02:00
|
|
|
<productname>Postgres</productname> database.
|
1998-12-29 03:24:47 +01:00
|
|
|
<application>vacuumdb</application> will also generate internal statistics
|
|
|
|
used by the <productname>Postgres</productname> query optimizer.
|
|
|
|
</para>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
<para>
|
1999-12-07 23:41:44 +01:00
|
|
|
<application>vacuumdb</application> is a shell script wrapper around the
|
|
|
|
backend command
|
|
|
|
<xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title"> via
|
2000-03-27 19:14:43 +02:00
|
|
|
the <productname>Postgres</productname> interactive terminal
|
2000-12-26 00:15:27 +01:00
|
|
|
<xref linkend="APP-PSQL">. There is no effective
|
1999-12-07 23:41:44 +01:00
|
|
|
difference between vacuuming databases via this or other methods.
|
|
|
|
<application>psql</application> must be found by the script and
|
|
|
|
a database server must be running at the targeted host. Also, any default
|
|
|
|
settings and environment variables available to <application>psql</application>
|
|
|
|
and the <application>libpq</application> front-end library do apply.
|
1998-12-29 03:24:47 +01:00
|
|
|
</para>
|
1999-12-07 23:41:44 +01:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
</refsect1>
|
1999-12-07 23:41:44 +01:00
|
|
|
|
1999-05-26 19:26:32 +02:00
|
|
|
<refsect1 id="R1-APP-VACUUMDB-3">
|
2000-11-12 00:01:45 +01:00
|
|
|
<title>Usage</title>
|
1999-12-07 23:41:44 +01:00
|
|
|
|
2000-11-12 00:01:45 +01:00
|
|
|
<informalexample>
|
|
|
|
<para>
|
|
|
|
To clean the database <literal>test</literal>:
|
|
|
|
<screen>
|
|
|
|
<prompt>$ </prompt><userinput>vacuumdb test</userinput>
|
|
|
|
</screen>
|
|
|
|
</para>
|
|
|
|
</informalexample>
|
1999-07-14 22:32:59 +02:00
|
|
|
|
2000-11-12 00:01:45 +01:00
|
|
|
<informalexample>
|
|
|
|
<para>
|
|
|
|
To analyze for the optimzer a database named
|
|
|
|
<literal>bigdb</literal>:
|
|
|
|
<screen>
|
|
|
|
<prompt>$ </prompt><userinput>vacuumdb --analyze bigdb</userinput>
|
|
|
|
</screen>
|
|
|
|
</para>
|
|
|
|
</informalexample>
|
1999-12-07 23:41:44 +01:00
|
|
|
|
2000-11-12 00:01:45 +01:00
|
|
|
<informalexample>
|
|
|
|
<para>
|
|
|
|
To analyze a single column <literal>bar</literal> in table
|
|
|
|
<literal>foo</literal> in a database named
|
|
|
|
<literal>xyzzy</literal> for the optimizer:
|
|
|
|
<screen>
|
|
|
|
<prompt>$ </prompt><userinput>vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy</userinput>
|
|
|
|
</screen>
|
|
|
|
</para>
|
|
|
|
</informalexample>
|
1999-12-07 23:41:44 +01:00
|
|
|
|
1998-12-29 03:24:47 +01:00
|
|
|
</refsect1>
|
1999-05-26 19:26:32 +02:00
|
|
|
</refentry>
|
1998-11-14 03:01:40 +01:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
1999-05-26 19:26:32 +02:00
|
|
|
sgml-omittag:nil
|
1998-11-14 03:01:40 +01:00
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../reference.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|