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
. An ALTER
LOGFILE GROUP
statement has one and only one
ADD UNDOFILE
clause. No DROP
UNDOFILE
clause is currently supported.
All MySQL Cluster Disk Data objects share the same namespace. 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.
Prior to MySQL Cluster NDB 6.2.17, 6.3.23, and 6.4.3, path and file names for undo log files could not be longer than 128 characters. (Bug#31769)
The optional INITIAL_SIZE
parameter sets the
UNDO
file's initial size in bytes; if not
specified, the initial size default to 128M
(128 megabytes). You may optionally follow
size
with a one-letter abbreviation for
an order of magnitude, similar to those used in
my.cnf
. Generally, this is one of the letters
M
(for megabytes) or G
(for
gigabytes).
On 32-bit systems, the maximum supported value for
INITIAL_SIZE
is 4G
. (Bug#29186)
Beginning with MySQL Cluster NDB 2.1.18, 6.3.24, and 7.0.4, the
minimum allowed value for INITIAL_SIZE
is
1M
. (Bug#29574)
WAIT
is parsed but otherwise ignored, and so
has no effect in MySQL 5.1 and MySQL Cluster NDB 6.x. It 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. In MySQL 5.1 and MySQL Cluster NDB 6.x, the only
accepted values for engine_name
are
“NDBCLUSTER
” and
“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 12.1.14, “CREATE LOGFILE GROUP
Syntax”):
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 MySQL Cluster data node. You can verify
that the UNDO
files were created and obtain
information about them by querying the
INFORMATION_SCHEMA.FILES
table. 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 19.21, “The INFORMATION_SCHEMA FILES
Table”.)
ALTER LOGFILE GROUP
was added in MySQL 5.1.6.
In MySQL 5.1 and MySQL Cluster NDB 6.x, it is useful only with
Disk Data storage for MySQL Cluster. For more information, see
MySQL Cluster Disk Data Tables.
User Comments
Add your own comment.