List:Internals« Previous MessageNext Message »
From:stefan Date:July 26 2005 10:14am
Subject:bk commit - mysqldoc@docsrva tree (stefan:1.3124)
View as plain text  
Below is the list of changes that have just been committed into a local
mysqldoc repository of stefan. When stefan does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.3124 05/07/26 10:14:04 stefan@stripped +6 -0
  titles.ent, mysql-database-administration.xml:
    Sync with refman
  titles.ent:
    Add entities for PITR section
  mysql-database-administration.xml:
    Add Russell's PITR section
    after heavy reformatting :)
  titles.ent:
    Add missing entities
  mysql-database-administration.xml:
    Prepare new section: PITR

  refman-5.0/titles.ent
    1.38 05/07/26 10:13:43 stefan@stripped +3 -1
    Sync with refman

  refman-5.0/mysql-database-administration.xml
    1.34 05/07/26 10:13:40 stefan@stripped +137 -2
    Sync with refman

  refman-4.1/titles.ent
    1.29 05/07/26 10:13:39 stefan@stripped +3 -1
    Sync with refman

  refman-4.1/mysql-database-administration.xml
    1.22 05/07/26 10:13:37 stefan@stripped +137 -2
    Sync with refman

  refman/titles.ent
    1.40 05/07/26 10:13:23 stefan@stripped +3 -1
    Add entities for PITR section

  refman/mysql-database-administration.xml
    1.32 05/07/26 10:12:56 stefan@stripped +137 -2
    Add Russell's PITR section
    after heavy reformatting :)

  refman-5.0/titles.ent
    1.37 05/07/26 09:46:09 stefan@stripped +9 -12
    Sync with refman

  refman-5.0/mysql-database-administration.xml
    1.33 05/07/26 09:46:06 stefan@stripped +6 -0
    Sync with refman

  refman-4.1/titles.ent
    1.28 05/07/26 09:46:06 stefan@stripped +6 -4
    Sync with refman

  refman-4.1/mysql-database-administration.xml
    1.21 05/07/26 09:46:04 stefan@stripped +6 -0
    Sync with refman

  refman/titles.ent
    1.39 05/07/26 09:45:53 stefan@stripped +9 -12
    Add missing entities

  refman/mysql-database-administration.xml
    1.31 05/07/26 09:44:56 stefan@stripped +6 -0
    Prepare new section: PITR

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stefan
# Host:	apollon.site
# Root:	/home/stefan/bk/mysqldoc

--- 1.20/refman-4.1/mysql-database-administration.xml	2005-07-19 17:57:20 +02:00
+++ 1.22/refman-4.1/mysql-database-administration.xml	2005-07-26 10:13:37 +02:00
@@ -18402,6 +18402,147 @@
 
     </section>
 
+    <section id="point-in-time-recovery">
+     <title
id="title-point-in-time-recovery">&title-point-in-time-recovery;</title>
+     <para>
+       If a MySQL server has the binary log enabled, you can use the 
+       <command>mysqlbinlog</command> utility to recover data starting 
+       from a specified point in time (e.g., since your last backup) 
+       until the present or another specified point in time.  
+       For information on enabling the binary log, see 
+       <xref linkend="binary-log"/>.
+       For more information on the <command>mysqlbinlog</command>, 
+       see <xref linkend="mysqlbinlog"/>.
+     </para>
+
+     <para>
+       To be able to restore data from a binary log, you will need to 
+       know the path and name of the current binary log file. The path 
+       can tyically be found in the options file 
+       (that is, <filename>my.cnf</filename> or 
+       <filename>my.ini</filename>, depending on your system). If it's 
+       not contained in the options file, it may be given as an option 
+       at the command-line when the server is started. The option for 
+       enabling binary logging is <option>--log-bin</option>. To 
+       determine the name of the current binary log file, enter the 
+       following statement in MySQL:
+<programlisting>
+SHOW BINLOG EVENTS \G
+</programlisting>
+     </para>
+
+     <para>
+       If you prefer, you could enter the following from the 
+       command line instead:
+<programlisting>
+mysql --user=<replaceable>root</replaceable>
-p<replaceable>my_pwd</replaceable> -e 'SHOW BINLOG EVENTS \G'
+</programlisting>
+     </para>
+     <para>
+       Replace the password <replaceable>my_pwd</replaceable> with 
+       the <replaceable>root</replaceable> password for your server.
+     </para>
+
+     <section id="point-in-time-recovery-times">
+      <title
id="title-point-in-time-recovery-times">&title-point-in-time-recovery-times;</title>
+      <para>
+        As of version 4.1.4 of MySQL, the <option>--start-date</option> 
+        and the <option>--stop-date</option> options are available 
+        for <command>mysqlbinlog</command> to specify the start and 
+        end times in the <literal>DATETIME</literal> format. As an 
+        example, suppose that exactly at 10:00 a.m. today 
+        (today being April 20, 2005) an SQL statement was executed 
+        which deleted a large table. To restore the table and data, 
+        you could restore the previous night's backup, and then enter 
+        the following:
+<programlisting>
+mysqlbinlog --stop-date="2005-04-20 9:59:59" /var/log/mysql/bin.123456 \
+     | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable>
+</programlisting>
+      </para>
+
+      <para>
+        This will recover all of the data up until the date and time 
+        given as a <literal>DATETIME</literal> format for the 
+        <option>--stop-date</option> option. If you did not detect the 
+        erroneous SQL statement that was entered until hours later, 
+        you will probably want to recover the activity that occurred 
+        afterwards, as well. Based on this, you could run the 
+        <command>mysqlbinlog</command> again with a start date and 
+        time like so:
+<programlisting>
+mysqlbinlog --start-date="2005-04-20 10:01:00" /var/log/mysql/bin.123456 \
+     | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> \
+</programlisting>
+      </para>
+
+      <para>
+        In this line, the SQL statements logged from 10:01 a.m. will 
+        be run. The combination of executing of the previous night's 
+        dump file and the  two lines of the 
+        <command>mysqlbinlog</command> will restore everything up until
+        one second before 10:00 a.m. and everything from 10:01 a.m. on.
+        You should examine the log to be sure of the exact times.
+        The next section explains how this might be done.
+      </para>
+     </section>
+
+     <section id="point-in-time-recovery-positions">
+      <title
id="title-point-in-time-recovery-positions">&title-point-in-time-recovery-positions;</title>
+      <para>
+        Instead of specifying dates and times, the options 
+        <option>--start-position</option> and  
+        <option>--stop-position</option> for 
+        <command>mysqlbinlog</command> could be used for specifying 
+        log positions. They work the same as the start and stop date 
+        options, except that position numbers from the log are given.
+        Using log positions may a be more accurate recovery method, 
+        especially if many transactions occurred around the same time 
+        as a damaging SQL statement. To determine the position numbers,
+        you could run <command>mysqlbinlog</command> for a range of 
+        times around when the  unwanted transaction was executed, but 
+        redirect the results to a text file for examination. 
+        This can be done like so:
+<programlisting>
+mysqlbinlog --start-date="2005-04-20 9:55:00" --stop-date="2005-04-20 10:05:00" \
+      /var/log/mysql/bin.123456 &gt; /tmp/mysql_restore.sql
+</programlisting>
+      </para>
+
+      <para>
+        This will create a small text file in the 
+        <filename>/tmp</filename> directory which will show the SQL 
+        statements around the time the deleterious SQL statement was 
+        executed. You would then open this file with a text editor and 
+        look for the statement that you don't want to repeat. Once the 
+        position numbers in the binary log are determined for stopping 
+        and resuming the recovery, make note of them. Positions are 
+        labeled with <literal>log_pos</literal> followed by a number.
+        After restoring the previous backup file, using the position 
+        numbers, you would then enter something like the following from 
+        the command-line:
+<programlisting>
+mysqlbinlog --stop-position="368312" /var/log/mysql/bin.123456 \
+    | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> 
+
+mysqlbinlog --start-position="368315" /var/log/mysql/bin.123456 \
+    | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> \ 
+</programlisting>
+      </para>
+      <para>
+        The first line above will recover all of the transactions up 
+        until the stop position given. The next line will recover all 
+        transactions from the starting position given until the end 
+        of the binary log.  Because the output of 
+        <command>mysqlbinlog</command> includes 
+        <literal>SET TIMESTAMP</literal> statements before each SQL 
+        statement recorded, the recovered data and related MySQL logs 
+        will reflect the original times that the transactions were 
+        executed.
+      </para>
+     </section>
+    </section>
+
     <section id="table-maintenance">
 
       <title
id='title-table-maintenance'>&title-table-maintenance;</title>

--- 1.27/refman-4.1/titles.ent	2005-07-26 07:32:31 +02:00
+++ 1.29/refman-4.1/titles.ent	2005-07-26 10:13:39 +02:00
@@ -1,7 +1,9 @@
 <?xml version='1.0' encoding='utf-8'?>
 <!ENTITY top "MySQL 4.1 Reference Manual"><!-- Title of Manual current edition. 
-->
 <!ENTITY current-version "4.1.13"><!-- Latest 4.1.x Version - update with new
releases -->
+<!ENTITY title-news-5-0-11 "Changes in release 5.0.11 (Not yet released)"><!--
"Changes in release 5.0.10 (Not yet released)" -->
 <!ENTITY title-news-5-0-9 "Changes in release 5.0.9 (Not yet released)"><!--
"Changes in release 5.0.9 (Not yet released)" -->
+<!ENTITY title-news-4-0-26 "Changes in release 4.0.26 (Not yet released)"><!--
"Changes in release 4.0.26 (Not yet released)" -->
 <!ENTITY title-news-4-0-9 "Changes in release 4.0.9 (09 Jan 2003)"><!-- "Changes
in release 4.0.9 (09 Jan 2003)" -->
 <!ENTITY title-mysql-internals "MySQL Internals"><!-- "MySQL Internals" -->
 <!ENTITY title-msaccess "MyODBC and Microsoft Access"><!-- "MyODBC and Microsoft
Access" -->
@@ -830,8 +832,7 @@
 <!ENTITY title-myodbc-unix-thread-safe "Thread-Safe Client"><!-- "Thread-Safe
Client" -->
 <!ENTITY title-introduction "General Information"><!-- "General Information"
-->
 <!ENTITY title-installing-source-tree "Installing from the Development Source
Tree"><!-- "Installing from the Development Source Tree" -->
-<!ENTITY title-news-4-0-25 "Changes in release 4.0.25 (05 July 2005)">
-<!ENTITY title-news-4-0-26 "Changes in release 4.0.26 (Not yet released)">
+<!ENTITY title-news-4-0-25 "Changes in release 4.0.25 (05 July 2005)"><!--
"Changes in release 4.0.25 (05 July 2005)" -->
 <!ENTITY title-optimize-access "How Do I Optimize Access for Performance with
MyODBC?"><!-- "How Do I Optimize Access for Performance with MyODBC?" -->
 <!ENTITY title-linux-os "Linux Operating System Notes"><!-- "Linux Operating
System Notes" -->
 <!ENTITY title-grant "<literal>GRANT</literal> and
<literal>REVOKE</literal> Syntax"><!--
"<literal>GRANT</literal> and <literal>REVOKE</literal> Syntax"
-->
@@ -841,8 +842,7 @@
 <!ENTITY title-myodbc-unix-tarball-installation "Installing MyODBC from a Binary
Tarball Distribution"><!-- "Installing MyODBC from a Binary Tarball Distribution"
-->
 <!ENTITY title-mysql-select-db
"<literal>mysql_select_db()</literal>"><!--
"<literal>mysql_select_db()</literal>" -->
 <!ENTITY title-counting-rows "Counting Rows"><!-- "Counting Rows" -->
-<!ENTITY title-show-tables "<literal>SHOW TABLES</literal> Syntax">
-<!ENTITY title-show-open-tables "<literal>SHOW OPEN TABLES</literal>
Syntax">
+<!ENTITY title-show-tables "<literal>SHOW TABLES</literal>
Syntax"><!-- "<literal>SHOW TABLES</literal> Syntax" -->
 <!ENTITY title-mysql-config-wizard-networking "The Networking Options
Dialog"><!-- "The Networking Options Dialog" -->
 <!ENTITY title-charset-collation-charset "Collations Must Be for the Right Character
Set"><!-- "Collations Must Be for the Right Character Set" -->
 <!ENTITY title-mysql-thread-id
"<literal>mysql_thread_id()</literal>"><!--
"<literal>mysql_thread_id()</literal>" -->
@@ -1518,3 +1518,7 @@
 <!ENTITY title-limits "Limits in MySQL">
 <!ENTITY title-restrictions "MySQL Feature Restrictions">
 <!ENTITY title-subquery-restrictions "Restrictions on Subqueries">
+<!ENTITY title-show-open-tables "<literal>SHOW OPEN TABLES</literal>
Syntax"><!-- "<literal>SHOW OPEN TABLES</literal> Syntax" -->
+<!ENTITY title-point-in-time-recovery "Point-in-Time Recovery"><!--
"Point-in-Time Recovery" -->
+<!ENTITY title-point-in-time-recovery-times "Specifying Times for Recovery"><!--
"Specifying Times for Recovery" -->
+<!ENTITY title-point-in-time-recovery-positions "Specifying Positions for
Recovery"><!-- "Specifying Positions for Recovery" -->

--- 1.32/refman-5.0/mysql-database-administration.xml	2005-07-20 23:59:39 +02:00
+++ 1.34/refman-5.0/mysql-database-administration.xml	2005-07-26 10:13:40 +02:00
@@ -18082,6 +18082,147 @@
 
     </section>
 
+    <section id="point-in-time-recovery">
+     <title
id="title-point-in-time-recovery">&title-point-in-time-recovery;</title>
+     <para>
+       If a MySQL server has the binary log enabled, you can use the 
+       <command>mysqlbinlog</command> utility to recover data starting 
+       from a specified point in time (e.g., since your last backup) 
+       until the present or another specified point in time.  
+       For information on enabling the binary log, see 
+       <xref linkend="binary-log"/>.
+       For more information on the <command>mysqlbinlog</command>, 
+       see <xref linkend="mysqlbinlog"/>.
+     </para>
+
+     <para>
+       To be able to restore data from a binary log, you will need to 
+       know the path and name of the current binary log file. The path 
+       can tyically be found in the options file 
+       (that is, <filename>my.cnf</filename> or 
+       <filename>my.ini</filename>, depending on your system). If it's 
+       not contained in the options file, it may be given as an option 
+       at the command-line when the server is started. The option for 
+       enabling binary logging is <option>--log-bin</option>. To 
+       determine the name of the current binary log file, enter the 
+       following statement in MySQL:
+<programlisting>
+SHOW BINLOG EVENTS \G
+</programlisting>
+     </para>
+
+     <para>
+       If you prefer, you could enter the following from the 
+       command line instead:
+<programlisting>
+mysql --user=<replaceable>root</replaceable>
-p<replaceable>my_pwd</replaceable> -e 'SHOW BINLOG EVENTS \G'
+</programlisting>
+     </para>
+     <para>
+       Replace the password <replaceable>my_pwd</replaceable> with 
+       the <replaceable>root</replaceable> password for your server.
+     </para>
+
+     <section id="point-in-time-recovery-times">
+      <title
id="title-point-in-time-recovery-times">&title-point-in-time-recovery-times;</title>
+      <para>
+        As of version 4.1.4 of MySQL, the <option>--start-date</option> 
+        and the <option>--stop-date</option> options are available 
+        for <command>mysqlbinlog</command> to specify the start and 
+        end times in the <literal>DATETIME</literal> format. As an 
+        example, suppose that exactly at 10:00 a.m. today 
+        (today being April 20, 2005) an SQL statement was executed 
+        which deleted a large table. To restore the table and data, 
+        you could restore the previous night's backup, and then enter 
+        the following:
+<programlisting>
+mysqlbinlog --stop-date="2005-04-20 9:59:59" /var/log/mysql/bin.123456 \
+     | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable>
+</programlisting>
+      </para>
+
+      <para>
+        This will recover all of the data up until the date and time 
+        given as a <literal>DATETIME</literal> format for the 
+        <option>--stop-date</option> option. If you did not detect the 
+        erroneous SQL statement that was entered until hours later, 
+        you will probably want to recover the activity that occurred 
+        afterwards, as well. Based on this, you could run the 
+        <command>mysqlbinlog</command> again with a start date and 
+        time like so:
+<programlisting>
+mysqlbinlog --start-date="2005-04-20 10:01:00" /var/log/mysql/bin.123456 \
+     | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> \
+</programlisting>
+      </para>
+
+      <para>
+        In this line, the SQL statements logged from 10:01 a.m. will 
+        be run. The combination of executing of the previous night's 
+        dump file and the  two lines of the 
+        <command>mysqlbinlog</command> will restore everything up until
+        one second before 10:00 a.m. and everything from 10:01 a.m. on.
+        You should examine the log to be sure of the exact times.
+        The next section explains how this might be done.
+      </para>
+     </section>
+
+     <section id="point-in-time-recovery-positions">
+      <title
id="title-point-in-time-recovery-positions">&title-point-in-time-recovery-positions;</title>
+      <para>
+        Instead of specifying dates and times, the options 
+        <option>--start-position</option> and  
+        <option>--stop-position</option> for 
+        <command>mysqlbinlog</command> could be used for specifying 
+        log positions. They work the same as the start and stop date 
+        options, except that position numbers from the log are given.
+        Using log positions may a be more accurate recovery method, 
+        especially if many transactions occurred around the same time 
+        as a damaging SQL statement. To determine the position numbers,
+        you could run <command>mysqlbinlog</command> for a range of 
+        times around when the  unwanted transaction was executed, but 
+        redirect the results to a text file for examination. 
+        This can be done like so:
+<programlisting>
+mysqlbinlog --start-date="2005-04-20 9:55:00" --stop-date="2005-04-20 10:05:00" \
+      /var/log/mysql/bin.123456 &gt; /tmp/mysql_restore.sql
+</programlisting>
+      </para>
+
+      <para>
+        This will create a small text file in the 
+        <filename>/tmp</filename> directory which will show the SQL 
+        statements around the time the deleterious SQL statement was 
+        executed. You would then open this file with a text editor and 
+        look for the statement that you don't want to repeat. Once the 
+        position numbers in the binary log are determined for stopping 
+        and resuming the recovery, make note of them. Positions are 
+        labeled with <literal>log_pos</literal> followed by a number.
+        After restoring the previous backup file, using the position 
+        numbers, you would then enter something like the following from 
+        the command-line:
+<programlisting>
+mysqlbinlog --stop-position="368312" /var/log/mysql/bin.123456 \
+    | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> 
+
+mysqlbinlog --start-position="368315" /var/log/mysql/bin.123456 \
+    | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> \ 
+</programlisting>
+      </para>
+      <para>
+        The first line above will recover all of the transactions up 
+        until the stop position given. The next line will recover all 
+        transactions from the starting position given until the end 
+        of the binary log.  Because the output of 
+        <command>mysqlbinlog</command> includes 
+        <literal>SET TIMESTAMP</literal> statements before each SQL 
+        statement recorded, the recovered data and related MySQL logs 
+        will reflect the original times that the transactions were 
+        executed.
+      </para>
+     </section>
+    </section>
+
     <section id="table-maintenance">
 
       <title
id='title-table-maintenance'>&title-table-maintenance;</title>

--- 1.36/refman-5.0/titles.ent	2005-07-26 07:32:31 +02:00
+++ 1.38/refman-5.0/titles.ent	2005-07-26 10:13:43 +02:00
@@ -2,9 +2,10 @@
 <!ENTITY top "MySQL 5.0 Reference Manual"><!-- "MySQL 5.0 Reference Manual"
--><!-- Title of Manual current edition.  -->
 <!ENTITY title-refman-previous "MySQL 4.1 Reference Manual"><!--  "MySQL 4.1
Reference Manual" --><!--  "MySQL 4.1 Reference Manual" --><!-- Title of
Manual previous edition  -->
 <!ENTITY current-version "5.0.9-beta"><!-- "5.0.9-beta" --><!-- Current
MySQL Version - update with new releases -->
-<!ENTITY title-news-5-0-11 "Changes in release 5.0.11 (Not yet released)"><!--
"Changes in release 5.0.11 (Not yet released)" -->
+<!ENTITY title-news-5-0-11 "Changes in release 5.0.11 (Not yet released)"><!--
"Changes in release 5.0.10 (Not yet released)" -->
 <!ENTITY title-news-5-0-10 "Changes in release 5.0.10 (Not yet released)"><!--
"Changes in release 5.0.10 (Not yet released)" -->
 <!ENTITY title-news-5-0-9 "Changes in release 5.0.9 (15 July 2005)"><!--
"Changes in release 5.0.9 (Not yet released)" -->
+<!ENTITY title-news-4-0-26 "Changes in release 4.0.26 (Not yet released)"><!--
"Changes in release 4.0.26 (Not yet released)" -->
 <!ENTITY title-news-4-0-9 "Changes in release 4.0.9 (09 Jan 2003)"><!-- "Changes
in release 4.0.9 (09 Jan 2003)" -->
 <!ENTITY title-mysql-internals "MySQL Internals"><!-- "MySQL Internals" -->
 <!ENTITY title-msaccess "MyODBC and Microsoft Access"><!-- "MyODBC and Microsoft
Access" -->
@@ -189,8 +190,7 @@
 <!ENTITY title-mysql-commands "<command>mysql</command>
Commands"><!-- "<command>mysql</command> Commands" -->
 <!ENTITY title-charset-literal "Character String Literal Character Set and
Collation"><!-- "Character String Literal Character Set and Collation" -->
 <!ENTITY title-replication-faq "Replication FAQ"><!-- "Replication FAQ" -->
-<!ENTITY title-news-5-0-x "Changes in release 5.0.x (Development)">
-<!ENTITY title-news-5-1-x "Changes in release 5.1.x (Development)">
+<!ENTITY title-news-5-0-x "Changes in release 5.0.x (Development)"><!-- "Changes
in release 5.0.x (Development)" -->
 <!ENTITY title-documenters-slash-translators "Documenters and translators"><!--
"Documenters and translators" -->
 <!ENTITY title-storage-requirements "Column Type Storage Requirements"><!--
"Column Type Storage Requirements" -->
 <!ENTITY title-mysql-stmt-errno
"<literal>mysql_stmt_errno()</literal>"><!--
"<literal>mysql_stmt_errno()</literal>" -->
@@ -837,8 +837,7 @@
 <!ENTITY title-myodbc-unix-thread-safe "Thread-Safe Client"><!-- "Thread-Safe
Client" -->
 <!ENTITY title-introduction "General Information"><!-- "General Information"
-->
 <!ENTITY title-installing-source-tree "Installing from the Development Source
Tree"><!-- "Installing from the Development Source Tree" -->
-<!ENTITY title-news-4-0-25 "Changes in release 4.0.25 (05 July 2005)">
-<!ENTITY title-news-4-0-26 "Changes in release 4.0.26 (Not yet released)">
+<!ENTITY title-news-4-0-25 "Changes in release 4.0.25 (05 July 2005)"><!--
"Changes in release 4.0.25 (05 July 2005)" -->
 <!ENTITY title-optimize-access "How Do I Optimize Access for Performance with
MyODBC?"><!-- "How Do I Optimize Access for Performance with MyODBC?" -->
 <!ENTITY title-linux-os "Linux Operating System Notes"><!-- "Linux Operating
System Notes" -->
 <!ENTITY title-grant "<literal>GRANT</literal> and
<literal>REVOKE</literal> Syntax"><!--
"<literal>GRANT</literal> and <literal>REVOKE</literal> Syntax"
-->
@@ -848,8 +847,7 @@
 <!ENTITY title-myodbc-unix-tarball-installation "Installing MyODBC from a Binary
Tarball Distribution"><!-- "Installing MyODBC from a Binary Tarball Distribution"
-->
 <!ENTITY title-mysql-select-db
"<literal>mysql_select_db()</literal>"><!--
"<literal>mysql_select_db()</literal>" -->
 <!ENTITY title-counting-rows "Counting Rows"><!-- "Counting Rows" -->
-<!ENTITY title-show-tables "<literal>SHOW TABLES</literal> Syntax">
-<!ENTITY title-show-open-tables "<literal>SHOW OPEN TABLES</literal>
Syntax">
+<!ENTITY title-show-tables "<literal>SHOW TABLES</literal>
Syntax"><!-- "<literal>SHOW TABLES</literal> Syntax" -->
 <!ENTITY title-mysql-config-wizard-networking "The Networking Options
Dialog"><!-- "The Networking Options Dialog" -->
 <!ENTITY title-charset-collation-charset "Collations Must Be for the Right Character
Set"><!-- "Collations Must Be for the Right Character Set" -->
 <!ENTITY title-mysql-thread-id
"<literal>mysql_thread_id()</literal>"><!--
"<literal>mysql_thread_id()</literal>" -->
@@ -1509,8 +1507,7 @@
 <!ENTITY title-mysql-get-client-version
"<literal>mysql_get_client_version()</literal>"><!--
"<literal>mysql_get_client_version()</literal>" -->
 <!ENTITY title-number-syntax "Numbers"><!-- "Numbers" -->
 <!ENTITY title-query-issues "Query-Related Issues"><!-- "Query-Related Issues"
-->
-<!ENTITY title-news-5-0-1 "Changes in release 5.0.1 (27 Jul 2004)">
-<!ENTITY title-news-5-1-1 "Changes in release 5.1.1 (Not yet released)">
+<!ENTITY title-news-5-0-1 "Changes in release 5.0.1 (27 Jul 2004)"><!-- "Changes
in release 5.0.1 (27 Jul 2004)" -->
 <!ENTITY title-tools-used-to-create-mysql "Tools that were used to create
MySQL"><!-- "Tools that were used to create MySQL" -->
 <!ENTITY title-mysql-stmt-close
"<literal>mysql_stmt_close()</literal>"><!--
"<literal>mysql_stmt_close()</literal>" -->
 <!ENTITY title-news-3-21-10 "Changes in release 3.21.10"><!-- "Changes in
release 3.21.10" -->
@@ -1527,8 +1524,7 @@
 <!ENTITY title-insert-delayed "<literal>INSERT DELAYED</literal>
Syntax"><!-- "<literal>INSERT DELAYED</literal> Syntax" -->
 <!ENTITY title-innodb-news-3-23-51 "MySQL/InnoDB-3.23.51, June 12, 2002"><!--
"MySQL/InnoDB-3.23.51, June 12, 2002" -->
 <!ENTITY title-datetime "The <literal>DATETIME</literal>,
<literal>DATE</literal>, and <literal>TIMESTAMP</literal>
Types"><!-- "The <literal>DATETIME</literal>,
<literal>DATE</literal>, and <literal>TIMESTAMP</literal> Types"
-->
-<!ENTITY title-stored-procedure-logging
- "Binary Logging of Stored Routines and Triggers">
+<!ENTITY title-stored-procedure-logging "Binary Logging of Stored Routines and
Triggers">
 <!ENTITY title-limits "Limits in MySQL">
 <!ENTITY title-restrictions "MySQL Feature Restrictions">
 <!ENTITY title-routine-restrictions "Restrictions on Stored Routines and Triggers">
@@ -1538,4 +1534,7 @@
 <!ENTITY title-joins-limits "Limits of Joins">
 <!ENTITY title-triggers-table "The <literal>INFORMATION_SCHEMA
TRIGGERS</literal> Table"><!-- "The <literal>INFORMATION_SCHEMA
TRIGGERS</literal> Table" -->
 <!ENTITY title-show-triggers "<literal>SHOW TRIGGERS</literal>
Syntax"><!-- "<literal>SHOW TRIGGERS</literal> Syntax" -->
-
+<!ENTITY title-show-open-tables "<literal>SHOW OPEN TABLES</literal>
Syntax"><!-- "<literal>SHOW OPEN TABLES</literal> Syntax" -->
+<!ENTITY title-point-in-time-recovery "Point-in-Time Recovery"><!--
"Point-in-Time Recovery" -->
+<!ENTITY title-point-in-time-recovery-times "Specifying Times for Recovery"><!--
"Specifying Times for Recovery" -->
+<!ENTITY title-point-in-time-recovery-positions "Specifying Positions for
Recovery"><!-- "Specifying Positions for Recovery" -->

--- 1.30/refman/mysql-database-administration.xml	2005-07-20 23:59:40 +02:00
+++ 1.32/refman/mysql-database-administration.xml	2005-07-26 10:12:56 +02:00
@@ -18510,6 +18510,147 @@
 
     </section>
 
+    <section id="point-in-time-recovery">
+     <title
id="title-point-in-time-recovery">&title-point-in-time-recovery;</title>
+     <para>
+       If a MySQL server has the binary log enabled, you can use the 
+       <command>mysqlbinlog</command> utility to recover data starting 
+       from a specified point in time (e.g., since your last backup) 
+       until the present or another specified point in time.  
+       For information on enabling the binary log, see 
+       <xref linkend="binary-log"/>.
+       For more information on the <command>mysqlbinlog</command>, 
+       see <xref linkend="mysqlbinlog"/>.
+     </para>
+
+     <para>
+       To be able to restore data from a binary log, you will need to 
+       know the path and name of the current binary log file. The path 
+       can tyically be found in the options file 
+       (that is, <filename>my.cnf</filename> or 
+       <filename>my.ini</filename>, depending on your system). If it's 
+       not contained in the options file, it may be given as an option 
+       at the command-line when the server is started. The option for 
+       enabling binary logging is <option>--log-bin</option>. To 
+       determine the name of the current binary log file, enter the 
+       following statement in MySQL:
+<programlisting>
+SHOW BINLOG EVENTS \G
+</programlisting>
+     </para>
+
+     <para>
+       If you prefer, you could enter the following from the 
+       command line instead:
+<programlisting>
+mysql --user=<replaceable>root</replaceable>
-p<replaceable>my_pwd</replaceable> -e 'SHOW BINLOG EVENTS \G'
+</programlisting>
+     </para>
+     <para>
+       Replace the password <replaceable>my_pwd</replaceable> with 
+       the <replaceable>root</replaceable> password for your server.
+     </para>
+
+     <section id="point-in-time-recovery-times">
+      <title
id="title-point-in-time-recovery-times">&title-point-in-time-recovery-times;</title>
+      <para>
+        As of version 4.1.4 of MySQL, the <option>--start-date</option> 
+        and the <option>--stop-date</option> options are available 
+        for <command>mysqlbinlog</command> to specify the start and 
+        end times in the <literal>DATETIME</literal> format. As an 
+        example, suppose that exactly at 10:00 a.m. today 
+        (today being April 20, 2005) an SQL statement was executed 
+        which deleted a large table. To restore the table and data, 
+        you could restore the previous night's backup, and then enter 
+        the following:
+<programlisting>
+mysqlbinlog --stop-date="2005-04-20 9:59:59" /var/log/mysql/bin.123456 \
+     | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable>
+</programlisting>
+      </para>
+
+      <para>
+        This will recover all of the data up until the date and time 
+        given as a <literal>DATETIME</literal> format for the 
+        <option>--stop-date</option> option. If you did not detect the 
+        erroneous SQL statement that was entered until hours later, 
+        you will probably want to recover the activity that occurred 
+        afterwards, as well. Based on this, you could run the 
+        <command>mysqlbinlog</command> again with a start date and 
+        time like so:
+<programlisting>
+mysqlbinlog --start-date="2005-04-20 10:01:00" /var/log/mysql/bin.123456 \
+     | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> \
+</programlisting>
+      </para>
+
+      <para>
+        In this line, the SQL statements logged from 10:01 a.m. will 
+        be run. The combination of executing of the previous night's 
+        dump file and the  two lines of the 
+        <command>mysqlbinlog</command> will restore everything up until
+        one second before 10:00 a.m. and everything from 10:01 a.m. on.
+        You should examine the log to be sure of the exact times.
+        The next section explains how this might be done.
+      </para>
+     </section>
+
+     <section id="point-in-time-recovery-positions">
+      <title
id="title-point-in-time-recovery-positions">&title-point-in-time-recovery-positions;</title>
+      <para>
+        Instead of specifying dates and times, the options 
+        <option>--start-position</option> and  
+        <option>--stop-position</option> for 
+        <command>mysqlbinlog</command> could be used for specifying 
+        log positions. They work the same as the start and stop date 
+        options, except that position numbers from the log are given.
+        Using log positions may a be more accurate recovery method, 
+        especially if many transactions occurred around the same time 
+        as a damaging SQL statement. To determine the position numbers,
+        you could run <command>mysqlbinlog</command> for a range of 
+        times around when the  unwanted transaction was executed, but 
+        redirect the results to a text file for examination. 
+        This can be done like so:
+<programlisting>
+mysqlbinlog --start-date="2005-04-20 9:55:00" --stop-date="2005-04-20 10:05:00" \
+      /var/log/mysql/bin.123456 &gt; /tmp/mysql_restore.sql
+</programlisting>
+      </para>
+
+      <para>
+        This will create a small text file in the 
+        <filename>/tmp</filename> directory which will show the SQL 
+        statements around the time the deleterious SQL statement was 
+        executed. You would then open this file with a text editor and 
+        look for the statement that you don't want to repeat. Once the 
+        position numbers in the binary log are determined for stopping 
+        and resuming the recovery, make note of them. Positions are 
+        labeled with <literal>log_pos</literal> followed by a number.
+        After restoring the previous backup file, using the position 
+        numbers, you would then enter something like the following from 
+        the command-line:
+<programlisting>
+mysqlbinlog --stop-position="368312" /var/log/mysql/bin.123456 \
+    | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> 
+
+mysqlbinlog --start-position="368315" /var/log/mysql/bin.123456 \
+    | mysql -u <replaceable>root</replaceable>
-p<replaceable>mypwd</replaceable> \ 
+</programlisting>
+      </para>
+      <para>
+        The first line above will recover all of the transactions up 
+        until the stop position given. The next line will recover all 
+        transactions from the starting position given until the end 
+        of the binary log.  Because the output of 
+        <command>mysqlbinlog</command> includes 
+        <literal>SET TIMESTAMP</literal> statements before each SQL 
+        statement recorded, the recovered data and related MySQL logs 
+        will reflect the original times that the transactions were 
+        executed.
+      </para>
+     </section>
+    </section>
+
     <section id="table-maintenance">
 
       <title
