.\" Title: \fBndb_size.pl\fR
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.70.1
.\" Date: 05/02/2007
.\" Manual: MySQL Database System
.\" Source: MySQL 5.0
.\"
.TH "\fBNDB_SIZE.PL\fR" "1" "05/02/2007" "MySQL 5.0" "MySQL Database System"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
ndb_size.pl \- NDBCluster Size Requirement Estimator
.SH "SYNOPSIS"
.HP 22
\fBndb_size.pl \fR\fB\fIarguments\fR\fR
.SH "DESCRIPTION"
.PP
This is a Perl script that can be used to estimate the amount of space that would be required by a MySQL database if it were converted to use the
NDBCluster
storage engine. Unlike the other utilities discussed in this section, it does not require access to a MySQL Cluster (in fact, there is no reason for it to do so). However, it does need to access the MySQL server on which the database to be tested resides.
.PP
\fBRequirements\fR:
.TP 3n
\(bu
A running MySQL server. The server instance does not have to provide support for MySQL Cluster.
.TP 3n
\(bu
A working installation of Perl.
.TP 3n
\(bu
The
DBI
and
HTML::Template
modules, both of which can be obtained from CPAN if they are not already part of your Perl installation. (Many Linux and other operating system distribution provide their own packages for one or both of these libraries.)
.TP 3n
\(bu
The
\fIndb_size.tmpl\fR
template file, which you should be able to find in the
\fIshare/mysql\fR
directory of your MySQL installation. This file should be copied or moved into the same directory as
\fIndb_size.pl\fR
\(em if it is not there already \(em before running the script.
.TP 3n
\(bu
A MySQL user account having the necessary privileges. If you do not wish to use an existing account, then creating one using
GRANT USAGE ON \fIdb_name\fR.*
\(em where
\fIdb_name\fR
is the name of the database to be examined \(em is sufficient for this purpose.
.sp
.RE
.PP
\fIndb_size.pl\fR
and
\fIndb_size.tmpl\fR
can also be found in the MySQL sources in
\fIstorage/ndb/tools\fR. If these files are not present in your MySQL installation, you can obtain them from the
[1]\&\fIMySQLForge project page\fR.
.PP
\fBUsage\fR:
.sp
.RS 3n
.nf
perl ndb_size.pl \fIdb_name\fR \fIhostname\fR \fIusername\fR \fIpassword\fR > \fIfile_name\fR.html
.fi
.RE
.PP
The command shown connects to the MySQL server at
\fIhostname\fR
using the account of the user
\fIusername\fR
having the password
\fIpassword\fR, analyses all of the tables in database
\fIdb_name\fR, and generates a report in HTML format which is directed to the file
\fI\fIfile_name\fR\fR\fI.html\fR. (Without the redirection, the output is sent to
stdout.) This figure shows partial sample output as viewed in a Web browser:
.PP
The output from this script includes:
.TP 3n
\(bu
Minimum values for the
DataMemory,
IndexMemory,
MaxNoOfTables,
MaxNoOfAttributes,
MaxNoOfOrderedIndexes,
MaxNoOfUniqueHashIndexes, and
MaxNoOfTriggers
configuration parameters required to accommodate the tables analysed.
.TP 3n
\(bu
Memory requirements for all of the tables, attributes, ordered indexes, and unique hash indexes defined in the database.
.TP 3n
\(bu
The
IndexMemory
and
DataMemory
required per table and table row.
.SH "COPYRIGHT"
.PP
Copyright 1997\-2007 MySQL AB
.PP
This documentation is NOT distributed under a GPL license. Use of this documentation is subject to the following terms: You may create a printed copy of this documentation solely for your own personal use. Conversion to other formats is allowed as long as the actual content is not altered or edited in any way. You shall not publish or distribute this documentation in any form or on any media, except if you distribute the documentation in a manner similar to how MySQL disseminates it (that is, electronically for download on a Web site with the software) or on a CD\-ROM or similar medium, provided however that the documentation is disseminated together with the software on the same medium. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of MySQL AB. MySQL AB reserves any and all rights to this documentation not expressly granted above.
.PP
Please email
for more information.
.SH "REFERENCES"
.TP 3
1.\ MySQLForge project page
\%http://forge.mysql.com/projects/view.php?id=88
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
MySQL AB (http://www.mysql.com/).
This software comes with no warranty.