Skip to content

Instantly share code, notes, and snippets.

@gzxultra
Last active October 30, 2017 03:00
Show Gist options
  • Save gzxultra/762507f40fb3ac7d99fcf3f9d43ecaf3 to your computer and use it in GitHub Desktop.
Save gzxultra/762507f40fb3ac7d99fcf3f9d43ecaf3 to your computer and use it in GitHub Desktop.
examples for pt-online-schema-change
```shell
pt-online-schema-change \
--execute \
--no-check-alter \
--ask-pass \
--recursion-method none \
--set-vars lock_wait_timeout=3 \
--alter "change serial_code warehouse_code varchar(100) not null default ''" \
u=xcf,h=xcfapp-mysql,D=xcf_mfarm,t=fresh_warehouse
pt-online-schema-change \
--execute \
--no-check-alter \
--ask-pass \
--recursion-method none \
--set-vars lock_wait_timeout=3 \
--alter "add column url varchar(100) not null default ''" \
u=xcf,h=devdb,D=xcf_mfarm,t=explore_tab
pt-online-schema-change \
--execute \
--no-check-alter \
--ask-pass \
--recursion-method none \
--set-vars lock_wait_timeout=3 \
--alter "add column data_json blob" \
u=xcf,h=devdb,D=xcf_mfarm,t=fresh_warehouse
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment