Announcement

Announcement Module
Collapse
No announcement yet.

Any way to dump out changes made to a few tables?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Any way to dump out changes made to a few tables?

    Hi,

    I need to dump out a few tables from mysql database. After that I would like to dump out the changes only for those tables. What would be the best way to do it?

    The reason for doing this is that the initial data and the subsequent delta would go into a totally different system [i.e. non-relational database], so replication would not be an option I believe.

    Please advise.

    Thank you!

  • #2
    mysqldump with --tables to get the initial dump.

    And for the delta you need to have binary logging running on the source and unfortunately the binlog will give you changes performed on all tables so you will have to filter it through grep or something to only give you the changes to the table that you want.
    Or to avoid the filtering part, if you can live with it, you can instead have a copy of the entire database and then you can configure binlog to only store changes to this database (although there can be a catch here depending on your code, read up on it in the manual).

    Or if this is a continuous ongoing thing you can set up replication where you specify which database that should be replicated to the secondary server.

    Comment


    • #3
      take full dump of selected tables and setup a replication server only for selected tables to replicate selected updates.

      Comment


      • #4
        I would suggest adding a timestamp column t_column (DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP). From this column you can base your deltas i.e. select * from t where t_column > ${last_delta_was_taken}

        Hope this helps.
        Our documentation has a lot of answers about common questions on Percona software, have you checked there before posting that question here? http://www.percona.com/forums/core/i...lies/smile.png

        Join us at the annual Percona Live MySQL Users Conference - http://www.percona.com/live/mysql-conference-2014/

        Comment

        Working...
        X