# How to add a row compression to a DB2 table TAB1?

DB2DatabaseBig Data Analytics

#### Learn Azure Cosmos DB basics this weekend in 3 hour

36 Lectures 4.5 hours

A compression is used to save the DB2 disk space. The compression can be used either at row level or at a page level. In order to add a row compression in a DB2 table, we can give the following command−

ALTER TABLE DBSET1.TAB1 COMPRESS YES STATIC

We have to use ALTER TABLE for the compression of the DB2 table. The ALTER TABLE reserved words are followed by the name of DB2 table qualified by database.

COMPRESS YES STATIC will complete the row compression for the said table.

Updated on 12-Sep-2020 14:25:22