id='title-table-maintenance'>&title-table-maintenance;</title>

--- 1.38/refman/titles.ent	2005-07-26 07:32:32 +02:00
+++ 1.40/refman/titles.ent	2005-07-26 10:13:23 +02:00
@@ -1,9 +1,10 @@
 <?xml version='1.0' encoding='utf-8'?>
 <!ENTITY top "MySQL Reference Manual"><!-- "MySQL Reference Manual" -->
 <!ENTITY current-version "5.0.9-beta"><!-- "5.0.9-beta" --><!-- Current
MySQL Version - update with new releases -->
-<!ENTITY title-news-5-0-11 "Changes in release 5.0.11 (Not yet released)"><!--
"Changes in release 5.0.11 (Not yet released)" -->
+<!ENTITY title-news-5-0-11 "Changes in release 5.0.11 (Not yet released)"><!--
"Changes in release 5.0.10 (Not yet released)" -->
 <!ENTITY title-news-5-0-10 "Changes in release 5.0.10 (Not yet released)"><!--
"Changes in release 5.0.10 (Not yet released)" -->
 <!ENTITY title-news-5-0-9 "Changes in release 5.0.9 (15 July 2005)"><!--
"Changes in release 5.0.9 (Not yet released)" -->
+<!ENTITY title-news-4-0-26 "Changes in release 4.0.26 (Not yet released)"><!--
"Changes in release 4.0.26 (Not yet released)" -->
 <!ENTITY title-news-4-0-9 "Changes in release 4.0.9 (09 Jan 2003)"><!-- "Changes
in release 4.0.9 (09 Jan 2003)" -->
 <!ENTITY title-mysql-internals "MySQL Internals"><!-- "MySQL Internals" -->
 <!ENTITY title-msaccess "MyODBC and Microsoft Access"><!-- "MyODBC and Microsoft
Access" -->
@@ -188,8 +189,7 @@
 <!ENTITY title-mysql-commands "<command>mysql</command>
Commands"><!-- "<command>mysql</command> Commands" -->
 <!ENTITY title-charset-literal "Character String Literal Character Set and
Collation"><!-- "Character String Literal Character Set and Collation" -->
 <!ENTITY title-replication-faq "Replication FAQ"><!-- "Replication FAQ" -->
-<!ENTITY title-news-5-0-x "Changes in release 5.0.x (Development)">
-<!ENTITY title-news-5-1-x "Changes in release 5.1.x (Development)">
+<!ENTITY title-news-5-0-x "Changes in release 5.0.x (Development)"><!-- "Changes
in release 5.0.x (Development)" -->
 <!ENTITY title-documenters-slash-translators "Documenters and translators"><!--
"Documenters and translators" -->
 <!ENTITY title-storage-requirements "Column Type Storage Requirements"><!--
"Column Type Storage Requirements" -->
 <!ENTITY title-mysql-stmt-errno
"<literal>mysql_stmt_errno()</literal>"><!--
"<literal>mysql_stmt_errno()</literal>" -->
@@ -836,8 +836,7 @@
 <!ENTITY title-myodbc-unix-thread-safe "Thread-Safe Client"><!-- "Thread-Safe
Client" -->
 <!ENTITY title-introduction "General Information"><!-- "General Information"
-->
 <!ENTITY title-installing-source-tree "Installing from the Development Source
Tree"><!-- "Installing from the Development Source Tree" -->
-<!ENTITY title-news-4-0-25 "Changes in release 4.0.25 (05 July 2005)">
-<!ENTITY title-news-4-0-26 "Changes in release 4.0.26 (Not yet released)">
+<!ENTITY title-news-4-0-25 "Changes in release 4.0.25 (05 July 2005)"><!--
"Changes in release 4.0.25 (05 July 2005)" -->
 <!ENTITY title-optimize-access "How Do I Optimize Access for Performance with
MyODBC?"><!-- "How Do I Optimize Access for Performance with MyODBC?" -->
 <!ENTITY title-linux-os "Linux Operating System Notes"><!-- "Linux Operating
System Notes" -->
 <!ENTITY title-grant "<literal>GRANT</literal> and
<literal>REVOKE</literal> Syntax"><!--
"<literal>GRANT</literal> and <literal>REVOKE</literal> Syntax"
-->
@@ -847,8 +846,7 @@
 <!ENTITY title-myodbc-unix-tarball-installation "Installing MyODBC from a Binary
Tarball Distribution"><!-- "Installing MyODBC from a Binary Tarball Distribution"
-->
 <!ENTITY title-mysql-select-db
"<literal>mysql_select_db()</literal>"><!--
"<literal>mysql_select_db()</literal>" -->
 <!ENTITY title-counting-rows "Counting Rows"><!-- "Counting Rows" -->
-<!ENTITY title-show-tables "<literal>SHOW TABLES</literal> Syntax">
-<!ENTITY title-show-open-tables "<literal>SHOW OPEN TABLES</literal>
Syntax">
+<!ENTITY title-show-tables "<literal>SHOW TABLES</literal>
Syntax"><!-- "<literal>SHOW TABLES</literal> Syntax" -->
 <!ENTITY title-mysql-config-wizard-networking "The Networking Options
Dialog"><!-- "The Networking Options Dialog" -->
 <!ENTITY title-charset-collation-charset "Collations Must Be for the Right Character
Set"><!-- "Collations Must Be for the Right Character Set" -->
 <!ENTITY title-mysql-thread-id
"<literal>mysql_thread_id()</literal>"><!--
"<literal>mysql_thread_id()</literal>" -->
@@ -1508,8 +1506,7 @@
 <!ENTITY title-mysql-get-client-version
"<literal>mysql_get_client_version()</literal>"><!--
"<literal>mysql_get_client_version()</literal>" -->
 <!ENTITY title-number-syntax "Numbers"><!-- "Numbers" -->
 <!ENTITY title-query-issues "Query-Related Issues"><!-- "Query-Related Issues"
-->
-<!ENTITY title-news-5-0-1 "Changes in release 5.0.1 (27 Jul 2004)">
-<!ENTITY title-news-5-1-1 "Changes in release 5.1.1 (Not yet released)">
+<!ENTITY title-news-5-0-1 "Changes in release 5.0.1 (27 Jul 2004)"><!-- "Changes
in release 5.0.1 (27 Jul 2004)" -->
 <!ENTITY title-tools-used-to-create-mysql "Tools that were used to create
MySQL"><!-- "Tools that were used to create MySQL" -->
 <!ENTITY title-mysql-stmt-close
"<literal>mysql_stmt_close()</literal>"><!--
"<literal>mysql_stmt_close()</literal>" -->
 <!ENTITY title-news-3-21-10 "Changes in release 3.21.10"><!-- "Changes in
release 3.21.10" -->
@@ -1526,8 +1523,7 @@
 <!ENTITY title-insert-delayed "<literal>INSERT DELAYED</literal>
Syntax"><!-- "<literal>INSERT DELAYED</literal> Syntax" -->
 <!ENTITY title-innodb-news-3-23-51 "MySQL/InnoDB-3.23.51, June 12, 2002"><!--
"MySQL/InnoDB-3.23.51, June 12, 2002" -->
 <!ENTITY title-datetime "The <literal>DATETIME</literal>,
<literal>DATE</literal>, and <literal>TIMESTAMP</literal>
Types"><!-- "The <literal>DATETIME</literal>,
<literal>DATE</literal>, and <literal>TIMESTAMP</literal> Types"
-->
-<!ENTITY title-stored-procedure-logging
- "Binary Logging of Stored Routines and Triggers">
+<!ENTITY title-stored-procedure-logging "Binary Logging of Stored Routines and
Triggers">
 <!ENTITY title-limits "Limits in MySQL">
 <!ENTITY title-restrictions "MySQL Feature Restrictions">
 <!ENTITY title-routine-restrictions "Restrictions on Stored Routines and Triggers">
@@ -1536,4 +1532,7 @@
 <!ENTITY title-view-restrictions "Restrictions on Views">
 <!ENTITY title-triggers-table "The <literal>INFORMATION_SCHEMA
TRIGGERS</literal> Table"><!-- "The <literal>INFORMATION_SCHEMA
TRIGGERS</literal> Table" -->
 <!ENTITY title-show-triggers "<literal>SHOW TRIGGERS</literal>
Syntax"><!-- "<literal>SHOW TRIGGERS</literal> Syntax" -->
-
+<!ENTITY title-show-open-tables "<literal>SHOW OPEN TABLES</literal>
Syntax"><!-- "<literal>SHOW OPEN TABLES</literal> Syntax" -->
+<!ENTITY title-point-in-time-recovery "Point-in-Time Recovery"><!--
"Point-in-Time Recovery" -->
+<!ENTITY title-point-in-time-recovery-times "Specifying Times for Recovery"><!--
"Specifying Times for Recovery" -->
+<!ENTITY title-point-in-time-recovery-positions "Specifying Positions for
Recovery"><!-- "Specifying Positions for Recovery" -->
Thread
bk commit - mysqldoc@docsrva tree (stefan:1.3124)stefan26 Jul