Not the answer you need?
Register and ask your own question!

seem the pt-archiver where condition cannot including space

CharlieCaoCharlieCao EntrantCurrent User Role Beginner
seem the pt-archiver where condition cannot including space
have tried this condition and show me the an error

--where delete_timestamp < ADDDATE(LAST_DAY(SUBDATE(now(), INTERVAL 3 MONTH)), 1)


Usage: pt-archiver [OPTIONS] --source DSN --where WHERE

Errors in command-line arguments:
* Unrecognized command-line options < ADDDATE(LAST_DAY(SUBDATE(now(), INTERVAL 3 MONTH)), 1)

pt-archiver nibbles records from a MySQL table. The --source and --dest
arguments use DSN syntax; if COPY is yes, --dest defaults to the key's value
from --source. For more details, please use the --help option, or try 'perldoc
/opt/mysqlapp/PerconaTool/percona-toolkit-2.2.16/bin/pt-archiver' for complete
documentation.

But, If change the condition under will work

--where delete_timestamp < ADDDATE(LAST_DAY(SUBDATE(now(),90)), 1)

Comments

  • scott.nemesscott.nemes MySQL Sage Current User Role Patron
    Hi CharlieCao;

    Try putting quotations around it:

    --where "delete_timestamp < ADDDATE(LAST_DAY(SUBDATE(now(), INTERVAL 3 MONTH)), 1)"

    -Scott
  • CharlieCaoCharlieCao Entrant Current User Role Beginner
    Hi Scott,
    I tried what your suggestion using quote in where condition but, got same issue:

    306 --dry-run --where "delete_timestamp < ADDDATE(LAST_DAY(SUBDATE(now(),interval 3 month)), 1)"
    Usage: pt-archiver [OPTIONS] --source DSN --where WHERE

    Errors in command-line arguments:
    * Unrecognized command-line options < ADDDATE(LAST_DAY(SUBDATE(now(),interval 3 month)), 1)"

    pt-archiver nibbles records from a MySQL table. The --source and --dest
    arguments use DSN syntax; if COPY is yes, --dest defaults to the key's value
    from --source. For more details, please use the --help option, or try 'perldoc
    /opt/mysqlapp/PerconaTool/percona-toolkit-2.2.16/bin/pt-archiver' for complete
    documentation.
  • CharlieCaoCharlieCao Entrant Current User Role Beginner
    en, add the quote do solved the problem. but I still have an issue to write into shell script. that's should be fine at least which is working manual write the command line.
    Thanks Scott for your help!
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.