max_string_size
Cap on VARCHAR2, NVARCHAR2 and RAW column sizes: 4000 bytes STANDARD or 32767 bytes EXTENDED.
- デフォルト
STANDARD- Range
- STANDARD, EXTENDED
- Restart needed
- はい
- Default checked on
- Oracle AI Database 26ai / 23ai
何ができるか
EXTENDED requires compatible 12.0.0 or higher and a one-way procedure: restart with the new value, run utl32k.sql, restart again. Inside a PDB it can be raised for that PDB alone. Index key limits still follow the block size, so indexing an extended column beyond the key limit fails with ORA-01450.
デフォルト値
STANDARD. STANDARD (Oracle 23ai/26ai).
Check the current value
SHOW PARAMETER max_string_size SELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable FROM v$parameter WHERE name = 'max_string_size'; -- What the SPFILE holds, which is what applies at the next startup: SELECT value FROM v$sppparameter WHERE name = 'max_string_size';
Change it
ALTER SYSTEM SET max_string_size = EXTENDED SCOPE=SPFILE; -- then SHUTDOWN IMMEDIATE and STARTUP
Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).
When to change it
When applications must store more than 4000 bytes per column and a CLOB does not fit the data model or the tooling.
What can go wrong
Going back to STANDARD means shrinking every extended column first, and clients or drivers that assume 4000 bytes can truncate or reject longer values.
Questions about max_string_size
What is the default value of max_string_size in Oracle?
STANDARD. STANDARD (Oracle 23ai/26ai).
Does changing max_string_size require a restart?
Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).
When should I change max_string_size?
When applications must store more than 4000 bytes per column and a CLOB does not fit the data model or the tooling.
Back to all Oracle settings, or check the Oracle manual for every option.
Check max_string_size on your own server
SQLly runs the query above against Oracle and the other engines in this reference, from one desktop app on macOS, Windows and Linux.
このページのテキストとデータ: CC BY 4.0、出典は SQLly (sqlly.app) と明記してください。 コードと SQL スニペット: MIT. ライセンスの詳細