Wednesday, August 19, 2026

How to Fix ORA-14694: Database Must Be in UPGRADE Mode for MAX_STRING_SIZE Migration

How to Fix ORA-14694: Database Must Be in UPGRADE Mode for MAX_STRING_SIZE Migration


Have you ever tried to scale up your Oracle database strings from the classic 4,000-byte limit to the glorious 32,767 bytes (EXTENDED), only to be slapped with a frustrating error during startup?

If you are seeing this,

ALTER PLUGGABLE DATABASE freepdb1 open;
* ERROR at line 1:
ORA-14694: database must in UPGRADE mode to begin MAX_STRING_SIZE migration

Don't panic. This happens because your Container Database (CDB) already transitioned its MAX_STRING_SIZE parameter to EXTENDED, but your Pluggable Database (freepdb1) hasn't finished the migration script yet. 

It is stuck in limbo. Fixing this is a quick 5-step process. Let's walk through it.

Step 1: Force the PDB into Upgrade Mode Because the database requires data type dictionary conversions, it refuses to open normally. We need to explicitly tell Oracle to open the PDB in UPGRADE mode. Log into your CDB as SYSDBA and run:

SQL> ALTER PLUGGABLE DATABASE freepdb1 OPEN UPGRADE;

Step 2: Switch Over to Your PDBNext, jump into the context of the pluggable database where the error occurred:

SQL> ALTER SESSION SET CONTAINER = freepdb1;
 
Step 3: Run the utl32k.sql Migration Script. This is where the magic happens. Oracle provides a built-in script that automatically converts your metadata and tables to support the extended string sizes. Run it directly from your SQL prompt:

SQL> @?/rdbms/admin/utl32k.sql
 
(The ? is just a built-in shortcut for your $ORACLE_HOME path).

Step 4: Restart the PDB Normally. Once the script successfully completes, your data structures are upgraded. Now, bounce the PDB to take it out of upgrade mode and open it for standard business use

SQL> ALTER PLUGGABLE DATABASE freepdb1 CLOSE;
SQL> ALTER PLUGGABLE DATABASE freepdb1 OPEN READ WRITE;

 
Step 5: Double-Check Your Work. Always verify! Run this quick check inside the PDB to confirm that your maximum string size is now officially extended

SQL> SHOW PARAMETER max_string_size;

NAME              TYPE        VALUE
----------------- ----------- ---------
max_string_size   string      EXTENDED


The ORA-14694 error looks intimidating, but it is just Oracle’s safety mechanism preventing data corruption before a major structural change. Follow these steps, and you will be handling 32K strings in no time.

Did you run into any invalid objects or compilation glitches while running utl32k.sql? Drop a comment below and let's troubleshoot!


Thanks & Regards,
Chandan Tanwani

No comments: