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

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="APP-INITLOCATION">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    <application>initlocation</application>
  5.   </refentrytitle>
  6.   <refmiscinfo>Application</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname>
  10.    <application>initlocation</application>
  11.   </refname>
  12.   <refpurpose>
  13.    Create a secondary <productname>Postgres</productname> database storage area
  14.   </refpurpose>
  15.  </refnamediv>
  16.  <refsynopsisdiv>
  17.   <refsynopsisdivinfo>
  18.    <date>1998-10-02</date>
  19.   </refsynopsisdivinfo>
  20.   <synopsis>
  21. initlocation [ --location=<replaceable class="parameter">er">al</replaceable>ble> | -D <replaceable class="parameter">altdir</replaceable> ]
  22.     [ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
  23.     [ <replaceable class="parameter">altdir</replaceable> ]
  24.   </synopsis>
  25.   <refsect2 id="R2-APP-INITLOCATION-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>--location=<replaceable class="parameter">altdir</replaceable></term>
  36.       <term>-D <replaceable class="parameter">altdir</replaceable></term>
  37.       <term><replaceable class="parameter">altdir</replaceable></term>
  38.       <listitem>
  39.        <para>
  40. Where in your Unix filesystem do you want alternate databases to go?
  41. The top level directory is called the <envar>PGDATA</envar> directory, so you
  42. might want to point your first alternate location at
  43. <envar>PGDATA2</envar>.
  44.        </para>
  45.       </listitem>
  46.      </varlistentry>
  47.      <varlistentry>
  48.       <term>--username=<replaceable class="parameter">name</replaceable></term>
  49.       <term>-u <replaceable class="parameter">name</replaceable></term>
  50.       <term><envar>PGUSER</envar></term>
  51.       <listitem>
  52.        <para>
  53. Who will be the Unix filesystem owner of this database storage area?
  54. The
  55. <productname>Postgres</productname> superuser is a Unix user 
  56. who owns all files that store the database
  57. system and also owns the postmaster and backend processes that access them.
  58. Usually, this is the user who should run <application>initlocation</application>
  59. and who will thus have ownership of the directories and files.
  60.        </para>
  61.        <note>
  62. <para>
  63.  Only the Unix superuser can create a database system with a
  64.  different user as the <productname>Postgres</productname> superuser.
  65.  Specifying a user other than the <productname>Postgres</productname> superuser
  66.  may lead to database security and data integrity problems. Refer to the
  67.  <citetitle><productname>PostgreSQL</productname> Administrator's Guide</citetitle>
  68.  for more information.
  69. </para>
  70.        </note>
  71.       </listitem>
  72.      </varlistentry>
  73.     </variablelist>
  74.    </para>
  75.   </refsect2>
  76.   <refsect2 id="R2-APP-INITLOCATION-2">
  77.    <refsect2info>
  78.     <date>1998-09-26</date>
  79.    </refsect2info>
  80.    <title>
  81.     Outputs
  82.    </title>
  83.    <para>
  84.     <application>initlocation</application> will create directories in 
  85.     the specified place.
  86.     <variablelist>
  87.      <varlistentry>
  88.       <term><computeroutput>
  89. We are initializing the database area with username postgres (uid=500).
  90. This user will own all the files and must also own the server process.
  91. Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
  92. Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
  93.        </computeroutput></term>
  94.       <listitem>
  95.        <para>
  96. Successful completion.
  97.        </para>
  98.       </listitem>
  99.      </varlistentry>
  100.      <varlistentry>
  101.       <term><computeroutput>
  102. We are initializing the database area with username postgres (uid=500).
  103. This user will own all the files and must also own the server process.
  104. Creating Postgres database system directory /usr/local/src/testlocation
  105. mkdir: cannot make directory `<replaceable class="parameter">altdir</replaceable>': Permission denied
  106.        </computeroutput></term>
  107.       <listitem>
  108.        <para>
  109. You do not have filesystem permission to write to the specified directory area.
  110.        </para>
  111.       </listitem>
  112.      </varlistentry>
  113.      <varlistentry>
  114.       <term><computeroutput>
  115. Valid username not given.  You must specify the username for
  116. the Postgres superuser for the database system you are
  117. initializing, either with the --username option or by default
  118. to the USER environment variable.
  119.        </computeroutput></term>
  120.       <listitem>
  121.        <para>
  122. The username which you have specified is not the
  123. <productname>Postgres</productname> superuser.
  124.        </para>
  125.       </listitem>
  126.      </varlistentry>
  127.      <varlistentry>
  128.       <term><computeroutput>
  129. Can't tell what username to use.  You don't have the USER
  130. environment variable set to your username and didn't specify the
  131. --username option
  132.        </computeroutput></term>
  133.       <listitem>
  134.        <para>
  135. Specify the <option>--username</option> command line option.
  136.        </para>
  137.       </listitem>
  138.      </varlistentry>
  139.     </variablelist>
  140.    </para>
  141.   </refsect2>
  142.  </refsynopsisdiv>
  143.  <refsect1 id="R1-APP-INITLOCATION-1">
  144.   <refsect1info>
  145.    <date>1998-09-26</date>
  146.   </refsect1info>
  147.   <title>
  148.    Description
  149.   </title>
  150.   <para>
  151.    <application>initlocation</application> 
  152.    creates a new <productname>Postgres</productname> secondary database storage area. 
  153.    A secondary storage area contains a required tree of directories with
  154.    the correct file permissions on those directories.
  155.   </para>
  156.   <para>
  157.    Creating a database storage area consists of creating the directories in which
  158.    database data might live.
  159.   </para>
  160.   <para>
  161.    There are two kinds of arguments for <application>initlocation</application>.
  162.    First, you can specify an environment variable (e.g. <envar>PGDATA2</envar>).
  163.    This environment variable should be known to the backend for later use in
  164.    <command>CREATE DATABASE/WITH LOCATION</command>
  165.    or 
  166.    <command>createdb -D <replaceable class="parameter">altdir</replaceable></command>.
  167.    However, <emphasis>the backend daemon must have this variable in it's
  168.     environment</emphasis> for this to succeed.
  169.    Second, you may be able to specify an explicit
  170.    absolute path to the top directory of the storage area. However,this second
  171.    option is possible only if explicitly enabled during the
  172.    <productname>Postgres</productname> installation. It is usually disabled
  173.    to alleviate security and data integrity concerns.
  174.   </para>
  175.   <note>
  176.    <para>
  177.     <productname>Postgres</productname> will add <filename>/base/</filename>
  178.     to the specified path to create the storage area.
  179.    </para>
  180.    <para>
  181.     The backend requires that any argument to <option>WITH LOCATION</option> which is
  182.     in all uppercase and which has no path delimiters is an environment variable.
  183.    </para>
  184.   </note>
  185.  </refsect1>
  186.  <refsect1 id="R1-APP-INITLOCATION-2">
  187.   <refsect1info>
  188.    <date>1998-09-26</date>
  189.   </refsect1info>
  190.   <title>
  191.    Usage
  192.   </title>
  193.   <para>
  194.    To create a database in an alternate location, using an environment variable:
  195.    <programlisting>
  196. % setenv PGDATA2 /opt/postgres/data
  197. % initlocation PGDATA2
  198. % createdb -D PGDATA2
  199.    </programlisting>
  200.   </para>
  201.  </refsect1>
  202. </refentry>
  203. <!-- Keep this comment at the end of the file
  204. Local variables:
  205. mode: sgml
  206. sgml-omittag:nil
  207. sgml-shorttag:t
  208. sgml-minimize-attributes:nil
  209. sgml-always-quote-attributes:t
  210. sgml-indent-step:1
  211. sgml-indent-data:t
  212. sgml-parent-document:nil
  213. sgml-default-dtd-file:"../reference.ced"
  214. sgml-exposed-tags:nil
  215. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  216. sgml-local-ecat-files:nil
  217. End:
  218. -->