# pt-online-schema-change to change the collation of a large table?

**URL:** <https://forums.percona.com/t/pt-online-schema-change-to-change-the-collation-of-a-large-table/3562>\
**Category:** Percona Toolkit\
**Created:** [June 22, 2014, 10:14pm UTC](https://forums.percona.com/t/pt-online-schema-change-to-change-the-collation-of-a-large-table/3562 "2014-06-22T22:14:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![italiano40](https://avatars.discourse-cdn.com/v4/letter/i/e79b87/32.png) [@italiano40](https://forums.percona.com/u/italiano40)\
**Post date:** [June 22, 2014, 10:14pm UTC](https://forums.percona.com/t/pt-online-schema-change-to-change-the-collation-of-a-large-table/3562/1 "2014-06-22T22:14:25Z")

</div>

How can I structure this call?

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [June 29, 2014, 1:50pm UTC](https://forums.percona.com/t/pt-online-schema-change-to-change-the-collation-of-a-large-table/3562/2 "2014-06-29T13:50:31Z")

</div>

I think general character set and collation is latin1 and latin1\_swedish\_ci respectively and if you change the default collation of a table, each column you create in that table will get that collation. Anyway, you can change table collation by using [pt-online-schema](http://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html) change tool something like below.

$ pt-online-schema-change --alter ‘convert to character set utf8 collate utf8\_unicode\_ci’ --statistics --execute h=server,D=db\_name,t=table\_to\_alter,u=dbuser

This will update the table character set to utf8 and collation to utf8\_unicode\_ci for target table.
