![background image](http://html1.mh-extra.com/html/oracle/5-0/5-0_reference-manual_1646196651.webp)
Point-in-Time (Incremental) Recovery Using the Binary Log
631
shell>
mysqldump --all-databases --no-create-info > dump-data.sql
On the upgraded server:
shell>
mysql < dump-data.sql
Now check the table contents and run some test queries.
7.5. Point-in-Time (Incremental) Recovery Using the Binary Log
Point-in-time recovery refers to recovery of data changes made since a given point in time. Typically,
this type of recovery is performed after restoring a full backup that brings the server to its state as of
the time the backup was made. (The full backup can be made in several ways, such as those listed
in
Section 7.2, “Database Backup Methods”
.) Point-in-time recovery then brings the server up to date
incrementally from the time of the full backup to a more recent time.
Point-in-time recovery is based on these principles:
• The source of information for point-in-time recovery is the set of incremental backups represented by
the binary log files generated subsequent to the full backup operation. Therefore, the server must be
started with the
--log-bin
[1467]
option to enable binary logging (see
Section 5.2.3, “The Binary
Log”
).
To restore data from the binary log, you must know the name and location of the current binary log
files. By default, the server creates binary log files in the data directory, but a path name can be
specified with the
--log-bin
[1467]
option to place the files in a different location.
Section 5.2.3,
“The Binary Log”
.
To see a listing of all binary log files, use this statement:
mysql>
SHOW BINARY LOGS;
To determine the name of the current binary log file, issue the following statement:
mysql>
SHOW MASTER STATUS;
• The
mysqlbinlog
utility converts the events in the binary log files from binary format to text so
that they can be executed or viewed.
mysqlbinlog
has options for selecting sections of the binary
log based on event times or position of events within the log. See
Section 4.6.7, “
mysqlbinlog
—
Utility for Processing Binary Log Files”
.
• Executing events from the binary log causes the data modifications they represent to be redone. This
enables recovery of data changes for a given span of time. To execute events from the binary log,
process
mysqlbinlog
output using the
mysql
client:
shell>
mysqlbinlog binlog_files | mysql -u root -p
• Viewing log contents can be useful when you need to determine event times or positions to select
partial log contents prior to executing events. To view events from the log, send
mysqlbinlog
output into a paging program:
shell>
mysqlbinlog binlog_files | more
Alternatively, save the output in a file and view the file in a text editor:
shell>
mysqlbinlog binlog_files > tmpfile
shell> ...
edit tmpfile
...
• Saving the output in a file is useful as a preliminary to executing the log contents with certain events
removed, such as an accidental
DROP DATABASE
. You can delete from the file any statements not to
be executed before executing its contents. After editing the file, execute the contents as follows:
shell>
mysql -u root -p < tmpfile
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...