Q

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?

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?
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

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close