Yes, the —purge option deletes data from the source DSN without writing the data to any destination. This means there is no recovering the data that you purge, so please be careful. In fact, make a backup before you run the purge, just in case you find that you need the data after all.
If you want the table to be optimized after purging is complete, you need to add the —optimize flag.
Have you read the documentation?
In case I would like to use a dry-run, could you please share some examples with the output if possible.
pt-archiver supports an option “--dry-run” which makes no changes to the data, but shows you the SQL it would run.
I recommend first trying in a test environment while you are learning any tool that deletes data!
Do we need to execute the above pt-archiver from command prompt or mysql prompt. Because, how would it get connected without specifying the user credentials to login mysql.
All Percona Toolkit tools are executed at the command prompt. None are run from a mysql prompt.
To specify user credentials, typically your source DSN includes arguments for user and password. For example:
$ pt-archiver --source h=host,D=db,t=child,u=scott,p=tiger …other options…
Refer to the reference documentation for DSN options:
--
Bill Karwin
Senior Knowledge Manager