Author: jstephens
Date: 2006-03-08 05:50:11 +0100 (Wed, 08 Mar 2006)
New Revision: 1526
Log:
Reformat.
Modified:
trunk/refman-5.1/information-schema.xml
trunk/refman-5.1/ndbcluster.xml
trunk/refman-5.1/sql-syntax.xml
Modified: trunk/refman-5.1/information-schema.xml
===================================================================
--- trunk/refman-5.1/information-schema.xml 2006-03-08 04:45:45 UTC (rev 1525)
+++ trunk/refman-5.1/information-schema.xml 2006-03-08 04:50:11 UTC (rev 1526)
@@ -4229,151 +4229,158 @@
</para>
<itemizedlist>
-
+
<listitem>
<para>
<literal>FILE_ID</literal> column values are auto-generated.
</para>
</listitem>
-
+
<listitem>
<para>
- <literal>FILE_NAME</literal> is the name of an <literal>UNDO</literal>
- logfile created by <literal>CREATE LOGFILE GROUP</literal> or ALTER
- LOGFILE GROUP, or of a datafile created by <literal>CREATE
- TABLESPACE</literal> or <literal>ALTER TABLESPACE</literal>.
+ <literal>FILE_NAME</literal> is the name of an
+ <literal>UNDO</literal> logfile created by <literal>CREATE
+ LOGFILE GROUP</literal> or ALTER LOGFILE GROUP, or of a
+ datafile created by <literal>CREATE TABLESPACE</literal> or
+ <literal>ALTER TABLESPACE</literal>.
</para>
</listitem>
-
+
<listitem>
<para>
<literal>FILE_TYPE</literal> is one of the values
- <literal>UNDOFILE</literal> or <literal>DATAFILE</literal>.
+ <literal>UNDOFILE</literal> or <literal>DATAFILE</literal>.
</para>
</listitem>
-
+
<listitem>
<para>
- <literal>TABLESPACE_NAME</literal> is the name of the tablespace with
- which the file is associated.
+ <literal>TABLESPACE_NAME</literal> is the name of the
+ tablespace with which the file is associated.
</para>
</listitem>
-
+
<listitem>
<para>
- In MySQL 5.1, the value of the <literal>TABLESPACE_CATALOG</literal>
- column is always <literal>NULL</literal>.
+ In MySQL 5.1, the value of the
+ <literal>TABLESPACE_CATALOG</literal> column is always
+ <literal>NULL</literal>.
</para>
</listitem>
-
+
<listitem>
<para>
- <literal>TABLE_NAME</literal> is the name of the Disk Data table with
- which the file is associated, if any.
+ <literal>TABLE_NAME</literal> is the name of the Disk Data
+ table with which the file is associated, if any.
</para>
</listitem>
-
+
<listitem>
<para>
For an <literal>UNDO</literal> logfile,
- <literal>LOGFILE_GROUP_NAME</literal> gives the name of the logfile
- group to which the logfile belongs. For a datafile, this column is
- empty.
+ <literal>LOGFILE_GROUP_NAME</literal> gives the name of the
+ logfile group to which the logfile belongs. For a datafile,
+ this column is empty.
</para>
</listitem>
-
+
<listitem>
<para>
For an <literal>UNDO</literal> logfile, the
- <literal>LOGFILE_GROUP_NUMBER</literal> contains the auto-generated ID
- number of the logfile group to which the logfile belongs.
+ <literal>LOGFILE_GROUP_NUMBER</literal> contains the
+ auto-generated ID number of the logfile group to which the
+ logfile belongs.
</para>
</listitem>
-
+
<listitem>
<para>
- For a MySQL Cluster Disk Data logfile or datafile, the value of the
- <literal>ENGINE</literal> column is always <literal>NDB</literal>.
+ For a MySQL Cluster Disk Data logfile or datafile, the value
+ of the <literal>ENGINE</literal> column is always
+ <literal>NDB</literal>.
</para>
</listitem>
-
+
<listitem>
<para>
- For a MySQL Cluster Disk Data logfile or datafile, the value of the
- <literal>FULLTEXT_KEYS</literal> column is always empty.
+ For a MySQL Cluster Disk Data logfile or datafile, the value
+ of the <literal>FULLTEXT_KEYS</literal> column is always
+ empty.
</para>
</listitem>
-
+
<listitem>
<para>
- The <literal>FREE EXTENTS</literal> column displays the number of
- extents which have not yet been used by the file. The <literal>TOTAL
- EXTENTS</literal> column show the total number of extents allocated
- to the file.
+ The <literal>FREE EXTENTS</literal> column displays the number
+ of extents which have not yet been used by the file. The
+ <literal>TOTAL EXTENTS</literal> column show the total number
+ of extents allocated to the file.
</para>
-
- <para>
- The difference between these two columns is the number of extents
- currently in use by the file:
+
+ <para>
+ The difference between these two columns is the number of
+ extents currently in use by the file:
</para>
-
+
<programlisting>
SELECT TOTAL_EXTENTS - FREE_EXTENTS AS extents_used
FROM INFORMATION_SCHEMA.FILES
WHERE FILE-NAME = 'myfile.dat';
</programlisting>
-
+
<para>
- You can approximate the amount of disk space in use by the file by
- multiplying this difference by the value of the
- <literal>EXTENT_SIZE</literal> column, which gives the size of an
- extent for the file in bytes:
+ You can approximate the amount of disk space in use by the
+ file by multiplying this difference by the value of the
+ <literal>EXTENT_SIZE</literal> column, which gives the size of
+ an extent for the file in bytes:
</para>
-
+
<programlisting>
SELECT (TOTAL_EXTENTS - FREE_EXTENTS) * EXTENT_SIZE AS bytes_used
FROM INFORMATION_SCHEMA.FILES
WHERE FILE_NAME = 'myfile.dat';
</programlisting>
-
+
<para>
- Similarly, you can estimate the amount of space that remains available
- in a given file by multiplying <literal>FREE_EXTENTS</literal> by
+ Similarly, you can estimate the amount of space that remains
+ available in a given file by multiplying
+ <literal>FREE_EXTENTS</literal> by
<literal>EXTENT_SIZE</literal>:
</para>
-
+
<programlisting>
SELECT FREE_EXTENTS * EXTENT_SIZE AS bytes_free
FROM INFORMATION_SCHEMA.FILES
WHERE FILE_NAME = 'myfile.dat';
</programlisting>
-
+
<para>
- <emphasis role="bold">Important</emphasis>: The byte values produced
- by the preceding queries are approximations only, and their precision
- is inversely proportional to the value of
+ <emphasis role="bold">Important</emphasis>: The byte values
+ produced by the preceding queries are approximations only, and
+ their precision is inversely proportional to the value of
<literal>EXTENT_SIZE</literal>. That is, the larger
<literal>EXTENT_SIZE</literal> becomes, the less accurate the
approximations are.
</para>
-
+
<para>
- The extent size can be set in a <literal>CREATE TABLESPACE</literal>
- statement. See <xref linkend="create-tablespace"/>, for more
- information.
+ The extent size can be set in a <literal>CREATE
+ TABLESPACE</literal> statement. See
+ <xref linkend="create-tablespace"/>, for more information.
</para>
</listitem>
-
+
<listitem>
<para>
- The <literal>INITIAL_SIZE</literal> column shows the size in bytes of
- the file. This is the same value that was used in the
- <literal>INITIAL_SIZE</literal> clause of the <literal>CREATE LOGFILE
- GROUP</literal>, <literal>ALTER LOGFILE GROUP</literal>,
- <literal>CREATE TABLESPACE</literal>, or <literal>ALTER
- TABLESPACE</literal> statement used to create the file.
+ The <literal>INITIAL_SIZE</literal> column shows the size in
+ bytes of the file. This is the same value that was used in the
+ <literal>INITIAL_SIZE</literal> clause of the <literal>CREATE
+ LOGFILE GROUP</literal>, <literal>ALTER LOGFILE
+ GROUP</literal>, <literal>CREATE TABLESPACE</literal>, or
+ <literal>ALTER TABLESPACE</literal> statement used to create
+ the file.
</para>
-
+
<para>
For MySQL 5.1 Cluster Disk Data files, the value of the
<literal>MAXIMUM_SIZE</literal> column is always the same as
@@ -4381,136 +4388,141 @@
<literal>AUTOEXTEND_SIZE</literal> column is always empty.
</para>
</listitem>
-
+
<listitem>
<para>
- The <literal>CREATION_TIME</literal> column shows the date and time
- when the file was created. The <literal>LAST_UPDATE_TIME</literal>
- column displays the date and time when the file was last modified. The
- <literal>LAST_ACCESSED</literal> column provides the date and time
- when the file was last accessed by the server.
+ The <literal>CREATION_TIME</literal> column shows the date and
+ time when the file was created. The
+ <literal>LAST_UPDATE_TIME</literal> column displays the date
+ and time when the file was last modified. The
+ <literal>LAST_ACCESSED</literal> column provides the date and
+ time when the file was last accessed by the server.
</para>
</listitem>
-
+
<listitem>
<para>
For MySQL Cluster Disk Data files, the value of the
<literal>RECOVER_TIME</literal> and
<literal>TRANSACTION_COUNTER</literal> columns is always
- <literal>0</literal>.
+ <literal>0</literal>.
</para>
</listitem>
-
+
<listitem>
<para>
- For MySQL 5.1 CLuster Disk Data files, the following columns are
- always <literal>NULL</literal>:
+ For MySQL 5.1 CLuster Disk Data files, the following columns
+ are always <literal>NULL</literal>:
</para>
-
+
<itemizedlist>
+
<listitem>
<para>
<literal>VERSION</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>ROW_FORMAT</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>TABLE_ROWS</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>AVG_ROW_LENGTH</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>DATA_LENGTH</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>MAX_DATA_LENGTH</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>INDEX_LENGTH</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>DATA_FREE</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>CREATE_TIME</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>UPDATE_TIME</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>CHECK_TIME</literal>
</para>
</listitem>
-
+
<listitem>
<para>
<literal>CHECKSUM</literal>
</para>
</listitem>
- </itemizedlist>
-
+
+ </itemizedlist>
</listitem>
-
+
<listitem>
<para>
For MySQL Cluster Disk Data files, the value of the
- <literal>STATUS</literal> column is always <literal>NORMAL</literal>.
+ <literal>STATUS</literal> column is always
+ <literal>NORMAL</literal>.
</para>
</listitem>
-
+
<listitem>
<para>
- For MySQL Cluster Disk Data files, the <literal>EXTRA</literal> column
- shows which data node the file belongs to, as each data node has its
- own copy of the file. For example, suppose you use this statement on a
- MySQL Cluster with four data nodes:
+ For MySQL Cluster Disk Data files, the
+ <literal>EXTRA</literal> column shows which data node the file
+ belongs to, as each data node has its own copy of the file.
+ For example, suppose you use this statement on a MySQL Cluster
+ with four data nodes:
</para>
-
+
<programlisting>
CREATE LOGFILE GROUP mygroup
ADD UNDOFILE 'new_undo.dat'
INITIAL_SIZE 2G
ENGINE NDB;
</programlisting>
-
+
<para>
- After running the <literal>CREATE LOGFILE GROUP</literal> statement
- successfully, you should see a result similar to the one shown here
- for this query against the <literal>FILES</literal> table:
+ After running the <literal>CREATE LOGFILE GROUP</literal>
+ statement successfully, you should see a result similar to the
+ one shown here for this query against the
+ <literal>FILES</literal> table:
</para>
-
+
<programlisting>
mysql> <userinput>SELECT LOGFILE_GROUP_NAME, FILE_TYPE, EXTRA</userinput>
-> <userinput>FROM INFORMATION_SCHEMA.FILES</userinput>
@@ -4533,19 +4545,19 @@
was added in MySQL 5.1.6.
</para>
</listitem>
-
+
<listitem>
<para>
- There are no <literal>SHOW</literal> commands associated with the
- <literal>FILES</literal> table.
+ There are no <literal>SHOW</literal> commands associated with
+ the <literal>FILES</literal> table.
</para>
</listitem>
-
+
<listitem>
<para>
- For additional examples using the <literal>FILES</literal> table to
- obtain information about Cluster Disk Data tables, see
- <xref linkend="mysql-cluster-disk-data"/>.
+ For additional examples using the <literal>FILES</literal>
+ table to obtain information about Cluster Disk Data tables,
+ see <xref linkend="mysql-cluster-disk-data"/>.
</para>
</listitem>
Modified: trunk/refman-5.1/ndbcluster.xml
===================================================================
--- trunk/refman-5.1/ndbcluster.xml 2006-03-08 04:45:45 UTC (rev 1525)
+++ trunk/refman-5.1/ndbcluster.xml 2006-03-08 04:50:11 UTC (rev 1526)
@@ -8577,12 +8577,13 @@
<para>
Replication in MySQL Cluster makes use of a number of dedicated
- tables in a separate <literal>cluster</literal> database on each MySQL
- Server instance acting as an SQL node in both the cluster being
- replicated and the replication slave (whether the slave is a single
- server or a cluster). This database, which is created during the MySQL
- installation process by the <command>mysql_install_db</command> script,
- contains a table for storing the binary log's indexing data. As the
+ tables in a separate <literal>cluster</literal> database on each
+ MySQL Server instance acting as an SQL node in both the cluster
+ being replicated and the replication slave (whether the slave is
+ a single server or a cluster). This database, which is created
+ during the MySQL installation process by the
+ <command>mysql_install_db</command> script, contains a table for
+ storing the binary log's indexing data. As the
<literal>binlog_index</literal> table is local to each MySQL
server and does not participate in clustering, it uses the
<literal>MyISAM</literal> storage engine, and so must be created
@@ -8602,10 +8603,10 @@
PRIMARY KEY (`epoch`)
) ENGINE=MYISAM DEFAULT CHARSET=latin1;
</programlisting>
-
+
<para>
- <emphasis role="bold">Important</emphasis>: Prior to MySQL 5.1.8, the
- <literal>cluster</literal> database was known as the
+ <emphasis role="bold">Important</emphasis>: Prior to MySQL
+ 5.1.8, the <literal>cluster</literal> database was known as the
<literal>cluster_replication</literal> database.
</para>
@@ -8668,10 +8669,10 @@
integrity of these tables as an initial step in preparing a
MySQL Cluster for replication. It is possible to view event data
recorded in the binary log by querying the
- <literal>cluster.binlog_index</literal> table directly on the master.
- This can be also be accomplished using the <literal>SHOW BINLOG
- EVENTS</literal> statement on either the replication master or slave
- MySQL servers.
+ <literal>cluster.binlog_index</literal> table directly on the
+ master. This can be also be accomplished using the <literal>SHOW
+ BINLOG EVENTS</literal> statement on either the replication
+ master or slave MySQL servers.
</para>
</section>
@@ -9513,8 +9514,8 @@
in the previous step, you can obtain the correct starting
position <literal>@pos</literal> in the correct binary
logfile <literal>@file</literal> from the master's
- <literal>cluster.binlog_index</literal> table using the query shown
- here:
+ <literal>cluster.binlog_index</literal> table using the
+ query shown here:
</para>
<programlisting>
@@ -9966,76 +9967,80 @@
</section>
</section>
-
+
<section id="mysql-cluster-disk-data">
- <title>&title-mysql-cluster-disk-data;</title>
-
- <remark role="note">
- Author: Jon Stephens, based on information supplied by Mikael
- Ronström and Stewart Smith. Additional assistance provided by Jeb
- Miller.
- </remark>
-
- <para>
- MySQL 5.1.6 introduces the ability to store non-indexed
- <literal>NDB</literal> table data on disk, rather than in RAM as with
- previous versions of MySQL Cluster.
- </para>
-
- <para>
- Assuming that you have already set up a MySQL
- Cluster with all nodes (including management and SQL nodes) running
- MySQL 5.1.6 or newer, the basic steps for creating a Cluster table
- on disk are as follows:
- </para>
-
- <orderedlist>
- <listitem>
- <para>
- Create a <firstterm>logfile group</firstterm>, and assign one or
- more <literal>UNDO</literal> logfiles to it.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Create a <firstterm>tablespace</firstterm>, and assign the
- logfile group to it, as well as one or more datafiles.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Create a Disk Data table that uses this tablespace for data
- storage.
- </para>
- </listitem>
- </orderedlist>
-
- <para>
- Each of these tasks can be accomplished using SQL statements, as
- shown in the following example.
- </para>
-
- <orderedlist>
- <listitem>
- <para>
- We create a logfile group named <literal>lg_1</literal> using
- <literal>CREATE LOGFILE GROUP</literal>. This logfile group is
- to be made up of two <literal>UNDO</literal> logfiles, which we
- name <filename>undo_1.dat</filename> and
- <filename>undo_2.dat</filename>, whose initial sizes are 16 MB
- and 12 MB, respectively. (You must specify a logfile's initial
- size when adding it to a logfile group.) Optionally, you can
- also specify a size for the logfile group's
- <literal>UNDO</literal> buffer, or allow it to assume the
- default value of 8 MB. In this example, we set the UNDO buffer's
- size at 2 MB. A logfile group must be created with an
- <literal>UNDO</literal> logfile; so we add
- <filename>undo_1.dat</filename> to <literal>lg_1</literal> in
- this <literal>CREATE LOGFILE GROUP</literal> statement:
- </para>
-
+
+ <title>&title-mysql-cluster-disk-data;</title>
+
+ <remark role="note">
+ Author: Jon Stephens, based on information supplied by Mikael
+ Ronström and Stewart Smith. Additional assistance provided by Jeb
+ Miller.
+ </remark>
+
+ <para>
+ MySQL 5.1.6 introduces the ability to store non-indexed
+ <literal>NDB</literal> table data on disk, rather than in RAM as
+ with previous versions of MySQL Cluster.
+ </para>
+
+ <para>
+ Assuming that you have already set up a MySQL Cluster with all
+ nodes (including management and SQL nodes) running MySQL 5.1.6 or
+ newer, the basic steps for creating a Cluster table on disk are as
+ follows:
+ </para>
+
+ <orderedlist>
+
+ <listitem>
+ <para>
+ Create a <firstterm>logfile group</firstterm>, and assign one
+ or more <literal>UNDO</literal> logfiles to it.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Create a <firstterm>tablespace</firstterm>, and assign the
+ logfile group to it, as well as one or more datafiles.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Create a Disk Data table that uses this tablespace for data
+ storage.
+ </para>
+ </listitem>
+
+ </orderedlist>
+
+ <para>
+ Each of these tasks can be accomplished using SQL statements, as
+ shown in the following example.
+ </para>
+
+ <orderedlist>
+
+ <listitem>
+ <para>
+ We create a logfile group named <literal>lg_1</literal> using
+ <literal>CREATE LOGFILE GROUP</literal>. This logfile group is
+ to be made up of two <literal>UNDO</literal> logfiles, which
+ we name <filename>undo_1.dat</filename> and
+ <filename>undo_2.dat</filename>, whose initial sizes are 16 MB
+ and 12 MB, respectively. (You must specify a logfile's initial
+ size when adding it to a logfile group.) Optionally, you can
+ also specify a size for the logfile group's
+ <literal>UNDO</literal> buffer, or allow it to assume the
+ default value of 8 MB. In this example, we set the UNDO
+ buffer's size at 2 MB. A logfile group must be created with an
+ <literal>UNDO</literal> logfile; so we add
+ <filename>undo_1.dat</filename> to <literal>lg_1</literal> in
+ this <literal>CREATE LOGFILE GROUP</literal> statement:
+ </para>
+
<programlisting>
CREATE LOGFILE GROUP lg_1
ADD UNDOFILE 'undo_1.dat'
@@ -10043,93 +10048,95 @@
UNDO_BUFFER_SIZE 2M
ENGINE NDB;
</programlisting>
-
- <para>
- To add <filename>undo_2.dat</filename> to the logfile group, use
- the following <literal>ALTER LOGFILE GROUP</literal> statement:
- </para>
-
+
+ <para>
+ To add <filename>undo_2.dat</filename> to the logfile group,
+ use the following <literal>ALTER LOGFILE GROUP</literal>
+ statement:
+ </para>
+
<programlisting>
ALTER LOGFILE GROUP lg_1
ADD UNDOFILE 'undo_2.dat'
INITIAL_SIZE 12M
ENGINE NDB;
</programlisting>
-
- <para>
- Some items of note:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- The <filename>.dat</filename> file extension used here is
- not required. We use it merely to make the log and data
- files easily recognisable.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Every <literal>CREATE LOGFILE GROUP</literal> and
- <literal>ALTER LOGFILE GROUP</literal> statement must
- include an <literal>ENGINE</literal> clause. In MySQL 5.1,
- the permitted values for this clause are
- <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
- </para>
- </listitem>
-
- <listitem>
- <para>
- When you add an <literal>UNDO</literal> logfile to a logfile
- group, a file with that name is created in the
- <literal>DataDirectory</literal> of each data node in the
- cluster.
- </para>
- </listitem>
-
- <listitem>
- <para>
- For more information about the <literal>CREATE LOGFILE
+
+ <para>
+ Some items of note:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ The <filename>.dat</filename> file extension used here is
+ not required. We use it merely to make the log and data
+ files easily recognisable.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Every <literal>CREATE LOGFILE GROUP</literal> and
+ <literal>ALTER LOGFILE GROUP</literal> statement must
+ include an <literal>ENGINE</literal> clause. In MySQL 5.1,
+ the permitted values for this clause are
+ <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ When you add an <literal>UNDO</literal> logfile to a
+ logfile group, a file with that name is created in the
+ <literal>DataDirectory</literal> of each data node in the
+ cluster.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ For more information about the <literal>CREATE LOGFILE
GROUP</literal> statement, see
- <xref linkend="create-logfile-group"/>. For more
- information about <literal>ALTER LOGFILE GROUP</literal>,
- see <xref linkend="alter-logfile-group"/>.
- </para>
- </listitem>
- </itemizedlist>
-
- </listitem>
-
- <listitem>
- <para>
- Now we can create a tablespace. A tablespace contains files to
- be used by MySQL Cluster Disk Data tables for storing their
- data. A tablespace is also associated with a particular logfile
- group. When creating a new tablespace, you must specify the
- logfile group which it is to use for <literal>UNDO</literal>
- logging; you must also specify a datafile. You can add more
- datafiles to the tablespace after it the tablespace is created;
- it is also possible to drop datafiles from a tablespace (an
- example of dropping datafiles is provided later in this
- section).
- </para>
-
- <para>
- Assume that we wish to create a tablespace named
- <literal>ts_1</literal> which uses <literal>lg_1</literal> as
- its logfile group. This tablespace is to contain two datafiles
- named <filename>data_1.dat</filename> and
- <filename>data_2.dat</filename>, whose initial sizes are 32 MB
- and 48 MB, respectively. We can do this using two SQL
- statements: <literal>CREATE TABLESPACE</literal>, to create
- <literal>ts_1</literal> with the datafile
- <filename>data_1.dat</filename>, and to associate
- <literal>ts_1</literal> with logfile group
- <literal>lg_1</literal>; and <literal>ALTER
+ <xref linkend="create-logfile-group"/>. For more
+ information about <literal>ALTER LOGFILE GROUP</literal>,
+ see <xref linkend="alter-logfile-group"/>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>
+ Now we can create a tablespace. A tablespace contains files to
+ be used by MySQL Cluster Disk Data tables for storing their
+ data. A tablespace is also associated with a particular
+ logfile group. When creating a new tablespace, you must
+ specify the logfile group which it is to use for
+ <literal>UNDO</literal> logging; you must also specify a
+ datafile. You can add more datafiles to the tablespace after
+ it the tablespace is created; it is also possible to drop
+ datafiles from a tablespace (an example of dropping datafiles
+ is provided later in this section).
+ </para>
+
+ <para>
+ Assume that we wish to create a tablespace named
+ <literal>ts_1</literal> which uses <literal>lg_1</literal> as
+ its logfile group. This tablespace is to contain two datafiles
+ named <filename>data_1.dat</filename> and
+ <filename>data_2.dat</filename>, whose initial sizes are 32 MB
+ and 48 MB, respectively. We can do this using two SQL
+ statements: <literal>CREATE TABLESPACE</literal>, to create
+ <literal>ts_1</literal> with the datafile
+ <filename>data_1.dat</filename>, and to associate
+ <literal>ts_1</literal> with logfile group
+ <literal>lg_1</literal>; and <literal>ALTER
TABLESPACE</literal>, to add the second datafile. We show
- these statements here:
- </para>
+ these statements here:
+ </para>
<programlisting>
CREATE TABLESPACE ts_1
@@ -10143,47 +10150,51 @@
INITIAL_SIZE 48M
ENGINE NDB;
</programlisting>
-
- <para>
- Some items of note:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- As is the case with the filenames used here for
- <literal>UNDO</literal> logfiles, there is no special significance
- for the <filename>.dat</filename> file extension; it is used merely
- for easy recognition.
- </para>
- </listitem>
-
- <listitem>
- <para>
- All <literal>CREATE TABLESPACE</literal> and <literal>ALTER
- TABLESPACE</literal> statements must contain an
- <literal>ENGINE</literal> clause; only tables using the same storage
- engine as the tablespace can be created in the tablespace. In MySQL
- 5.1, the only permitted values for this clause are
- <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- For more information about the <literal>CREATE TABLESPACE</literal>
- and <literal>ALTER TABLESPACE</literal> statements, see
- <xref linkend="create-tablespace"/>, and
- <xref linkend="alter-tablespace"/>.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
-
- <listitem>
- <para>
- Now it is possible to create a table whose non-indexed columns are
- stored on disk in the tablespace <literal>ts_1</literal>:
- </para>
-
+
+ <para>
+ Some items of note:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ As is the case with the filenames used here for
+ <literal>UNDO</literal> logfiles, there is no special
+ significance for the <filename>.dat</filename> file
+ extension; it is used merely for easy recognition.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ All <literal>CREATE TABLESPACE</literal> and
+ <literal>ALTER TABLESPACE</literal> statements must
+ contain an <literal>ENGINE</literal> clause; only tables
+ using the same storage engine as the tablespace can be
+ created in the tablespace. In MySQL 5.1, the only
+ permitted values for this clause are
+ <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ For more information about the <literal>CREATE
+ TABLESPACE</literal> and <literal>ALTER
+ TABLESPACE</literal> statements, see
+ <xref linkend="create-tablespace"/>, and
+ <xref linkend="alter-tablespace"/>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>
+ Now it is possible to create a table whose non-indexed columns
+ are stored on disk in the tablespace <literal>ts_1</literal>:
+ </para>
+
<programlisting>
CREATE TABLE dt_1 (
member_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -10196,131 +10207,140 @@
TABLESPACE ts_1 STORAGE DISK
ENGINE NDB;
</programlisting>
-
- <para>
- The <literal>TABLESPACE ... STORAGE DISK</literal> clause tells the
- <literal>NDB Cluster</literal> storage engine to use tablespace
- <literal>ts_1</literal> for disk data storage.
- </para>
-
- <para>
- Once table <literal>ts_1</literal> has been created as shown, you can
- perform <literal>INSERT</literal>, <literal>SELECT</literal>,
- <literal>UPDATE</literal>, and <literal>DELETE</literal> statements on
- it just as you would with any other MySQL table.
- </para>
-
- <para>
- For table <literal>dt_1</literal> as it has been defined here, only the
- <literal>dob</literal> and <literal>joined</literal> columns are stored
- on disk. This is because there are indexes on the <literal>id</literal>,
- <literal>last_name</literal>, and <literal>first_name</literal> columns,
- and so data belonging to these columns is stored in RAM. In MySQL 5.1,
- only non-indexed columns can be held on disk; indexes and indexed
- column data continue to be stored in memory. This tradeoff between
- the use of indexes and conservation of RAM is something you must keep in
- mind as you design Disk Data tables.
- </para>
- </listitem>
- </orderedlist>
-
- <para>
- A logfile group, a tablespace, and any Disk Data tables using these must be
- created in a particular order. The same is true for dropping any of these
- objects:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- A logfile group cannot be dropped, so long as any tablespaces are using
- it.
- </para>
- </listitem>
-
- <listitem>
- <para>
- A tablespace cannot be dropped, so long as it contains any datafiles.
- </para>
- </listitem>
-
- <listitem>
- <para>
- You cannot drop any datafiles from a tablespace, so long as there remain
- any tables which are using the tablespace.
- </para>
- </listitem>
- </itemizedlist>
-
- <para>
- For example, to drop all the objects created so far in this section, you
- would use the following statements:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
+
+ <para>
+ The <literal>TABLESPACE ... STORAGE DISK</literal> clause
+ tells the <literal>NDB Cluster</literal> storage engine to use
+ tablespace <literal>ts_1</literal> for disk data storage.
+ </para>
+
+ <para>
+ Once table <literal>ts_1</literal> has been created as shown,
+ you can perform <literal>INSERT</literal>,
+ <literal>SELECT</literal>, <literal>UPDATE</literal>, and
+ <literal>DELETE</literal> statements on it just as you would
+ with any other MySQL table.
+ </para>
+
+ <para>
+ For table <literal>dt_1</literal> as it has been defined here,
+ only the <literal>dob</literal> and <literal>joined</literal>
+ columns are stored on disk. This is because there are indexes
+ on the <literal>id</literal>, <literal>last_name</literal>,
+ and <literal>first_name</literal> columns, and so data
+ belonging to these columns is stored in RAM. In MySQL 5.1,
+ only non-indexed columns can be held on disk; indexes and
+ indexed column data continue to be stored in memory. This
+ tradeoff between the use of indexes and conservation of RAM is
+ something you must keep in mind as you design Disk Data
+ tables.
+ </para>
+ </listitem>
+
+ </orderedlist>
+
+ <para>
+ A logfile group, a tablespace, and any Disk Data tables using
+ these must be created in a particular order. The same is true for
+ dropping any of these objects:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A logfile group cannot be dropped, so long as any tablespaces
+ are using it.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ A tablespace cannot be dropped, so long as it contains any
+ datafiles.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ You cannot drop any datafiles from a tablespace, so long as
+ there remain any tables which are using the tablespace.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ For example, to drop all the objects created so far in this
+ section, you would use the following statements:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
<programlisting>
DROP TABLE dt_1;
</programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
<programlisting>
ALTER TABLESPACE ts_1
DROP DATAFILE 'data_2.dat'
ENGINE NDB;
</programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
<programlisting>
ALTER TABLESPACE ts_1
DROP DATAFILE 'data_1.dat'
ENGINE NDB;
</programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
<programlisting>
DROP TABLESPACE ts_1
ENGINE NDB;
</programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
<programlisting>
DROP LOGFILE GROUP lg_1
ENGINE NDB;
</programlisting>
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- These statements must be performed in the order shown, except
- that the two <literal>ALTER TABLESPACE ... DROP DATAFILE</literal>
- statements may be executed in either order.
- </para>
-
- <para>
- You can obtain information about <literal>UNDO</literal> logfiles and data
- files used by Disk Data tables by querying the <literal>FILES</literal>
- table in the <literal>INFORMATION_SCHEMA</literal> database. For more
- information, see <xref linkend="files-table"/>.
- </para>
-
-</section>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ These statements must be performed in the order shown, except that
+ the two <literal>ALTER TABLESPACE ... DROP DATAFILE</literal>
+ statements may be executed in either order.
+ </para>
+
+ <para>
+ You can obtain information about <literal>UNDO</literal> logfiles
+ and data files used by Disk Data tables by querying the
+ <literal>FILES</literal> table in the
+ <literal>INFORMATION_SCHEMA</literal> database. For more
+ information, see <xref linkend="files-table"/>.
+ </para>
+
+ </section>
+
<section id="mysql-cluster-interconnects">
<title>&title-mysql-cluster-interconnects;</title>
@@ -11111,7 +11131,7 @@
However, spatial indexes are not supported.
</para>
</listitem>
-
+
<listitem>
<para>
<literal>INSERT IGNORE</literal> is supported only for
@@ -12087,7 +12107,7 @@
<emphasis>How much RAM do I need? Is it possible to use disk
memory at all?</emphasis>
</para>
-
+
<remark role="todo">
[js] Reword the following para when the Disk Data section is
ready.
@@ -12101,7 +12121,7 @@
addition to the memory required by the operating system and
any applications running on the cluster computers.
</para>
-
+
<para>
If a data node's memory usage exceeds what is available in
RAM, then the system will attempt to use swap space up to the
@@ -12112,20 +12132,21 @@
a production environment for this reason. In any case, once
the <literal>DataMemory</literal> limit is reached, any
operations requiring additional memory (such as inserts) will
- fail.
+ fail.
</para>
-
+
<remark role="todo">
[js] Reword the following para and uncomment the xref when the
Disk Data section is ready.
</remark>
-
+
<para>
- We are implementing disk data storage for clusters in MySQL
+ We are implementing disk data storage for clusters in MySQL
¤t-series;, which will help to alleviate these issues,
and documentation showing how to use this capability will be
- available in the near future.
- <!-- See <xref linkend="mysql-cluster-disk-data"/>. -->
+ available in the near future.
+
+<!-- See <xref linkend="mysql-cluster-disk-data"/>. -->
</para>
<para>
Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml 2006-03-08 04:45:45 UTC (rev 1525)
+++ trunk/refman-5.1/sql-syntax.xml 2006-03-08 04:50:11 UTC (rev 1526)
@@ -1123,68 +1123,69 @@
</para>
</section>
-
+
<section id="alter-logfile-group">
- <title>&title-alter-logfile-group;</title>
-
+
+ <title>&title-alter-logfile-group;</title>
+
<programlisting>
ALTER LOGFILE GROUP <replaceable>logfile_group</replaceable>
ADD UNDOFILE '<replaceable>file</replaceable>'
INITIAL_SIZE [=] <replaceable>size</replaceable>
ENGINE [=] <replaceable>engine</replaceable>
</programlisting>
-
- <para>
- This statement adds an <literal>UNDO</literal> file named
- '<replaceable>file</replaceable>' to an existing logfile group
- <replaceable>logfile_group</replaceable>. An <literal>ALTER LOGFILE
- GROUP</literal> statement has one and only one <literal>ADD
- UNDOFILE</literal> clause. No <literal>DROP UNDOFILE</literal>
- clause is supported.
- </para>
-
- <para>
- The <literal>INITIAL_SIZE</literal> parameter sets the
- <literal>UNDO</literal> file's initial size in bytes. You may
- optionally follow <replaceable>size</replaceable> with a one-letter
- abbreviation for an order of magnitude, similar to those used in
- <filename>my.cnf</filename>. Generally, this is one of the letters
- <literal>M</literal> (for megabytes) or <literal>G</literal> (for
- gigabytes).
- </para>
-
- <para>
- The <literal>ENGINE</literal> parameter (required) determines the
- storage engine which is used by this logfile group, with
- <replaceable>engine</replaceable> being the name of the storage
- engine. In MySQL 5.1, the only accepted values for
- <replaceable>engine</replaceable> are <literal>NDB</literal> and
- <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- Here is an example, which assumes that the logfile group
- <literal>lg_3</literal> has already been created using
- <literal>CREATE LOGFILE GROUP</literal> (see
- <xref linkend="create-logfile-group"/>):
- </para>
-
+
+ <para>
+ This statement adds an <literal>UNDO</literal> file named
+ '<replaceable>file</replaceable>' to an existing logfile group
+ <replaceable>logfile_group</replaceable>. An <literal>ALTER
+ LOGFILE GROUP</literal> statement has one and only one
+ <literal>ADD UNDOFILE</literal> clause. No <literal>DROP
+ UNDOFILE</literal> clause is supported.
+ </para>
+
+ <para>
+ The <literal>INITIAL_SIZE</literal> parameter sets the
+ <literal>UNDO</literal> file's initial size in bytes. You may
+ optionally follow <replaceable>size</replaceable> with a
+ one-letter abbreviation for an order of magnitude, similar to
+ those used in <filename>my.cnf</filename>. Generally, this is
+ one of the letters <literal>M</literal> (for megabytes) or
+ <literal>G</literal> (for gigabytes).
+ </para>
+
+ <para>
+ The <literal>ENGINE</literal> parameter (required) determines
+ the storage engine which is used by this logfile group, with
+ <replaceable>engine</replaceable> being the name of the storage
+ engine. In MySQL 5.1, the only accepted values for
+ <replaceable>engine</replaceable> are <literal>NDB</literal> and
+ <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ Here is an example, which assumes that the logfile group
+ <literal>lg_3</literal> has already been created using
+ <literal>CREATE LOGFILE GROUP</literal> (see
+ <xref linkend="create-logfile-group"/>):
+ </para>
+
<programlisting>
ALTER LOGFILE GROUP lg_3
ADD UNDOFILE 'undo_10.dat'
INITIAL_SIZE=32M
ENGINE=NDB;
</programlisting>
-
- <para>
- When <literal>ALTER LOGFILE GROUP</literal> is used with
- <literal>ENGINE = NDB</literal>, an <literal>UNDO</literal> logfile
- is created on each Cluster data node. You can verify that the
- <literal>UNDO</literal> files were created and obtain information
- about them by querying the
- <literal>INFORMATION_SCHEMA.FILES</literal> table. For example:
- </para>
-
+
+ <para>
+ When <literal>ALTER LOGFILE GROUP</literal> is used with
+ <literal>ENGINE = NDB</literal>, an <literal>UNDO</literal>
+ logfile is created on each Cluster data node. You can verify
+ that the <literal>UNDO</literal> files were created and obtain
+ information about them by querying the
+ <literal>INFORMATION_SCHEMA.FILES</literal> table. For example:
+ </para>
+
<programlisting>
mysql> <userinput>SELECT FILE_NAME, LOGFILE_GROUP_NUMBER, EXTRA</userinput>
-> <userinput>FROM INFORMATION_SCHEMA.FILES</userinput>
@@ -1199,21 +1200,23 @@
+-------------+----------------------+----------------+
4 rows in set (0.01 sec)
</programlisting>
-
- <para>
- (See <xref linkend="files-table"/>.)
- </para>
-
- <para>
- <literal>ALTER LOGFILE GROUP</literal> was added in MySQL 5.1.6. In
- MySQL 5.1, it is useful only with Disk Data storage for MySQL
- Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
- </para>
+
+ <para>
+ (See <xref linkend="files-table"/>.)
+ </para>
+
+ <para>
+ <literal>ALTER LOGFILE GROUP</literal> was added in MySQL 5.1.6.
+ In MySQL 5.1, it is useful only with Disk Data storage for MySQL
+ Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
+ </para>
+
</section>
-
+
<section id="alter-tablespace">
- <title>&title-alter-tablespace;</title>
+ <title>&title-alter-tablespace;</title>
+
<programlisting>
ALTER TABLESPACE <replaceable>tablespace</replaceable>
ADD DATAFILE '<replaceable>file</replaceable>'
@@ -1224,58 +1227,58 @@
DROP DATAFILE '<replaceable>file</replaceable>'
ENGINE [=] <replaceable>engine</replaceable>
</programlisting>
-
- <para>
- This statement can be used either to add a new datafile, or to drop
- a datafile from a tablespace.
- </para>
-
- <para>
- The <literal>ADD DATAFILE</literal> variant requires that you
- specify an initial size using an <literal>INITIAL_SIZE</literal>
- clause, where <replaceable>size</replaceable> is measured in bytes.
- You may optionally follow an integer value with a one-letter
- abbreviation for an order of magnitude, similar to those used in
- <filename>my.cnf</filename>. Generally, this is one of the letters
- <literal>M</literal> (for megabytes) or <literal>G</literal> (for
- gigabytes).
- </para>
-
- <para>
- Once a datafile has been created, its size cannot
- be changed; however, you can add more datafiles to the tablespace
- using additional <literal>ALTER TABLESPACE ... ADD
- DATAFILE</literal> statements.
- </para>
-
- <para>
- Using <literal>DROP DATAFILE</literal> with <literal>ALTER
- TABLESPACE</literal> drops a datafile
- '<replaceable>file</replaceable>' from the tablespace. This file
- must already have been added to the tablespace using <literal>CREATE
- TABLESPACE</literal> or <literal>ALTER TABLESPACE</literal>;
- otherwise an error will result.
- </para>
-
- <para>
- Both <literal>ALTER TABLESPACE ... ADD DATAFILE</literal> and
- <literal>ALTER TABLESPACE ... DROP DATAFILE</literal> require an
- <literal>ENGINE</literal> clause which specifies the storage engine
- used by the tablespace. In MySQL 5.1, the only accepted values for
- <replaceable>engine</replaceable> are <literal>NDB</literal> and
- <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- When <literal>ALTER TABLESPACE ... ADD DATAFILE</literal> is used
- with <literal>ENGINE = NDB</literal>, a datafile is created on each
- Cluster data node. You can verify that the datafiles were created
- and obtain information about them by querying the
- <literal>INFORMATION_SCHEMA.FILES</literal> table. For example, the
- following query shows all datafiles belonging to the tablespace
- named <literal>newts</literal>:
- </para>
-
+
+ <para>
+ This statement can be used either to add a new datafile, or to
+ drop a datafile from a tablespace.
+ </para>
+
+ <para>
+ The <literal>ADD DATAFILE</literal> variant requires that you
+ specify an initial size using an <literal>INITIAL_SIZE</literal>
+ clause, where <replaceable>size</replaceable> is measured in
+ bytes. You may optionally follow an integer value with a
+ one-letter abbreviation for an order of magnitude, similar to
+ those used in <filename>my.cnf</filename>. Generally, this is
+ one of the letters <literal>M</literal> (for megabytes) or
+ <literal>G</literal> (for gigabytes).
+ </para>
+
+ <para>
+ Once a datafile has been created, its size cannot be changed;
+ however, you can add more datafiles to the tablespace using
+ additional <literal>ALTER TABLESPACE ... ADD DATAFILE</literal>
+ statements.
+ </para>
+
+ <para>
+ Using <literal>DROP DATAFILE</literal> with <literal>ALTER
+ TABLESPACE</literal> drops a datafile
+ '<replaceable>file</replaceable>' from the tablespace. This file
+ must already have been added to the tablespace using
+ <literal>CREATE TABLESPACE</literal> or <literal>ALTER
+ TABLESPACE</literal>; otherwise an error will result.
+ </para>
+
+ <para>
+ Both <literal>ALTER TABLESPACE ... ADD DATAFILE</literal> and
+ <literal>ALTER TABLESPACE ... DROP DATAFILE</literal> require an
+ <literal>ENGINE</literal> clause which specifies the storage
+ engine used by the tablespace. In MySQL 5.1, the only accepted
+ values for <replaceable>engine</replaceable> are
+ <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ When <literal>ALTER TABLESPACE ... ADD DATAFILE</literal> is
+ used with <literal>ENGINE = NDB</literal>, a datafile is created
+ on each Cluster data node. You can verify that the datafiles
+ were created and obtain information about them by querying the
+ <literal>INFORMATION_SCHEMA.FILES</literal> table. For example,
+ the following query shows all datafiles belonging to the
+ tablespace named <literal>newts</literal>:
+ </para>
+
<programlisting>
mysql> <userinput>SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA</userinput>
-> <userinput>FROM INFORMATION_SCHEMA.FILES</userinput>
@@ -1290,18 +1293,19 @@
+--------------------+--------------+----------------+
2 rows in set (0.03 sec)
</programlisting>
-
- <para>
- See <xref linkend="files-table"/>.
- </para>
-
- <para>
- <literal>ALTER TABLESPACE</literal> was added in MySQL 5.1.6. In
- MySQL 5.1, it is useful only with Disk Data storage for MySQL
- Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
- </para>
-</section>
+ <para>
+ See <xref linkend="files-table"/>.
+ </para>
+
+ <para>
+ <literal>ALTER TABLESPACE</literal> was added in MySQL 5.1.6. In
+ MySQL 5.1, it is useful only with Disk Data storage for MySQL
+ Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
+ </para>
+
+ </section>
+
<section id="create-database">
<title>&title-create-database;</title>
@@ -2426,15 +2430,15 @@
</listitem>
</itemizedlist>
-
+
<para>
The <literal>TABLESPACE ... STORAGE DISK</literal> table option
is used only with <literal>NDB Cluster</literal> tables. It
assigns the table to a Cluster Disk Data tablespace. The
tablespace named <replaceable>tablespace_name</replaceable> must
already have been created using <literal>CREATE
- TABLESPACE</literal>. This table option was introduced in
- MySQL 5.1.6. See <xref linkend="mysql-cluster-disk-data"/>.
+ TABLESPACE</literal>. This table option was introduced in MySQL
+ 5.1.6. See <xref linkend="mysql-cluster-disk-data"/>.
</para>
<para>
@@ -2538,11 +2542,11 @@
¤t-series;, a warning occurs if the storage engine
specification is not honored.
</para>
-
+
<para>
<emphasis role="bold">Note</emphasis>: The older
- <literal>TYPE</literal> option was synomous with
- <literal>ENGINE</literal>. <literal>TYPE</literal> has been
+ <literal>TYPE</literal> option was synomous with
+ <literal>ENGINE</literal>. <literal>TYPE</literal> has been
deprecated since MySQL 4.0 but is still supported for backwards
compatibility in MySQL 5.1 (excepting MySQL 5.1.7). Since MySQL
5.1.8, it produces a warning. It is scheduled for removal in
@@ -3558,10 +3562,11 @@
</para>
</section>
-
+
<section id="create-logfile-group">
- <title>&title-create-logfile-group;</title>
-
+
+ <title>&title-create-logfile-group;</title>
+
<programlisting>
CREATE LOGFILE GROUP <replaceable>logfile_group</replaceable>
ADD UNDOFILE '<replaceable>undo_file</replaceable>'
@@ -3569,48 +3574,49 @@
[UNDO_BUFFER_SIZE [=] <replaceable>undo_buffer_size</replaceable>]
ENGINE [=] <replaceable>engine_name</replaceable>
</programlisting>
-
- <para>
- This statement creates a new logfile group named
- <replaceable>logfile_group</replaceable> having a single
- <literal>UNDO</literal> file named
- '<replaceable>undo_file</replaceable>'. A <literal>CREATE LOGFILE
- GROUP</literal> statement has one and only one <literal>ADD
- UNDOFILE</literal> clause.
- </para>
-
- <para>
- The <literal>INITIAL_SIZE</literal> parameter sets the
- <literal>UNDO</literal> file's initial size. The optional
- <literal>UNDO_BUFFFER_SIZE</literal> parameter sets the size used by the
- <literal>UNDO</literal> buffer for the logfile group; the default is
- <literal>8M</literal> (eight megabytes). Both
- <replaceable>initial_size</replaceable> and
- <replaceable>undo_buffer_size_size</replaceable> are specified in
- bytes. You may optionally follow either or both of these with a
- one-letter abbreviation for an order of magnitude, similar to those
- used in <filename>my.cnf</filename>. Generally, this is one of the
- letters <literal>M</literal> (for megabytes) or <literal>G</literal>
- (for gigabytes).
- </para>
-
- <para>
- The <literal>ENGINE</literal> parameter determines the storage
- engine to be used by this logfile group, with
- <replaceable>engine</replaceable> being the name of the storage
- engine. In MySQL 5.1. <replaceable>engine</replaceable> must be one
- of the values <literal>NDB</literal> or
- <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- When used with <literal>ENGINE = NDB</literal>, a logfile group and
- associated <literal>UNDO</literal> logfile are created on each
- Cluster data node. You can verify that the <literal>UNDO</literal>
- files were created and obtain information about them by querying the
- <literal>INFORMATION_SCHEMA.FILES</literal> table. For example:
- </para>
-
+
+ <para>
+ This statement creates a new logfile group named
+ <replaceable>logfile_group</replaceable> having a single
+ <literal>UNDO</literal> file named
+ '<replaceable>undo_file</replaceable>'. A <literal>CREATE
+ LOGFILE GROUP</literal> statement has one and only one
+ <literal>ADD UNDOFILE</literal> clause.
+ </para>
+
+ <para>
+ The <literal>INITIAL_SIZE</literal> parameter sets the
+ <literal>UNDO</literal> file's initial size. The optional
+ <literal>UNDO_BUFFFER_SIZE</literal> parameter sets the size
+ used by the <literal>UNDO</literal> buffer for the logfile
+ group; the default is <literal>8M</literal> (eight megabytes).
+ Both <replaceable>initial_size</replaceable> and
+ <replaceable>undo_buffer_size_size</replaceable> are specified
+ in bytes. You may optionally follow either or both of these with
+ a one-letter abbreviation for an order of magnitude, similar to
+ those used in <filename>my.cnf</filename>. Generally, this is
+ one of the letters <literal>M</literal> (for megabytes) or
+ <literal>G</literal> (for gigabytes).
+ </para>
+
+ <para>
+ The <literal>ENGINE</literal> parameter determines the storage
+ engine to be used by this logfile group, with
+ <replaceable>engine</replaceable> being the name of the storage
+ engine. In MySQL 5.1. <replaceable>engine</replaceable> must be
+ one of the values <literal>NDB</literal> or
+ <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ When used with <literal>ENGINE = NDB</literal>, a logfile group
+ and associated <literal>UNDO</literal> logfile are created on
+ each Cluster data node. You can verify that the
+ <literal>UNDO</literal> files were created and obtain
+ information about them by querying the
+ <literal>INFORMATION_SCHEMA.FILES</literal> table. For example:
+ </para>
+
<programlisting>
mysql> <userinput>SELECT LOGFILE_GROUP_NAME, LOGFILE_GROUP_NUMBER, EXTRA</userinput>
-> <userinput>FROM INFORMATION_SCHEMA.FILES</userinput>
@@ -3623,21 +3629,24 @@
+--------------------+----------------------+----------------+
2 rows in set (0.06 sec)
</programlisting>
-
- <para>
- (See <xref linkend="files-table"/>.)
- </para>
-
- <para>
- <literal>CREATE LOGFILE GROUP</literal> was added in MySQL 5.1.6. In
- MySQL 5.1, it is useful only with Disk Data storage for MySQL
- Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
- </para>
-</section>
-
+
+ <para>
+ (See <xref linkend="files-table"/>.)
+ </para>
+
+ <para>
+ <literal>CREATE LOGFILE GROUP</literal> was added in MySQL
+ 5.1.6. In MySQL 5.1, it is useful only with Disk Data storage
+ for MySQL Cluster. See
+ <xref linkend="mysql-cluster-disk-data"/>.
+ </para>
+
+ </section>
+
<section id="create-tablespace">
- <title>&title-create-tablespace;</title>
-
+
+ <title>&title-create-tablespace;</title>
+
<programlisting>
CREATE TABLESPACE <replaceable>tablespace</replaceable>
ADD DATAFILE '<replaceable>file</replaceable>'
@@ -3646,77 +3655,80 @@
INITIAL_SIZE [=] <replaceable>initial_size</replaceable>
ENGINE [=] <replaceable>engine</replaceable>
</programlisting>
-
- <para>
- This statement is used to create a tablespace, which can contain one
- or more datafiles, providing storage space for tables. One datafile
- is created and added to the tablespace using this statement.
- Additional datafiles may be added to the tablespace by using the
- <literal>ALTER TABLESPACE</literal> statement (see
- <xref linkend="alter-tablespace"/>).
- </para>
-
- <para>
- A logfile group of one or more <literal>UNDO</literal> log files
- must be assigned to the tablespace to be created with the
- <literal>USE LOGFILE GROUP</literal> clause.
- <replaceable>logfile_group</replaceable> must be an existing logfile
- group created with <literal>CREATE LOGFILE GROUP</literal> (see
- <xref linkend="create-logfile-group"/>). Multiple tablespaces may
- use the same logfile group for <literal>UNDO</literal> logging.
- </para>
-
- <para>
- The <literal>EXTENT_SIZE</literal> sets the size, in bytes, of the extents
- used by any files belonging to the tablespace. The default value is
- 4 bytes.
- </para>
-
- <para>
- An <firstterm>extent</firstterm> is a unit of disk space allocation.
- One extent is filled with as much data as that extent can contain
- before another extent is used. You can see how many extents for a
- given file remain free by querying the
- <literal>INFORMATION_SCHEMA.FILES</literal> table, and so derive an
- estimate for how much space remains free in the file. For further
- discussion and examples, see <xref linkend="files-table"/>.
- </para>
-
- <para>
- The <literal>INITIAL_SIZE</literal> parameter sets the datafile's
- total size in bytes. Once the file has been created, its size cannot
- be changed; however, you can add more datafiles to the tablespace
- using <literal>ALTER TABLESPACE ... ADD DATAFILE</literal>. See
- <xref linkend="alter-tablespace"/>.
- </para>
-
- <para>
- When setting <literal>EXTENT_SIZE</literal> or
- <literal>INITIAL_SIZE</literal> (either or both), you may optionally follow
- the number with a one-letter abbreviation for an order of magnitude, similar
- to those used in <filename>my.cnf</filename>. Generally, this is one of the
- letters <literal>M</literal> (for megabytes) or <literal>G</literal> (for
- gigabytes).
- </para>
-
- <para>
- The <literal>ENGINE</literal> parameter determines the storage
- engine which uses this tablespace, with
- <replaceable>engine</replaceable> being the name of the storage
- engine. In MySQL 5.1, <replaceable>engine</replaceable> must be one
- of the values <literal>NDB</literal> or
- <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- When <literal>CREATE TABLESPACE</literal> is used with
- <literal>ENGINE = NDB</literal>, a tablespace and associated
- datafile are created on each Cluster data node. You can verify that
- the datafiles were created and obtain information about them by
- querying the <literal>INFORMATION_SCHEMA.FILES</literal> table. For
- example:
- </para>
-
+
+ <para>
+ This statement is used to create a tablespace, which can contain
+ one or more datafiles, providing storage space for tables. One
+ datafile is created and added to the tablespace using this
+ statement. Additional datafiles may be added to the tablespace
+ by using the <literal>ALTER TABLESPACE</literal> statement (see
+ <xref linkend="alter-tablespace"/>).
+ </para>
+
+ <para>
+ A logfile group of one or more <literal>UNDO</literal> log files
+ must be assigned to the tablespace to be created with the
+ <literal>USE LOGFILE GROUP</literal> clause.
+ <replaceable>logfile_group</replaceable> must be an existing
+ logfile group created with <literal>CREATE LOGFILE
+ GROUP</literal> (see <xref linkend="create-logfile-group"/>).
+ Multiple tablespaces may use the same logfile group for
+ <literal>UNDO</literal> logging.
+ </para>
+
+ <para>
+ The <literal>EXTENT_SIZE</literal> sets the size, in bytes, of
+ the extents used by any files belonging to the tablespace. The
+ default value is 4 bytes.
+ </para>
+
+ <para>
+ An <firstterm>extent</firstterm> is a unit of disk space
+ allocation. One extent is filled with as much data as that
+ extent can contain before another extent is used. You can see
+ how many extents for a given file remain free by querying the
+ <literal>INFORMATION_SCHEMA.FILES</literal> table, and so derive
+ an estimate for how much space remains free in the file. For
+ further discussion and examples, see
+ <xref linkend="files-table"/>.
+ </para>
+
+ <para>
+ The <literal>INITIAL_SIZE</literal> parameter sets the
+ datafile's total size in bytes. Once the file has been created,
+ its size cannot be changed; however, you can add more datafiles
+ to the tablespace using <literal>ALTER TABLESPACE ... ADD
+ DATAFILE</literal>. See <xref linkend="alter-tablespace"/>.
+ </para>
+
+ <para>
+ When setting <literal>EXTENT_SIZE</literal> or
+ <literal>INITIAL_SIZE</literal> (either or both), you may
+ optionally follow the number with a one-letter abbreviation for
+ an order of magnitude, similar to those used in
+ <filename>my.cnf</filename>. Generally, this is one of the
+ letters <literal>M</literal> (for megabytes) or
+ <literal>G</literal> (for gigabytes).
+ </para>
+
+ <para>
+ The <literal>ENGINE</literal> parameter determines the storage
+ engine which uses this tablespace, with
+ <replaceable>engine</replaceable> being the name of the storage
+ engine. In MySQL 5.1, <replaceable>engine</replaceable> must be
+ one of the values <literal>NDB</literal> or
+ <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ When <literal>CREATE TABLESPACE</literal> is used with
+ <literal>ENGINE = NDB</literal>, a tablespace and associated
+ datafile are created on each Cluster data node. You can verify
+ that the datafiles were created and obtain information about
+ them by querying the <literal>INFORMATION_SCHEMA.FILES</literal>
+ table. For example:
+ </para>
+
<programlisting>
mysql> <userinput>SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA</userinput>
-> <userinput>FROM INFORMATION_SCHEMA.FILES</userinput>
@@ -3729,18 +3741,19 @@
+--------------------+-------------+----------------+
2 rows in set (0.01 sec)
</programlisting>
-
- <para>
- (See <xref linkend="files-table"/>.)
- </para>
-
- <para>
- <literal>CREATE TABLESPACE</literal> was added in MySQL 5.1.6. In
- MySQL 5.1, it is useful only with Disk Data storage for MySQL
- Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
- </para>
-</section>
+ <para>
+ (See <xref linkend="files-table"/>.)
+ </para>
+
+ <para>
+ <literal>CREATE TABLESPACE</literal> was added in MySQL 5.1.6.
+ In MySQL 5.1, it is useful only with Disk Data storage for MySQL
+ Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
+ </para>
+
+ </section>
+
<section id="drop-database">
<title>&title-drop-database;</title>
@@ -4035,79 +4048,84 @@
</para>
</section>
-
+
<section id="drop-logfile-group">
- <title>&title-drop-logfile-group;</title>
+ <title>&title-drop-logfile-group;</title>
+
<programlisting>
DROP LOGFILE GROUP <replaceable>logfile_group</replaceable>
ENGINE [=] <replaceable>engine</replaceable>
</programlisting>
- <para>
- This statement drops the logfile group named
- <replaceable>logfile_group</replaceable>. The logfile group must
- already exist or a syntax error results. (For information on
- creating logfile groups, see
- <xref linkend="create-logfile-group"/>.)
- </para>
-
- <para>
- <emphasis role="bold">Important</emphasis>: Before dropping a
- logfile group, you must drop all tablespaces that use that logfile
- group for <literal>UNDO</literal> logging.
- </para>
-
- <para>
- The <literal>ENGINE</literal> clause (required) provides the name of
- the storage engine used by the logfile group to be dropped. In MySQL
- 5.1, the only accepted values for <replaceable>engine</replaceable>
- are <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- <literal>DROP LOGFILE GROUP</literal> was added in MySQL 5.1.6. In
- MySQL 5.1, it is useful only with Disk Data storage for MySQL
- Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
- </para>
+ <para>
+ This statement drops the logfile group named
+ <replaceable>logfile_group</replaceable>. The logfile group must
+ already exist or a syntax error results. (For information on
+ creating logfile groups, see
+ <xref linkend="create-logfile-group"/>.)
+ </para>
+
+ <para>
+ <emphasis role="bold">Important</emphasis>: Before dropping a
+ logfile group, you must drop all tablespaces that use that
+ logfile group for <literal>UNDO</literal> logging.
+ </para>
+
+ <para>
+ The <literal>ENGINE</literal> clause (required) provides the
+ name of the storage engine used by the logfile group to be
+ dropped. In MySQL 5.1, the only accepted values for
+ <replaceable>engine</replaceable> are <literal>NDB</literal> and
+ <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ <literal>DROP LOGFILE GROUP</literal> was added in MySQL 5.1.6.
+ In MySQL 5.1, it is useful only with Disk Data storage for MySQL
+ Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
+ </para>
+
</section>
-
+
<section id="drop-tablespace">
- <title>&title-drop-tablespace;</title>
-
+
+ <title>&title-drop-tablespace;</title>
+
<programlisting>
DROP TABLESPACE <replaceable>tablespace</replaceable>
ENGINE [=] <replaceable>engine</replaceable>
</programlisting>
-
- <para>
- This statement drops a tablespace that was previously created using
- <literal>CREATE TABLESPACE</literal> (see
- <xref linkend="create-tablespace"/>).
- </para>
-
- <para>
- <emphasis role="bold">Important</emphasis>: The tablespace to be
- dropped must not contain any datafiles; in other words, before you
- can drop a tablespace, you must first drop each of its datafiles
- using <literal>ALTER TABLESPACE ... DROP DATAFILE</literal> (see
- <xref linkend="alter-tablespace"/>).
- </para>
-
- <para>
- The <literal>ENGINE</literal> clause (required) specifies the
- storage engine used by the tablespace. In MySQL 5.1, the only
- accepted values for <replaceable>engine</replaceable> are
- <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
- </para>
-
- <para>
- <literal>DROP TABLESPACE</literal> was added in MySQL 5.1.6. In
- MySQL 5.1, it is useful only with Disk Data storage for MySQL
- Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
- </para>
-</section>
+ <para>
+ This statement drops a tablespace that was previously created
+ using <literal>CREATE TABLESPACE</literal> (see
+ <xref linkend="create-tablespace"/>).
+ </para>
+
+ <para>
+ <emphasis role="bold">Important</emphasis>: The tablespace to be
+ dropped must not contain any datafiles; in other words, before
+ you can drop a tablespace, you must first drop each of its
+ datafiles using <literal>ALTER TABLESPACE ... DROP
+ DATAFILE</literal> (see <xref linkend="alter-tablespace"/>).
+ </para>
+
+ <para>
+ The <literal>ENGINE</literal> clause (required) specifies the
+ storage engine used by the tablespace. In MySQL 5.1, the only
+ accepted values for <replaceable>engine</replaceable> are
+ <literal>NDB</literal> and <literal>NDBCLUSTER</literal>.
+ </para>
+
+ <para>
+ <literal>DROP TABLESPACE</literal> was added in MySQL 5.1.6. In
+ MySQL 5.1, it is useful only with Disk Data storage for MySQL
+ Cluster. See <xref linkend="mysql-cluster-disk-data"/>.
+ </para>
+
+ </section>
+
<section id="rename-database">
<title>&title-rename-database;</title>
@@ -4146,7 +4164,7 @@
such as stored routines and events. Finally, the server drops
the old database.
</para>
-
+
<para>
<emphasis role="bold">Note that currently there are these
limitations:</emphasis>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1526 - trunk/refman-5.1 | jon | 8 Mar |