ALTER LOGFILE GROUPlogfile_group
ADD UNDOFILE 'file_name
' [INITIAL_SIZE [=]size
] [WAIT] ENGINE [=]engine_name
This statement adds an 此语句将名为“UNDO
file named 'file_name
' to an existing log file group logfile_group
. file_name
”的UNDO
文件添加到现有日志文件组logfile_group
组。An ALTER LOGFILE GROUP
statement has one and only one ADD UNDOFILE
clause. ALTER LOGFILE GROUP
语句只有一个ADD UNDOFILE
子句。No 当前不支持DROP UNDOFILE
clause is currently supported.DROP UNDOFILE
子句。
All NDB Cluster Disk Data objects share the same namespace. 所有NDB群集磁盘数据对象共享相同的命名空间。This means that each Disk Data object must be uniquely named (and not merely each Disk Data object of a given type). 这意味着每个磁盘数据对象必须具有唯一的名称(而不仅仅是给定类型的每个磁盘数据对象)。For example, you cannot have a tablespace and an undo log file with the same name, or an undo log file and a data file with the same name.例如,不能有同名的表空间和撤消日志文件,也不能有同名的撤消日志文件和数据文件。
The optional 可选的INITIAL_SIZE
parameter sets the UNDO
file's initial size in bytes; if not specified, the initial size defaults to 134217728 (128 MB). INITIAL_SIZE
参数以字节为单位设置UNDO
文件的初始大小;如果未指定,则初始大小默认为134217728(128 MB)。You may optionally follow 您可以选择在size
with a one-letter abbreviation for an order of magnitude, similar to those used in my.cnf
. size
后面加一个单字母的缩写,表示一个数量级,类似于my.cnf
中使用的缩写。Generally, this is one of the letters 通常,这是字母M
(megabytes) or G
(gigabytes). M
(兆字节)或G
(千兆字节)中的一个。(Bug #13116514, Bug #16104705, Bug #62858)
On 32-bit systems, the maximum supported value for 在32位系统上,INITIAL_SIZE
is 4294967296 (4 GB). INITIAL_SIZE
的最大支持值为4294967296(4 GB)。(Bug #29186)
The minimum allowed value for INITIAL_SIZE
is 1048576 (1 MB).INITIAL_SIZE
的最小允许值为1048576(1 MB)。 (Bug #29574)
WAIT
is parsed but otherwise ignored. WAIT
被解析,但在其他方面被忽略。This keyword currently has no effect, and is intended for future expansion.此关键字目前无效,用于将来扩展。
The ENGINE
parameter (required) determines the storage engine which is used by this log file group, with engine_name
being the name of the storage engine. ENGINE
参数(必需)确定此日志文件组使用的存储引擎,engine_name
是存储引擎的名称。Currently, the only accepted values for 目前,engine_name
are “NDBCLUSTER
” and “NDB
”. engine_name
的唯一可接受值是“NDBCLUSTER
”和“NDB
”。The two values are equivalent.这两个值相等。
Here is an example, which assumes that the log file group 下面是一个示例,它假设日志文件组lg_3
has already been created using CREATE LOGFILE GROUP
(see Section 13.1.16, “CREATE LOGFILE GROUP Statement”):lg_3
已经使用CREATE LOGFILE GROUP
创建(请参阅第13.1.16节,“CREATE LOGFILE GROUP语句”):
ALTER LOGFILE GROUP lg_3 ADD UNDOFILE 'undo_10.dat' INITIAL_SIZE=32M ENGINE=NDBCLUSTER;
When 当ALTER LOGFILE GROUP
is used with ENGINE = NDBCLUSTER
(alternatively, ENGINE = NDB
), an UNDO
log file is created on each NDB Cluster data node. ALTER LOGFILE GROUP
与ENGINE=NDBCLUSTER
(或者ENGINE = NDB
)一起使用时,将在每个NDB群集数据节点上创建一个撤消日志文件。You can verify that the 您可以通过查询UNDO
files were created and obtain information about them by querying the INFORMATION_SCHEMA.FILES
table. INFORMATION_SCHEMA.FILES
表来验证是否创建了UNDO
文件,并获取有关这些文件的信息。For example:例如:
mysql>SELECT FILE_NAME, LOGFILE_GROUP_NUMBER, EXTRA
->FROM INFORMATION_SCHEMA.FILES
->WHERE LOGFILE_GROUP_NAME = 'lg_3';
+-------------+----------------------+----------------+ | FILE_NAME | LOGFILE_GROUP_NUMBER | EXTRA | +-------------+----------------------+----------------+ | newdata.dat | 0 | CLUSTER_NODE=3 | | newdata.dat | 0 | CLUSTER_NODE=4 | | undo_10.dat | 11 | CLUSTER_NODE=3 | | undo_10.dat | 11 | CLUSTER_NODE=4 | +-------------+----------------------+----------------+ 4 rows in set (0.01 sec)
(See Section 26.3.15, “The INFORMATION_SCHEMA FILES Table”.)(请参阅第26.3.15节,“信息模式文件表”。)
Memory used for 用于UNDO_BUFFER_SIZE
comes from the global pool whose size is determined by the value of the SharedGlobalMemory
data node configuration parameter. UNDO_BUFFER_SIZE
的内存来自全局池,其大小由SharedGlobalMemory
数据节点配置参数的值决定。This includes any default value implied for this option by the setting of the 这包括通过设置InitialLogFileGroup
data node configuration parameter.InitialLogFileGroup
数据节点配置参数为该选项暗示的任何默认值。
ALTER LOGFILE GROUP
is useful only with Disk Data storage for NDB Cluster. ALTER LOGFILE GROUP
仅适用于NDB群集的磁盘数据存储。For more information, see Section 23.5.10, “NDB Cluster Disk Data Tables”.有关更多信息,请参阅第23.5.10节,“NDB群集磁盘数据表”。