Conversion from CHAR to VARCHAR

The conversion from CHAR/NCHAR to VARCHAR2/NVARCHAR2 requires a complete database export/import cycle using LN tools.

When sufficient disk space is available and downtime is not a problem, complete these steps:

  1. Make a complete database export using bdbpre.
  2. Set the ora_use_varchar:1 resource.
  3. Import the database using bdbpost.

You can use Oracle tools for this migration, but full knowledge of these tools is required.

Note: An ALTER TABLE command to change the data type from CHAR to VARCHAR2 does not shrink the data size. To achieve this, more complex conversions are required.

Ensure that after conversion to VARCHAR2, the data constraints mentioned in the previous section hold.

A table with VARCHAR2 columns which violates these constraints can be repaired with this UPDATE statement:

	UPDATE <table>
       SET <column> = COALESCE(RTRIM(<column>),' ')

Tables with NVARCHAR2 columns used in Unicode mode require a slightly different statement:

UPDATE <table>
       SET <column> = COALESCE(RTRIM(<column>),N' ')