Unused Columns - Oracle to Aurora MySQL Migration Playbook
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Unused Columns

Feature compatibility Amazon SCT / Amazon DMS automation level Amazon SCT action code index Key differences

No compatibility

No automation

N/A

MySQL doesn’t support unused columns.

Oracle Usage

Oracle provides a method to mark columns as unused. Unused columns aren’t physically dropped, but are treated as if they were dropped. Unused columns can’t be restored. Select statements don’t retrieve data from columns marked as unused and aren’t displayed when running a DESCRIBE table command.

The main advantage of setting a column to UNUSED is to reduce possible high database load when dropping a column from a large table. To overcome this issue, a column can be marked as unused and then be physically dropped later.

To set a column as unused, use the SET UNUSED clause.

Examples

ALTER TABLE EMPLOYEES SET UNUSED (COMMISSION_PCT);
ALTER TABLE EMPLOYEES SET UNUSED (JOB_ID, COMMISSION_PCT);

Display unused columns.

SELECT * FROM USER_UNUSED_COL_TABS;

TABLE_NAME  COUNT
EMPLOYEES   3

Drop the column permanently (physically drop the column).

ALTER TABLE EMPLOYEES DROP UNUSED COLUMNS;

For more information, see CREATE TABLE in the Oracle documentation.

MySQL Usage

Currently, Amazon Aurora MySQL doesn’t provide a comparable alternative for unused columns.