Changing a char address field to varchar

We have an existing production database (recently upgraded to 10g) that has a table with a char(30) address field, and of course now it needs to be lengthened. I'd like to change this to a varchar(100). There are about 300,000 records. What's the best way to go about this?

    Requires Free Membership to View

One simple command should do the trick:
ALTER TABLE my_table MODIFY (my_col VARCHAR2(100));
The biggest concern here is that when the column's value is updated, it may not have enough room in the block to expand should the PCTFREE setting be too low. This can lead to row migration, which can hamper application performance. If you feel your PCTFREE storage parameter is too low for your table, then you might want to reorganize the table.

This was first published in October 2005

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.