Question

I aborted a pt-online-schema change command to change a table definition. Now, when I run pt-online-schema change again, I get this error:

The table <db name>.<table name> has triggers. This tool needs to create its own triggers, so the table cannot already have triggers.

How do I run pt-online-schema change again?

I use MySQL.

Was it helpful?

Solution

When Percona Online Schema Change runs, it creates triggers which synchronize the new table with updates that happen to the old table (with the previous table definition).

Before you run pt-online-schema change again, you have to delete these triggers.

In MySQL you can find the triggers by writing show triggers like '<table name>'\G.

And you can delete those triggers by typing

drop trigger <trigger name>;

You should only follow this recipe if your table definition does not have other triggers than those created by pt-online-schema change. Their names will start with "pt_osc_".

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top