Oracle Database parameter MAX_STRING_SIZE controls the maximum size of VARCHAR2, NVARCHAR2, and RAW data types in SQL. From Oracle Database 12c onwards, table column(s) length can be modified to greater than 4000 characters when this parameter value is set to EXTENDED.
Allowed values for this parameter are:
- STANDARD: Default value. Means that the length limits for Oracle Database releases prior to Oracle Database 12c apply (for example, 4000 bytes for VARCHAR2 and NVARCHAR2, and 2000 bytes for RAW).
- EXTENDED: Means that the 32767 byte limit introduced in Oracle Database 12c applies.
Important considerations before modifying parameter to EXTENDED:
– The COMPATIBLE initialization parameter must be set to 12.0.0.0 or higher to set MAX_STRING_SIZE = EXTENDED.
– Cannot change the value of MAX_STRING_SIZE from EXTENDED to STANDARD.
– The only way to revert is to restore the database from backup prior to running the conversion script, $ORACLE_HOME/rdbms/admin/utl32k.sql
– Database restart is required several times during modification process.
– You can change the value of MAX_STRING_SIZE from STANDARD to EXTENDED. However, you cannot change the value of MAX_STRING_SIZE from EXTENDED to STANDARD.