List:Commits« Previous MessageNext Message »
From:paul.dubois Date:July 23 2008 5:26pm
Subject:svn commit - mysqldoc@docsrva: r11329 - in trunk: . refman-6.0
View as plain text  
Author: paul
Date: 2008-07-23 19:26:52 +0200 (Wed, 23 Jul 2008)
New Revision: 11329

Log:
 r32898@frost:  paul | 2008-07-23 12:19:48 -0500
 Additional information about compression for BACKUP DATABASE


Modified:
   trunk/refman-6.0/sql-syntax-server-administration.xml

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:32880
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:32403
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:32898
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:32403


Modified: trunk/refman-6.0/sql-syntax-server-administration.xml
===================================================================
--- trunk/refman-6.0/sql-syntax-server-administration.xml	2008-07-23 16:02:22 UTC (rev 11328)
+++ trunk/refman-6.0/sql-syntax-server-administration.xml	2008-07-23 17:26:52 UTC (rev 11329)
Changed blocks: 5, Lines Added: 78, Lines Deleted: 31; 6981 bytes

@@ -2657,7 +2657,8 @@
 BACKUP {DATABASE | SCHEMA}
     { * | <replaceable>db_name</replaceable> [, <replaceable>db_name</replaceable>] ... }
     TO '<replaceable>image_file_name</replaceable>';
-    [WITH COMPRESSION [COMPRESSION_ALGORITHM [=] <replaceable>algorithm_name</replaceable>]]
+    [WITH COMPRESSION
+      [COMPRESSION_ALGORITHM [=] <replaceable>algorithm_name</replaceable>]]
 </programlisting>
 
       <remark role="todo">

@@ -2701,24 +2702,44 @@
       </para>
 
       <para>
-        As of MySQL 6.0.7, you can use the <literal>WITH
-        COMPRESSION</literal> clause. This causes <literal>BACKUP
-        DATABASE</literal> to compress the backup, which reduces the
-        image size, and may also result in improved backup time by
-        reducing writes to disk. The optional <literal>COMPRESSION
-        ALGORITHM</literal> clause may be given when using <literal>WITH
-        COMPRESSION</literal>. The only allowable algorithm name is
-        <literal>gzip</literal>, which is also the default.
-        <literal>gzip</literal> compression is the same as that done by
-        the <command>gzip</command> command-line utility.
+        Upon successful completion, the <literal>BACKUP
+        DATABASE</literal> statement returns a result set with the
+        backup number. Warnings produced during the operation can be
+        displayed with <literal>SHOW WARNINGS</literal>. If the backup
+        operation fails, it returns an error and any file created by the
+        operation is deleted.
       </para>
 
+<programlisting>
+mysql&gt; <userinput>BACKUP DATABASE test TO '/tmp/world.backup';</userinput>
++-----------+
+| backup_id |
++-----------+
+| 8         | 
++-----------+
+</programlisting>
+
       <para>
-        <literal>RESTORE</literal> detects whether a backup image has
-        been compressed and uncompresses it automatically as necessary.
+        While the operation is in progress, it can be monitored as
+        described in
+        <xref linkend="backup-database-restore-monitoring"/>.
       </para>
 
       <para>
+        As of MySQL 6.0.7, you can use the <literal>WITH
+        COMPRESSION</literal> clause to cause <literal>BACKUP
+        DATABASE</literal> to compress the backup. This reduces the
+        image size. The optional
+        <literal>COMPRESSION_ALGORITHM</literal> clause may be given
+        when using <literal>WITH COMPRESSION</literal>. The only
+        allowable algorithm name is <literal>gzip</literal>, which is
+        also the default. <literal>gzip</literal> compression is the
+        same as that done by the <command>gzip</command> command-line
+        utility; it follows the conventions described as
+        <ulink url="http://www.faqs.org/rfcs/rfc1952.html"/>.
+      </para>
+
+      <para>
         If <literal>WITH COMPRESSION</literal> is given, the entire
         backup is compressed. It is not possible to selectively compress
         some databases but not others within a single backup operation.

@@ -2734,30 +2755,45 @@
       </para>
 
       <para>
-        Upon successful completion, the <literal>BACKUP
-        DATABASE</literal> statement returns a result set with the
-        backup number. Warnings produced during the operation can be
-        displayed with <literal>SHOW WARNINGS</literal>. If the backup
-        operation fails, it returns an error and any file created by the
-        operation is deleted.
+        <literal>RESTORE</literal> detects whether a backup image is
+        compressed and uncompresses it automatically as necessary.
       </para>
 
-<programlisting>
-mysql&gt; <userinput>BACKUP DATABASE test TO '/tmp/world.backup';</userinput>
-+-----------+
-| backup_id |
-+-----------+
-| 8         | 
-+-----------+
-</programlisting>
+      <para>
+        It is possible to manually compress and uncompressed image or
+        uncompress a compressed image by using a
+        <command>gzip</command>-compatible tool. In either case,
+        <literal>RESTORE</literal> will detect whether the image needs
+        to be compressed.
+      </para>
 
       <para>
-        While the operation is in progress, it can be monitored as
-        described in
-        <xref linkend="backup-database-restore-monitoring"/>.
+        For a MySQL server to be able to produce compressed images, it
+        must be compiled with <literal>zlib</literal> support (see
+        <xref linkend="configure-options"/>). If <literal>WITH
+        COMPRESSION</literal> is specified and <literal>zlib</literal>
+        support is not present, <literal>BACKUP DATABASE</literal> fails
+        with an error.
       </para>
 
       <para>
+        If you produce a compressed image with a server that has
+        <literal>zlib</literal> support, the image cannot be restored by
+        another server unless that server also has
+        <literal>zlib</literal> support, or unless you manually
+        uncompress the image first. Otherwise, the
+        <literal>RESTORE</literal> operation will fail with an error.
+      </para>
+
+      <para>
+        Use of compression may make backup and restore operations faster
+        by reducing the amount of disk I/O. There is some tradeoff due
+        to the increased CPU load required for compression and
+        uncompression calculations, but in general we expect this to be
+        outweighed by the time savings from reduced I/O.
+      </para>
+
+      <para>
         <literal>BACKUP DATABASE</literal> backs up database and table
         definitions, table data, stored routines, triggers, events, and
         views. <literal>TEMPORARY</literal> tables are not included.

@@ -2776,7 +2812,10 @@
         database selector syntax. Do not include them in the list of
         names if you specify database names explicitly. To back up the
         <literal>mysql</literal> database, you can use the
-        <command>mysqldump</command> program.
+        <command>mysqldump</command> program. For an example backup
+        strategy that combines <literal>BACKUP DATABASE</literal> with
+        <command>mysqldump</command>, see
+        <xref linkend="backup-database-restore-quick-guide"/>.
       </para>
 
       <remark role="help-description-end"/>

@@ -2868,6 +2907,14 @@
         <xref linkend="backup-database-restore-monitoring"/>.
       </para>
 
+      <para>
+        <literal>RESTORE</literal> detects whether the image file is
+        compressed and uncompresses it automatically as necessary.
+        (Compressed image files can be produced by using the
+        <literal>WITH COMPRESSION</literal> clause in the
+        <literal>BACKUP DATABASE</literal> statement.)
+      </para>
+
       <caution>
         <para>
           <literal>RESTORE</literal> is a destructive operation. Each


Thread
svn commit - mysqldoc@docsrva: r11329 - in trunk: . refman-6.0paul.dubois23 Jul