Melinda
Melinda

Reputation: 1531

Issue with pt-online-schema-change Percona command on MySQL 5.0

We're still using MySQL 5.0 and just learned that we have a tool called Percona on our system. We were given a command to help us determine how long an alter statement would take to execute on our DB as we're running into a situation with "long running queries" and it hinders the database from starting properly. My question is can we execute the following Percona command on MySQL 5.0 as we're getting the error below as well?

Here is the command:

pt-online-schema-change --set-vars innodb_lock_wait_ti
meout=50 --host=localhost   --alter-foreign-keys-method=auto user=tfuser --ask
-pass --alter " ADD INDEX indAppPostCodeAnywhere (Forename, Surname, DOB, Applic
ationDate)" D=DBName,t=Application  --dry-run

Here is the error:

Usage: pt-online-schema-change [OPTIONS] DSN

Errors in command-line arguments:
  * Specify only one DSN on the command line
  * The DSN must specify a database (D) and a table (t)

pt-online-schema-change alters a table's structure without blocking reads or
writes.  Specify the database and table in the DSN.  Do not use this tool before
reading its documentation and checking your backups carefully.  For more
details, please use the --help option, or try 'perldoc
/usr/bin/pt-online-schema-change' for complete documentation.

Any help/direction would be appreciated. Thanks.

Upvotes: 0

Views: 3926

Answers (1)

Melinda
Melinda

Reputation: 1531

I apparently had a syntax issue. Here is the revised command just in case someone else runs into the same issue:

pt-online-schema-change D=DBName,t=Application,h=localhost,u=tfuser --alter="ADD INDEX indAppPostCodeAnywhere (Forename, Surname, DOB, ApplicationDate)" --alter-foreign-keys-method="auto" --ask-pass --dry-run --set-vars="innodb_lock_wait_timeout=50"

Thanks

Upvotes: 1

Related Questions