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

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="APP-PG-UPGRADE">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    <application>pg_upgrade</application>
  5.   </refentrytitle>
  6.   <refmiscinfo>Application</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname>
  10.    <application>pg_upgrade</application>
  11.   </refname>
  12.   <refpurpose>
  13.    Allows upgrade from a previous release without reloading data
  14.   </refpurpose>
  15.  <refsynopsisdiv>
  16.   <refsynopsisdivinfo>
  17.    <date>1998-10-04</date>
  18.   </refsynopsisdivinfo>
  19.   <synopsis>
  20. pg_upgrade
  21. pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replaceable class="parameter">old_data_dir</replaceable>
  22.   </synopsis>
  23.  </refsynopsisdiv>
  24.  <refsect1 id="R1-APP-PG-UPGRADE-1">
  25.   <refsect1info>
  26.    <date>1998-10-04</date>
  27.   </refsect1info>
  28.   <title>
  29.    Description
  30.   </title>
  31.   <para>
  32.    <application>pg_upgrade</application>
  33.    is a utility for upgrading from a previous
  34.    PostgreSQL release without reloading all the data.
  35.   <procedure>
  36.    <title>Upgrading <productname>Postgres</productname></title>
  37.    <step performance="required">
  38.     <para>
  39.      Back up your data directory.
  40.     </para>
  41.    </step>
  42.    <step performance="required">
  43.     <para>
  44.      Use:
  45.      <programlisting>
  46. % pg_dumpall -s >db.out
  47.      </programlisting>
  48.      to dump out your old  database definitions without any
  49.      data.  Stop the postmaster and all backends.
  50.     </para>
  51.    </step>
  52.    <step performance="required">
  53.     <para>
  54.      Rename  (using mv) your old pgsql <filename>data/</filename> directory to
  55.      <filename>data.old/</filename>.
  56.     </para>
  57.    </step>
  58.    <step performance="required">
  59.     <para>
  60.      Do a
  61.      <command>make install</command> to install the new binaries.
  62.     </para>
  63.    </step>
  64.    <step performance="required">
  65.     <para>
  66.      Run <application>initdb</application> to create a new template1 database containing the system
  67.      tables for the new release.
  68.     </para>
  69.    </step>
  70.    <step performance="required">
  71.     <para>
  72.      Start the new postmaster.
  73.     </para>
  74.    </step>
  75.    <step performance="required">
  76.     <para>
  77.      Change your working directory to the 
  78.      pgsql main directory, and type:
  79.      <programlisting>
  80. % pg_upgrade -f db.out data.old
  81.      </programlisting>
  82.      The  system  will do some checking to make sure everything
  83.      is properly configured, and will run your db.out script to create
  84.      all the  databases and  tables you had, but with no
  85.      data.  It will then move the  data  files  from <filename>data.old/</filename>
  86.      into  the  proper <filename>data/</filename> directory.
  87.     </para>
  88.    </step>
  89.    <step performance="required">
  90.     <para>
  91.      <emphasis>Carefully</emphasis> examine the contents of the upgraded database.
  92.     </para>
  93.    </step>
  94.    <step performance="required">
  95.     <para>
  96.      You can delete the <filename>data.old/</filename> directory when you
  97.      are finished.
  98.     </para>
  99.  </refsect1>
  100. </refentry>
  101. <!-- Keep this comment at the end of the file
  102. Local variables:
  103. mode: sgml
  104. sgml-omittag:nil
  105. sgml-shorttag:t
  106. sgml-minimize-attributes:nil
  107. sgml-always-quote-attributes:t
  108. sgml-indent-step:1
  109. sgml-indent-data:t
  110. sgml-parent-document:nil
  111. sgml-default-dtd-file:"../reference.ced"
  112. sgml-exposed-tags:nil
  113. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  114. sgml-local-ecat-files:nil
  115. End:
  116. -->