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

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="APP-DESTROYDB">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    <application>destroydb</application>
  5.   </refentrytitle>
  6.   <refmiscinfo>Application</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname>
  10.    <application>destroydb</application>
  11.   </refname>
  12.   <refpurpose>
  13.    Remove an existing <productname>Postgres</productname> database
  14.   </refpurpose>
  15.  </refnamediv>
  16.  <refsynopsisdiv>
  17.   <refsynopsisdivinfo>
  18.    <date>1998-10-02</date>
  19.   </refsynopsisdivinfo>
  20.   <synopsis>
  21. destroydb [ <replaceable class="parameter">dbname</replaceable> ]
  22. destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
  23.     [ -i ] [ <replaceable class="parameter">dbname</replaceable> ]
  24.   </synopsis>
  25.   <refsect2 id="R2-APP-DESTROYDB-1">
  26.    <refsect2info>
  27.     <date>1998-10-02</date>
  28.    </refsect2info>
  29.    <title>
  30.     Inputs
  31.    </title>
  32.    <para>
  33.     <variablelist>
  34.      <varlistentry>
  35.       <term>-h <replaceable class="parameter">host</replaceable></term>
  36.       <listitem>
  37.        <para>
  38. Specifies the hostname of the machine on which the 
  39. <application>postmaster</application>
  40. is running.  Defaults to using a local Unix domain socket
  41. rather than an IP connection.
  42.        </para>
  43.       </listitem>
  44.      </varlistentry>
  45.      <varlistentry>
  46.       <term>-p <replaceable class="parameter">port</replaceable></term>
  47.       <listitem>
  48.        <para>
  49. Specifies the Internet TCP/IP port or local Unix domain socket file 
  50. extension on which the <application>postmaster</application>
  51. is listening for connections.  The port number defaults to 5432,
  52. or the value of the <envar>PGPORT</envar>
  53. environment variable (if set).
  54.        </para>
  55.       </listitem>
  56.      </varlistentry>
  57.      <varlistentry>
  58.       <term>-i</term>
  59.       <listitem>
  60.        <para>
  61. Run in interactive mode.
  62. Prompts for confirmation before destroying a database.
  63.        </para>
  64.       </listitem>
  65.      </varlistentry>
  66.      <varlistentry>
  67.       <term><replaceable class="parameter">dbname</replaceable></term>
  68.       <listitem>
  69.        <para>
  70. Specifies the name of the database to be destroyed.  The database
  71. must be one of the existing <productname>Postgres</productname> databases
  72. in this installation.
  73. <replaceable class="parameter">dbname</replaceable>
  74. defaults to the value of the
  75. <envar>USER</envar>
  76. environment variable.
  77.        </para>
  78.       </listitem>
  79.      </varlistentry>
  80.     </variablelist>
  81.    </para>
  82.   </refsect2>
  83.   <refsect2 id="R2-APP-DESTROYDB-2">
  84.    <refsect2info>
  85.     <date>1998-10-02</date>
  86.    </refsect2info>
  87.    <title>
  88.     Outputs
  89.    </title>
  90.    <para>
  91.     <application>destroydb</application> will remove files from the
  92.     <filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
  93.     data area for the existing database.
  94.     <variablelist>
  95.      <varlistentry>
  96.       <term><computeroutput>
  97. Connection to database 'template1' failed.
  98. connectDB() failed: Is the postmaster running and accepting connections
  99.                     at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
  100. destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
  101.        </computeroutput></term>
  102.       <listitem>
  103.        <para>
  104. <application>destroydb</application> could not attach to the 
  105. <application>postmaster</application> 
  106. process on the specified host and port.  If you see this message,
  107. ensure that the <application>postmaster</application> 
  108. is running on the proper host and that you have specified the proper
  109. port.  If your site uses an authentication system, ensure that you
  110. have obtained the required authentication credentials.
  111.        </para>
  112.       </listitem>
  113.      </varlistentry>
  114.      <varlistentry>
  115.       <term><computeroutput>
  116. Connection to database 'template1' failed.
  117. FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
  118. destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
  119.        </computeroutput></term>
  120.       <listitem>
  121.        <para>
  122. You do not have a valid entry in the relation <literal>pg_shadow</literal>
  123. and and will not be allowed to access <productname>Postgres</productname>. 
  124. Contact your <productname>Postgres</productname> administrator.
  125.        </para>
  126.       </listitem>
  127.      </varlistentry>
  128.      <varlistentry>
  129.       <term><computeroutput>
  130. ERROR:  user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
  131. destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
  132.        </computeroutput></term>
  133.       <listitem>
  134.        <para>
  135. You do not have permission to destroy (or create) databases. 
  136. Contact your <productname>Postgres</productname> site administrator.
  137.        </para>
  138.       </listitem>
  139.      </varlistentry>
  140.      <varlistentry>
  141.       <term><computeroutput>
  142. ERROR:  destroydb: database '<replaceable class="parameter">dbname</replaceable>' does not exist.
  143. destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
  144.        </computeroutput></term>
  145.       <listitem>
  146.        <para>
  147. The database to be removed does not have an entry in the
  148. <literal>pg_database</literal> class.
  149.        </para>
  150.       </listitem>
  151.      </varlistentry>
  152.      <varlistentry>
  153.       <term><computeroutput>
  154. ERROR:  destroydb: database '<replaceable class="parameter">dbname</replaceable>' is not owned by you.
  155. destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
  156.        </computeroutput></term>
  157.       <listitem>
  158.        <para>
  159. You are not the Database Administrator (DBA) for the specified database.
  160.        </para>
  161.       </listitem>
  162.      </varlistentry>
  163.      <varlistentry>
  164.       <term><computeroutput>
  165. destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
  166.        </computeroutput></term>
  167.       <listitem>
  168.        <para>
  169. An internal error occurred in <application>psql</application>
  170. or in the backend server.  Ensure that your site administrator has
  171. properly installed <productname>Postgres</productname>and initialized the site with 
  172. <application>initdb</application>.
  173.        </para>
  174.       </listitem>
  175.      </varlistentry>
  176.     </variablelist>
  177.    </para>
  178.    <note>
  179.     <para>
  180.      <application>destroydb</application> internally runs
  181.      <command>DESTROY DATABASE</command> from <application>psql</application>
  182.      while connected to the <literal>template1</literal> database.
  183.     </para>
  184.    </note>
  185.   </refsect2>
  186.  </refsynopsisdiv>
  187.  <refsect1 id="R1-APP-DESTROYDB-1">
  188.   <refsect1info>
  189.    <date>1998-10-02</date>
  190.   </refsect1info>
  191.   <title>
  192.    Description
  193.   </title>
  194.   <para>
  195.    <application>destroydb</application> destroys an existing
  196.    <productname>Postgres</productname> database.
  197.    The person who executes this command must be
  198.    the database administrator, or <acronym>DBA</acronym>,
  199.    or must be the <productname>Postgres</productname> super-user.
  200.    The program runs silently; no confirmation message will be displayed.
  201.    After the database is destroyed, a Unix shell prompt will reappear.
  202.   </para>
  203.   <para>
  204.    All references to
  205.    the database are removed, including the directory containing this
  206.    database and its associated files.
  207.   </para>
  208.   <para>
  209.    <application>destroydb</application> is a shell script that invokes
  210.    <application>psql</application>.
  211.    Hence, a <application>postmaster</application>
  212.    process must be running on the database server host before
  213.    <application>destroydb</application>
  214.    is executed. The 
  215.    <envar>PGOPTION</envar>
  216.    and
  217.    <envar>PGREALM</envar>
  218.    environment variables will be passed on to
  219.    <application>psql</application>
  220.    and processed as described in <xref endterm="psql-ref"
  221.     linkend="app-psql">.
  222.   </para>
  223.  </refsect1>
  224.  <refsect1 id="R1-APP-DESTROYDB-2">
  225.   <refsect1info>
  226.    <date>1998-10-02</date>
  227.   </refsect1info>
  228.   <title>
  229.    Usage
  230.   </title>
  231.   <para>
  232.    To destroy the database <literal>demo</literal>
  233.    using the postmaster on the local host, port 5432:
  234.    <programlisting>
  235.     destroydb demo
  236.    </programlisting>
  237.   </para>
  238.   <para>
  239.    To destroy the database <literal>demo</literal>
  240.    using the postmaster on host eden, port 5000:
  241.    <programlisting>
  242.     destroydb -p 5000 -h eden demo
  243.    </programlisting>
  244.   </para>
  245.  </refsect1>
  246. </refentry>
  247. <!-- Keep this comment at the end of the file
  248. Local variables:
  249. mode: sgml
  250. sgml-omittag:nil
  251. sgml-shorttag:t
  252. sgml-minimize-attributes:nil
  253. sgml-always-quote-attributes:t
  254. sgml-indent-step:1
  255. sgml-indent-data:t
  256. sgml-parent-document:nil
  257. sgml-default-dtd-file:"../reference.ced"
  258. sgml-exposed-tags:nil
  259. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  260. sgml-local-ecat-files:nil
  261. End:
  262. -->