.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MYSQL-PARALLEL-RESTORE 1" .TH MYSQL-PARALLEL-RESTORE 1 "2007-10-15" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" mysql\-parallel\-restore \- Load files into MySQL in parallel. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& mysql-parallel-restore /path/to/files \& mysql-parallel-restore --tab /path/to/files .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" MySQL Parallel Restore is a way to load \s-1SQL\s0 or delimited-file dumps into MySQL in parallel at high speed. It is especially designed for restoring files dumped by MySQL Parallel Dump (see mysql-parallel-dump). It automatically detects whether a file contains \s-1SQL\s0 or delimited data from the filename extension, and either shells out to \f(CW\*(C`mysql\*(C'\fR or executes \f(CW\*(C`LOAD DATA INFILE\*(C'\fR with the file. On UNIX-like systems, it will even make a \s-1FIFO\s0 to decompress gzipped files for \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. .PP By default it discovers all files in the directory you specify on the command line. It uses the file's parent directory as the database name and the file's name (up to the first dot) as the table name. It can deal with files named like the following: .PP .Vb 3 \& dir/tbl.sql \& dir/tbl.txt \& dir/tbl.csv .Ve .PP It is also happy with files that look like this, where \f(CW\*(C`EXT\*(C'\fR is one of the extensions just listed. .PP .Vb 2 \& dir/tbl.EXT.000 \& dir/tbl.EXT.000.gz .Ve .PP By default, it loads \f(CW\*(C`SQL\*(C'\fR files first, if they exist, then loads \f(CW\*(C`CSV\*(C'\fR or \&\f(CW\*(C`TXT\*(C'\fR files next, in order of the numbers in the filename extension as just shown. This makes it easy for you to reload a table's definition followed by its data, in case you dumped them into separate files (as happens with \&\f(CW\*(C`mysqldump\*(C'\fR's \f(CW\*(C`\-\-tab\*(C'\fR option). .PP Exit status is 0 if everything went well, 1 if any files failed, and any other value indicates an internal error. .SH "OUTPUT" .IX Header "OUTPUT" Output depends on verbosity. When \*(L"\-\-test\*(R" is given, output includes commands that would be executed. .PP When \*(L"\-\-verbose\*(R" is 0, there is normally no output unless there's an error. .PP When \*(L"\-\-verbose\*(R" is 1, there is one line of output for the entire job, showing how many tables were processed, how many files were loaded with what status, how much time elapsed, and how much time the parallel load jobs added up to. .PP When \*(L"\-\-verbose\*(R" is 2, there's one line of output per table, showing extra data such as how many threads were running when each table finished loading: .PP .Vb 9 \& DATABASE TABLE FILES TIME STATUS THREADS \& sakila language 2 0.07 0 2 \& sakila film_actor 2 0.07 0 2 \& sakila actor 2 0.06 0 2 \& sakila payment 2 0.07 0 2 \& sakila transport_backup 2 0.05 0 2 \& sakila country 2 0.08 0 2 \& sakila film 2 0.05 0 2 \& sakila rental 2 0.07 0 2 .Ve .SH "SPEED OF PARALLEL LOADING" .IX Header "SPEED OF PARALLEL LOADING" User-contributed benchmarks are welcome. .SH "OPTIONS" .IX Header "OPTIONS" Some options can be disabled by prefixing them with \f(CW\*(C`\-\-no\*(C'\fR. .IP "\-\-basedir" 4 .IX Item "--basedir" Directory in which temporary files, such as \s-1FIFO\s0 files (see \*(L"\-\-fifo\*(R") will be created. .IP "\-\-bulkinsbufsize" 4 .IX Item "--bulkinsbufsize" Sets the bulk_insert_buffer_size variable before each \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. Has no effect without \*(L"\-\-tab\*(R". .IP "\-\-charset" 4 .IX Item "--charset" Sets the connection, database, and \f(CW\*(C`LOAD DATA INFILE\*(C'\fR character set. The default is \f(CW\*(C`BINARY\*(C'\fR, which is the safest value to use for \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. Has no effect without \*(L"\-\-tab\*(R". .IP "\-\-commit" 4 .IX Item "--commit" Commit between each file it loads via \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. .IP "\-\-createdb" 4 .IX Item "--createdb" Create databases if they don't exist. .IP "\-\-csv" 4 .IX Item "--csv" Changes \*(L"\-\-tab\*(R" options so the following \f(CW\*(C`LOAD DATA INFILE\*(C'\fR statement is used: .Sp .Vb 3 \& LOAD DATA INFILE INTO TABLE \& FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\e"' \& LINES TERMINATED BY '\en'; .Ve .Sp This option implies \*(L"\-\-tab\*(R". .IP "\-\-database" 4 .IX Item "--database" Specifies a database into which all files should be loaded. Overrides the database which is normally specified by the directory in which the files live. Does \fInot\fR specify a default database for the connection. .IP "\-\-databases" 4 .IX Item "--databases" Load only this comma-separated list of databases. .IP "dbregex" 4 .IX Item "dbregex" Load only databases whose names match this Perl regular expression. .IP "\-\-defaults\-file" 4 .IX Item "--defaults-file" Only read default options from the given file. You must give an absolute pathname. .IP "\-\-disablekeys" 4 .IX Item "--disablekeys" Use \f(CW\*(C`ALTER TABLE DISABLE KEYS\*(C'\fR before loading files into a table. .IP "\-\-fifo" 4 .IX Item "--fifo" Load compressed tab-separated files by piping them into a \s-1FIFO\s0 and using the \&\s-1FIFO\s0 with \f(CW\*(C`LOAD DATA INFILE\*(C'\fR, instead of by decompressing the files on disk. Sets \*(L"\-\-umask\*(R" to 0. .IP "\-\-help" 4 .IX Item "--help" Displays a help message. .IP "\-\-host" 4 .IX Item "--host" Connect to host. .IP "\-\-ignore" 4 .IX Item "--ignore" Adds the \f(CW\*(C`IGNORE\*(C'\fR modifier to \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. .IP "\-\-ignoredb" 4 .IX Item "--ignoredb" Do not load this comma-separated list of databases. .IP "\-\-ignoretbl" 4 .IX Item "--ignoretbl" Do not load this comma-separated list of table (not database.table) names. .IP "\-\-local" 4 .IX Item "--local" Uses the \f(CW\*(C`LOCAL\*(C'\fR modifier to \f(CW\*(C`LOAD DATA INFILE\*(C'\fR, so the files are read locally by the client library, not by the server. .IP "\-\-locktables" 4 .IX Item "--locktables" Lock tables before \f(CW\*(C`LOAD DATA INFILE\*(C'\fR (disabled by default). .IP "\-\-noautovalon0" 4 .IX Item "--noautovalon0" Set the \s-1SQL\s0 mode to \f(CW\*(C`NO_AUTO_VALUE_ON_ZERO\*(C'\fR before \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. .IP "\-\-nobinlog" 4 .IX Item "--nobinlog" Set \f(CW\*(C`SQL_LOG_BIN=0\*(C'\fR before \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. This prevents large loads from being logged to the server's binary log. .IP "\-\-noforeignkeys" 4 .IX Item "--noforeignkeys" Set \f(CW\*(C`FOREIGN_KEY_CHECKS=0 before \f(CW\*(C`LOAD DATA INFILE\*(C'\f(CW. \&\*(C'\fR.IP "\-\-nouniquechecks" 4 .IX Item "--nouniquechecks" Set \f(CW\*(C`UNIQUE_CHECKS=0 before \f(CW\*(C`LOAD DATA INFILE\*(C'\f(CW. \&\*(C'\fR.IP "\-\-numthread" 4 .IX Item "--numthread" Specifies the number of parallel processes to run. The default is 2 (this is MySQL Parallel Restore, after all \*(-- 1 is not parallel). On GNU/Linux machines, the default is the number of times 'processor' appears in \fI/proc/cpuinfo\fR. On Windows, the default is read from the environment. In any case, the default is at least 2, even when there's only a single processor. .IP "\-\-password" 4 .IX Item "--password" Password to use when connecting. .IP "\-\-port" 4 .IX Item "--port" Port number to use for connection. .IP "\-\-quiet" 4 .IX Item "--quiet" Sets \*(L"\-\-verbose\*(R" to 0. .IP "\-\-replace" 4 .IX Item "--replace" Adds the \f(CW\*(C`REPLACE\*(C'\fR modifier to \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. .IP "\-\-socket" 4 .IX Item "--socket" Socket file to use for connection. .IP "\-\-sql" 4 .IX Item "--sql" Causes files with a .sql extension to be loaded (via \f(CW\*(C`mysql\*(C'\fR) before loading .txt and .csv files via \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. Enabled by default. .IP "\-\-tab" 4 .IX Item "--tab" Load via \f(CW\*(C`LOAD DATA INFILE\*(C'\fR, which is similar to what \f(CW\*(C`mysqlimport\*(C'\fR does, but more flexibly. .Sp Enables the following options, unless they are specifically disabled: \&\*(L"\-\-commit\*(R", \*(L"\-\-disablekeys\*(R", \*(L"\-\-noautovalon0\*(R", \*(L"\-\-nobinlog\*(R", \&\*(L"\-\-nouniquechecks\*(R", \*(L"\-\-noforeignkeys\*(R". .IP "\-\-tables" 4 .IX Item "--tables" Restore this comma-separated list of table (not database.table) names. .IP "\-\-tblregex" 4 .IX Item "--tblregex" Restore only tables whose names match this Perl regular expression. .IP "\-\-test" 4 .IX Item "--test" Print commands instead of executing them. .IP "\-\-truncate" 4 .IX Item "--truncate" Issues \f(CW\*(C`TRUNCATE TABLE\*(C'\fR to delete all rows from a table before loading the first tab-delimited file into it with \f(CW\*(C`LOAD DATA INFILE\*(C'\fR. .IP "\-\-umask" 4 .IX Item "--umask" Set the program's \f(CW\*(C`umask\*(C'\fR to this octal value. This is useful when you want created files (such as \s-1FIFO\s0 files) to be readable or writable by other users (for example, the MySQL server itself). .IP "\-\-user" 4 .IX Item "--user" User for login if not current user. .IP "\-\-verbose" 4 .IX Item "--verbose" Sets the verbosity; repeatedly specifying it increments the verbosity. Default is 1 if not specified. See \*(L"\s-1OUTPUT\s0\*(R". .IP "\-\-version" 4 .IX Item "--version" Output version information and exit. .IP "\-\-wait" 4 .IX Item "--wait" If the MySQL server crashes during loading, waits until the server comes back and then continues with the rest of the files. The value is a number with a suffix (s=seconds, m=minutes, h=hours, d=days). MySQL Parallel Restore will check the server every second until this time is exhausted, at which point it will give up and exit. .SH "SYSTEM REQUIREMENTS" .IX Header "SYSTEM REQUIREMENTS" You need Perl, \s-1DBI\s0, DBD::mysql, and some core packages that ought to be installed in any reasonably new version of Perl. .SH "BUGS" .IX Header "BUGS" Please use the Sourceforge bug tracker, forums, and mailing lists to request support or report bugs: . .SH "COPYRIGHT, LICENSE AND WARRANTY" .IX Header "COPYRIGHT, LICENSE AND WARRANTY" This program is copyright (c) 2007 Baron Schwartz. Feedback and improvements are welcome. .PP \&\s-1THIS\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \&\s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \&\s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation, version 2; \s-1OR\s0 the Perl Artistic License. On \s-1UNIX\s0 and similar systems, you can issue `man perlgpl' or `man perlartistic' to read these licenses. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111\-1307 \s-1USA\s0. .SH "AUTHOR" .IX Header "AUTHOR" Baron Schwartz. .SH "SEE ALSO" .IX Header "SEE ALSO" See also mysql-parallel-dump. .SH "VERSION" .IX Header "VERSION" This manual page documents Ver 0.9.0 Distrib 1053 \f(CW$Revision:\fR 1049 $.