zoukankan      html  css  js  c++  java
  • pt-osc使用一则

    1.使用前备份

    mysqldump -uroot -p fission_statistics room_break_history > room_break_history_20170704.dump

    2.pt-osc执行DDL

    pt-online-schema-change --user='root' --host='localhost' --ask-pass --alter "CHANGE break_type break_type INT(11) NOT NULL,CHANGE app_id app_id INT(11) NOT NULL,CHANGE room_id room_id INT(11) NOT NULL,CHANGE from_user_id from_user_id INT(11) NOT NULL,CHANGE to_user_id to_user_id INT(11) NOT NULL,CHANGE content_type content_type INT(11) NOT NULL,CHANGE source_message source_message VARCHAR(1536) CHARSET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,CHANGE send_message send_message VARCHAR(1536) CHARSET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,CHANGE request_type request_type INT(4) NOT NULL,CHANGE handle_type handle_type INT(11) NOT NULL,CHANGE handle_uid handle_uid INT(11) NOT NULL,CHANGE create_time create_time DATETIME NOT NULL,DROP INDEX idx_from_user_id,ADD  INDEX idx_handle_time (handle_type, create_time)" D=fission_statistics,t=room_break_history --execute

    3.只输出测试结果

    ./bin/pt-online-schema-change --user='root' --host='localhost' --ask-pass -S /tmp/mysql.sock --alter "ADD  INDEX idx_from_user_id (from_user_id,room_id,handle_type, create_time)" D=fission_statistics,t=room_break_history --dry-run --print

  • 相关阅读:
    关于token的理解
    JavaScript 中 call()、apply()、bind() 的用法
    常用JS整理
    js里面for循环的++i与i++
    前端命名规范
    H5混合开发app常用代码
    jquery知识巩固
    水平垂直居中(固定宽不固定宽)
    css3新属性运用
    bug笔记(pc)
  • 原文地址:https://www.cnblogs.com/geek-ace/p/7115826.html
Copyright © 2011-2022 走看看