mariadb-schema-change for MariaDB Tools

Overview

The mariadb-schema-change utility.

mariadb-schema-change Options for MariaDB Tools

Option

Argument

Description

--alter

string

The schema modification, without the ALTER TABLE keywords

--alter-foreign-keys-method

string

How to modify foreign keys so they reference the new table

--analyze-before-swap

Execute ANALYZE TABLE on the new table before swapping with the old one (default yes). Disable using: --noanalyze-before-swap

--ask-pass

Prompt for a password when connecting to MariaDB

--channel

string

Channel name used when connected to a server using replication channels

--charset (-A)

string

Default character set

--check-alter

Parses the --alter specified and tries to warn of possible unintended behavior ( default yes). Disable using: --nocheck-alter

--check-foreign-keys

Check for self-referencing foreign keys ( default yes). Disable using: --nocheck-foreign-keys

--check-interval

time

Sleep time between checks for --max-lag ( default 1). Optional suffix s=seconds, m= minutes, h=hours, d=days; if no suffix, s is used.

--check-plan

Check query execution plans for safety ( default yes). Disable using: --nocheck-plan

--check-replication-filters

Abort if any replication filter is set on any server (default yes). Disable using: --nocheck-replication-filters

--check-slave-lag

string

Pause the data copy until this replica's lag is less than --max-lag

--check-unique-key-change

Avoid mariadb-schema-change to run if the specified statement for --alter is trying to add an unique index (default yes). Disable using: --nocheck-unique-key-change

--chunk-index

string

Prefer this index for chunking tables

--chunk-index-columns

integer

Use only this many left-most columns of a -- chunk-index

--chunk-size

size

Number of rows to select for each chunk copied (default 1000)

--chunk-size-limit

float

Do not copy chunks this much larger than the desired chunk size (default 4.0)

--chunk-time

float

Adjust the chunk size dynamically so each data-copy query takes this long to execute ( default 0.5)

--config

string

Read this comma-separated list of config files; if specified, this must be the first option on the command line

--critical-load

string

Examine SHOW GLOBAL STATUS after every chunk, and abort if the load is too high ( default Threads_running=50)

--data-dir

string

Create the new table on a different partition using the DATA DIRECTORY feature

--database (-D)

string

Connect to this database

--default-engine

Remove ENGINE from the new table

--defaults-file (-F)

string

Only read mysql options from the given file

--drop-new-table

Drop the new table if copying the original table fails (default yes). Disable using: --nodrop-new-table

--drop-old-table

Drop the original table after renaming it ( default yes). Disable using: --nodrop-old-table

--drop-triggers

Drop triggers on the old table. --no-drop- triggers forces --no-drop-old-table (default yes). Disable using: --nodrop-triggers

--dry-run

Create and alter the new table, but do not create triggers, copy data, or replace the original table

--execute

Indicate that you have read the documentation and want to alter the table

--force

This options bypasses confirmation in case of using alter-foreign-keys-method = none , which might break foreign key constraints

--force-concat-enums

The NibbleIterator in mariadb-schema-change can detect indexes having ENUM fields and if the items it has are sorted or not

--help

Show help and exit

--host (-h)

string

Connect to host

--max-flow-ctl

float

Somewhat similar to --max-lag but for PXC clusters

--max-lag

time

Pause the data copy until all replicas' lag is less than this value (default 1s). Optional suffix s=seconds, m=minutes, h= hours, d=days; if no suffix, s is used.

--max-load

string

Examine SHOW GLOBAL STATUS after every chunk, and pause if any status variables are higher than their thresholds (default Threads_running=25)

--new-table-name

string

New table name before it is swapped. %T is replaced with the original table name ( default %T_new)

--null-to-not-null

Allows MODIFYing a column that allows NULL values to one that doesn't allow them

--only-same-schema-fks

Check foreigns keys only on tables on the same schema than the original table

--password (-p)

string

Password to use when connecting

--pause-file

string

Execution will be paused while the file specified by this param exists

--pid

string

Create the given PID file

--plugin

string

Perl module file that defines a pt_online_schema_change_plugin class

--port (-P)

integer

Port number to use for connection

--preserve-triggers

Preserves old triggers when specified

--print

Print SQL statements to STDOUT

--progress

string

Print progress reports to STDERR while copying rows (default time,30)

--quiet (-q)

Do not print messages to STDOUT (disables -- progress)

--recurse

integer

Number of levels to recurse in the hierarchy when discovering replicas

--recursion-method

string

Preferred recursion method for discovering replicas (default processlist,hosts)

--remove-data-dir

If the original table was created using the DATA DIRECTORY feature, remove it and create the new table in MariaDB default directory without creating a new isl file (default no)

--reverse-triggers

Warning! This option creates reverse triggers on the new table before it starts copying

--set-vars

string

Set the MariaDB variables in this comma- separated list of variable=value pairs

--skip-check-slave-lag

DSN

DSN to skip when checking slave lag

--slave-password

string

Sets the password to be used to connect to the slaves

--slave-user

string

Sets the user to be used to connect to the slaves

--sleep

float

How long to sleep (in seconds) after copying each chunk (default 0)

--socket (-S)

string

Socket file to use for connection

--statistics

Print statistics about internal counters

--swap-tables

Swap the original table and the new, altered table (default yes). Disable using: --noswap-tables

--tries

string

How many times to try critical operations

--user (-u)

string

User for login if not current user

--version

Show version and exit