Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

pt-online-schema-change

docs.percona.com

  • Free plan
  • Linux
  • Self-hosted
7.1 Club score Visit docs.percona.com

What pt-online-schema-change is

pt-online-schema-change is a free Percona Toolkit command-line utility for changing MySQL table structures while reads and writes continue. It creates and fills a replacement table, copies rows in small chunks, and uses triggers to carry changes from the original during the operation before replacing it. The command can pause or abort when server load is high and pause copying when replicas are delayed. It performs no change unless `--execute` is specified; `--dry-run` and `--execute` cannot be combined. Most tables need a PRIMARY KEY or UNIQUE INDEX. Existing triggers prevent operation, while foreign keys referencing the table require a chosen handling method that adds risk. Requirements include Perl, DBI, DBD::mysql, MySQL 5.0.2 or newer and specified privileges. Percona documents package installation for Debian, Ubuntu, RHEL and CentOS, plus downloads and a tar.gz release. The tool runs on Linux, supports self-hosting and is licensed under GPL v2 or the Perl Artistic License.

Who it suits

pt-online-schema-change is intended for database administrators and database operations teams. It suits Linux, self-hosted environments where controlled MySQL schema changes are needed.

Good to know, and what to watch

  • Keeps reads and writes available during changes
  • Copies rows in small chunks
  • Can react to high server load
  • Supports delayed-replica detection
  • Free open-source licensing
  • Existing triggers prevent operation
  • Most tables need a primary or unique index
  • Foreign-key handling adds risk
  • Requires Perl, DBI and DBD::mysql

Percona Toolkit (includes pt-online-schema-change)

Free

Free plan

The verdict

pt-online-schema-change provides a controlled method for online MySQL table alterations, with safeguards around load and replication. Its prerequisites and trigger or foreign-key limitations require planning before execution.

What the maker publishes

Chunked copying
It copies rows in small chunks and uses triggers to apply changes made to the original table during the copy. source
Cluster support
For Percona XtraDB Cluster 5.5.28-23.7 and newer, only InnoDB tables can be altered and wsrep_OSU_method must be TOI. source
Execution safety
The tool does not modify a table unless the --execute option is specified; --dry-run and --execute are mutually exclusive. source
Foreign-key handling
Foreign keys that reference the table require a specified foreign-key method, and their handling introduces additional risk. source
Founded
2006 source
Installation telemetry
The installer stores an instance UUID for toolkit usage statistics and states that no other information is gathered for that purpose. source
Install platforms
Percona documents package-manager installation for Debian or Ubuntu and RHEL or CentOS, plus package downloads and a tar.gz release. source
Intended users
Percona describes the Toolkit as advanced open-source command-line tools for DBAs and database operations. source
Key requirement
In most cases, the table needs a PRIMARY KEY or UNIQUE INDEX for the tool to operate. source
License
The program is free software under either the GNU General Public License version 2 or the Perl Artistic License. source
Load and replication checks
It can pause or abort when server load is too high and pause copying when it detects delayed replicas. source
Purpose
pt-online-schema-change alters MySQL table structures without blocking reads or writes by building and populating a copy of the table, then replacing the original. source
Requirements
The tool requires Perl, DBI, DBD::mysql, and MySQL 5.0.2 or newer, along with specified MySQL privileges. source
Support
Percona says its Community Forum service is free and response times vary with the complexity of the question. source
Trigger limitation
The tool will not work on a table that already has triggers defined because it uses triggers to keep the replacement table updated. source

Checked against the maker's pages on 8 Oct 2026.