Author: jstephens
Date: 2006-08-23 18:10:45 +0200 (Wed, 23 Aug 2006)
New Revision: 3089
Log:
Working file for NDB utilities documentation.
Added:
trunk/refman-5.1/ndb-utilities.xml
Added: trunk/refman-5.1/ndb-utilities.xml
===================================================================
--- trunk/refman-5.1/ndb-utilities.xml (rev 0)
+++ trunk/refman-5.1/ndb-utilities.xml 2006-08-23 16:10:45 UTC (rev 3089)
Changed blocks: 1, Lines Added: 654, Lines Deleted: 0; 16565 bytes
@@ -0,0 +1,654 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section SYSTEM "http://www.docbook.org/xml/4.4/docbookx.dtd"
+[
+ <!ENTITY current-series "5.1"><!-- Current MySQL release series -->
+ <!ENTITY base-url-docs "http://dev.mysql.com/doc/">
+
+ <!ENTITY mdash "—">
+]>
+<section id="mysql-cluster-utility-programs">
+
+ <title>Cluster Utility Programs</title>
+
+ <para>
+ This section discusses the Cluster utility programs that can be
+ found in the <filename>mysql/bin</filename> directory. Each of these
+ — except for <filename>ndb_size.pl</filename> — is a
+ standalone binary that can be used from a system shell, and that
+ does not need to connect to a MySQL server (nor even that a MySQL
+ server be connected to the cluster).
+ </para>
+
+ <para>
+ <filename>ndb_size.pl</filename> is a Perl script which is also
+ intended to be used from the shell; however it is a MySQL
+ application and must be able to connect to a MySQL server. See
+ <xref linkend="mysql-cluster-utility-programs-ndb-size"/>, for
+ additional requirements for using this script.
+ </para>
+
+ <remark role="todo">
+ [js] Fix path to tools directory for RefMan 5.0 and 4.1.
+ </remark>
+
+ <para>
+ These utilities can also serve as examples for writing your own
+ applications using the NDB API. The source code for most of these
+ programs may be found in the <filename>storage/ndb/tools</filename>
+ directory in the MySQL ¤t-series; tree (see
+ <xref linkend="installing-source"/>). The NDB API is not covered in
+ this manual; please refer to the
+ <ulink url="&base-url-docs;/ndbapi/en/">NDB API Guide</ulink> for
+ information about this API.
+ </para>
+
+ <para>
+ All of the <literal>NDB</literal> utilities are listed here with
+ brief descriptions:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <command>ndb_config</command>: Retrieves Cluster configuration
+ options.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_delete_all</command>: Deletes all rows from a given
+ table.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_desc</command>: Lists all properties of an
+ <literal>NDB</literal> table.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_drop_index</command>: Drops the specified index
+ from an <literal>NDB</literal> table.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_drop_table</command>: Drops an
+ <literal>NDB</literal> table.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_error_reporter</command>: Can be used to generate
+ an error report in the event of problems with the cluster.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_mgm</command>: This is the MySQL Cluster management
+ client, which is discussed in
+ <xref linkend="mysql-cluster-mgm-client-commands"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_print_backup_file</command>:
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_print_schema_file</command>:
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_print_sys_file</command>:
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_restore</command>: This utility is used to restore
+ a cluster from backup. See
+ <xref linkend="mysql-cluster-restore"/>, for more information.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_select_all</command>: Reads all rows from an
+ <literal>NDB</literal> table and prints them to the screen or a
+ file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_select_count</command>: Gets the number of rows in
+ one or more <literal>NDB</literal> tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_show_tables</command>: Shows all
+ <literal>NDB</literal> tables anywhere in the cluster.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_size.pl</command>: Examines all the tables in a
+ given non-Cluster database and calculates the amount of storage
+ each would require if it were converted to use the
+ <literal>NDB</literal> storage engine.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_test_platform</command>:
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>ndb_waiter</command>: Reports on the status of cluster
+ data nodes in a manner similar to that of the management client
+ command <literal>ALL STATUS</literal>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Additional information about each of these utilities (except for
+ <command>ndb_mgm</command> and <command>ndb_restore</command>) can
+ be found in the sections that follow.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: All of these utilities
+ (except for <command>ndb_size.pl</command>) can use the options
+ discussed in <xref linkend="mysql-cluster-command-options"/>.
+ Additional options specific to each utility program are discussed in
+ the individual program listings.
+ </para>
+
+ <section id="mysql-cluster-utility-programs-ndb-config">
+
+ <title><command>ndb_config</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Prints cluster
+ configuration data.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-delete-all">
+
+ <title><command>ndb_delete_all</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Deletes all rows
+ from the given table.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+ndb_delete_all -c <replaceable>connect_string</replaceable> <replaceable>tbl_name</replaceable> -d <replaceable>db_name</replaceable>
+</programlisting>
+
+ <para>
+ This connects to the cluster management server specified by
+ <replaceable>connect_string</replaceable> and deletes all rows
+ from the table named <replaceable>tbl_name</replaceable> in the
+ database named <replaceable>db_name</replaceable>.
+ </para>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <option>-d</option>, <option>--database</option>
+ </para>
+
+ <para>
+ Indicates the database to which the table belongs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>-t</option>, <option>--transactional</option>
+ </para>
+
+ <para>
+ Use of this option causes the delete operation to be performed
+ as a single transaction. With very large tables, this may
+ exceed the the number of operations available to the cluster.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-desc">
+
+ <title><command>ndb_desc</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Provides a detailed
+ description of an <literal>NDB</literal> table.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Sample Output</emphasis>:
+ </para>
+
+<programlisting>
+CREATE TABLE fish (
+ id INT(11) NOT NULL AUTO_INCREMENT,
+ name VARCHAR(20),
+
+ PRIMARY KEY pk (id),
+ UNIQUE KEY uk (name)
+) ENGINE=NDBCLUSTER;
+</programlisting>
+
+<programlisting>
+jon@monster-zero:/usr/local/mysql/bin> <userinput>./ndb_desc -c 192.168.0.179 fish -d ctest1</userinput>
+-- fish --
+Version: 16777221
+Fragment type: 5
+K Value: 6
+Min load factor: 78
+Max load factor: 80
+Temporary table: no
+Number of attributes: 2
+Number of primary keys: 1
+Length of frm data: 268
+Row Checksum: 1
+Row GCI: 1
+TableStatus: Retrieved
+-- Attributes --
+id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+name Varchar(20;latin1_swedish_ci) NULL AT=SHORT_VAR ST=MEMORY
+
+-- Indexes --
+PRIMARY KEY(id) - UniqueHashIndex
+uk(name) - OrderedIndex
+PRIMARY(id) - OrderedIndex
+uk$unique(name) - UniqueHashIndex
+
+
+NDBT_ProgramExit: 0 - OK
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-drop-index">
+
+ <title><command>ndb_drop_index</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Drops the specified
+ index from an <literal>NDB</literal> table.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+ndb_drop_index -c <replaceable>connect_string</replaceable> <replaceable>table_name</replaceable> <replaceable>index</replaceable> -d <replaceable>db_name</replaceable>
+</programlisting>
+
+ <para>
+ The statement shown above drops the index named
+ <replaceable>index</replaceable> from the
+ <replaceable>table</replaceable> in the
+ <replaceable>database</replaceable>.
+ </para>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Warning</emphasis>: Operations performed on
+ Cluster table indexes are not visible to MySQL. If you use this
+ program to drop an index, then try to access the table from an SQL
+ node, an error results:
+ </para>
+
+<programlisting>
+jon@monster-zero:/usr/local/mysql/bin> <userinput>./ndb_drop_index -c 192.168.0.179 dogs idx -d ctest1</userinput>
+Dropping index dogs/idx...OK
+
+NDBT_ProgramExit: 0 - OK
+
+jon@monster-zero:/usr/local/mysql/bin> <userinput>./mysql -u jon -p ctest1</userinput>
+Enter password: *******
+Reading table information for completion of table and column names
+You can turn off this feature to get a quicker startup with -A
+
+Welcome to the MySQL monitor. Commands end with ; or \g.
+Your MySQL connection id is 7 to server version: 5.1.12-beta-20060817
+
+Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
+
+mysql> SHOW TABLES;
++------------------+
+| Tables_in_ctest1 |
++------------------+
+| a |
+| bt1 |
+| bt2 |
+| dogs |
+| employees |
+| fish |
++------------------+
+6 rows in set (0.00 sec)
+
+mysql> SELECT * FROM dogs;
+<errortext>ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER</errortext>
+</programlisting>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-drop-table">
+
+ <title><command>ndb_drop_table</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Drops the specified
+ <literal>NDB</literal> table.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+ndb_drop_table -c <replaceable>connect_string</replaceable> <replaceable>tbl_name</replaceable> -d <replaceable>db_name</replaceable>
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-error-reporter">
+
+ <title><command>ndb_error_reporter</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Generates an error
+ report that can be used to help diagnose bugs or other problems
+ with a cluster.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-print-backup-file">
+
+ <title><command>ndb_print_backup_file</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-print-schema-file">
+
+ <title><command>ndb_print_schema_file</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-print-sys-file">
+
+ <title><command>ndb_print_sys_file</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-select-all">
+
+ <title><command>ndb_select_all</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Reads all rows from
+ an <literal>NDB</literal> table to <literal>stdout</literal>. Can
+ also be used to print all table rows to a file.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+ndb_select_all -c <replaceable>connect_string</replaceable> <replaceable>tbl_name</replaceable> -d <replaceable>db_name</replaceable>
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-select-count">
+
+ <title><command>ndb_select_count</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Prints the number of
+ rows in an <literal>NDB</literal> table.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+ndb_select_count -c <replaceable>connect_string</replaceable> <replaceable>tbl_name</replaceable> -d <replaceable>db_name</replaceable>
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-show-tables">
+
+ <title><command>ndb_show_tables</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>: Displays a list of
+ all <literal>NDB</literal> tables in the cluster. This includes
+ both user-created tables and <literal>NDB</literal> system tables.
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+ndb_show_tables -c <replaceable>connect_string</replaceable>
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-size">
+
+ <title><command>ndb_size.pl</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-test-platform">
+
+ <title><command>ndb_test_platform</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+ <section id="mysql-cluster-utility-programs-ndb-waiter">
+
+ <title><command>ndb_waiter</command></title>
+
+ <para>
+ <emphasis role="bold">Description</emphasis>:
+ </para>
+
+ <para>
+ <emphasis role="bold">Usage</emphasis>:
+ </para>
+
+<programlisting>
+
+</programlisting>
+
+ <para>
+ <emphasis role="bold">Additional Options</emphasis>:
+ </para>
+
+ </section>
+
+</section>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r3089 - trunk/refman-5.1 | jon | 23 Aug |