zoukankan      html  css  js  c++  java
  • pttablesync

    高效的同步MySQL表之间的数据,他可以做单向和双向同步的表数据。他可以同步单个表,也可以同步整个库。它不同步表结构、索引、或任何其他模式对象。所以在修复一致性之前需要保证他们表存在。
     
    使用范例:
    pt-table-sync --replicate=lgj.checksums h=127.0.0.1,u=repl,p=oracle h=192.168.56.57,u=repl,p=oracle --print
     
    参数的意义:
    --replicate=  :指定通过pt-table-checksum得到的表,pt-table-checksum和pt-table-sync这2个工具差不多都会一直用。
    --databases=  : 指定执行同步的数据库,多个用逗号隔开。
    --tables=     :指定执行同步的表,多个用逗号隔开。
    --sync-to-master :指定一个DSN,即从的IP,他会通过show processlist或show slave status 去自动的找主。
    h=127.0.0.1   :服务器地址,命令里有2个ip,第一次出现的是Master的地址,第2次是Slave的地址。
    u=repl        :帐号。
    p=oracle      :密码。
    --print       :打印,但不执行命令。
    --execute     :执行命令。
     
    注意:要是表中没有唯一索引或则主键则会报错,故要用pt-table-sync修复必须要有主键。
    Can't make changes on the master because no unique index exists at /usr/local/bin/pt-table-sync line 10591.
  • 相关阅读:
    ArrayList用法
    MessageBox
    将文本文件导入Sql数据库
    在桌面和菜单中添加快捷方式
    泡沫排序
    Making use of localized variables in javascript.
    Remove double empty lines in Visual Studio 2012
    Using Operations Manager Connectors
    Clear SharePoint Designer cache
    Programmatically set navigation settings in SharePoint 2013
  • 原文地址:https://www.cnblogs.com/l10n/p/7518378.html
Copyright © 2011-2022 走看看