본문 바로가기

개발노트/LINUX

pt-online-schema-change 사용하기

pt-online-schema-change

percona tools 설치

# curl -O https://www.percona.com/downloads/percona-toolkit/3.0.8/binary/redhat/7/x86_64/percona-toolkit-3.0.8-1.el7.x86_64.rpm

# yum install percona-toolkit-3.0.8-1.el7.x86_64.rpm

확인

# pt-online-schema-change --alter "CHANGE COLUMN STRINGANSWER STRINGANSWER TEXT CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'" D=ovey,t=SURVEY_ANSWER --dry-run --ask-pass

실행

# pt-online-schema-change --alter "CHANGE COLUMN STRINGANSWER STRINGANSWER TEXT CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'" D=ovey,t=SURVEY_ANSWER --execute --ask-pass > alter.log

반응형