2014-09-10 19 views
0

我们仍在使用MySQL 5.0,并且刚刚了解到我们的系统上有一个名为Percona的工具。我们收到了一条命令,帮助我们确定alter语句在执行数据库时需要多长时间,因为我们遇到了“长时间运行查询”的情况,并且阻碍了数据库正常启动。我的问题是我们是否可以在MySQL 5.0上执行下面的Percona命令,因为我们也在下面得到了这个错误?pt-online-schema-change问​​题MySQL 5.0上的Percona命令

这里是命令:

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 

以下是错误:

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. 

任何帮助/方向,将不胜感激。谢谢。

回答

0

我显然有一个语法问题。下面是修订后的指令,以防万一别人运行到同一个问题:

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" 

感谢