![background image](http://html1.mh-extra.com/html/oracle/5-0/5-0_reference-manual_16461961145.webp)
Replication Statements
1125
ERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed
when global transaction is in the ACTIVE state
Statements to which the preceding remark applies are listed at
Section 13.3.3, “Statements That Cause
an Implicit Commit”
.
13.4. Replication Statements
Replication can be controlled through the SQL interface using the statements described in this section.
One group of statements controls master servers, the other controls slave servers.
13.4.1. SQL Statements for Controlling Master Servers
This section discusses statements for managing master replication servers.
Section 13.4.2, “SQL
Statements for Controlling Slave Servers”
, discusses statements for managing slave servers.
In addition to the statements described here, the following
SHOW
statements are used with master
servers in replication. For information about these statements, see
Section 13.7.5, “
SHOW
Syntax”
.
•
SHOW BINARY LOGS
•
SHOW BINLOG EVENTS
•
SHOW MASTER STATUS
•
SHOW SLAVE HOSTS
13.4.1.1.
PURGE BINARY LOGS
Syntax
PURGE { BINARY | MASTER } LOGS
{ TO '
log_name
' | BEFORE
datetime_expr
}
The binary log is a set of files that contain information about data modifications made by the MySQL
server. The log consists of a set of binary log files, plus an index file (see
Section 5.2.3, “The Binary
Log”
).
The
PURGE BINARY LOGS
statement deletes all the binary log files listed in the log index file prior
to the specified log file name or date.
BINARY
and
MASTER
are synonyms. Deleted log files also are
removed from the list recorded in the index file, so that the given log file becomes the first in the list.
This statement has no effect if the server was not started with the
--log-bin
[1467]
option to enable
binary logging.
Examples:
PURGE BINARY LOGS TO 'mysql-bin.010';
PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';
The
BEFORE
variant's
datetime_expr
argument should evaluate to a
DATETIME
value (a value in
'YYYY-MM-DD hh:mm:ss'
format).
This statement is safe to run while slaves are replicating. You need not stop them. If you have an active
slave that currently is reading one of the log files you are trying to delete, this statement does nothing
and fails with an error. However, if a slave is not connected and you happen to purge one of the log
files it has yet to read, the slave will be unable to replicate after it reconnects.
To safely purge binary log files, follow this procedure:
1. On each slave server, use
SHOW SLAVE STATUS
to check which log file it is reading.
2. Obtain a listing of the binary log files on the master server with
SHOW BINARY LOGS
.
Содержание 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 ...