Oracle 32k Field Extension Usage Test
More than 12C can be extended with 32k
Here's a set of tests to create a table in the 18c environment, using the 32k field varchar2
SQL> create table tab32k (name varchar2(32768)); create table tab32k (name varchar2(32768)) * ERROR at line 1: ORA-00910: specified length too long for its datatype SQL> create table tab32k (name varchar2(32767)); Table created. ---->32k The actual maximum is 32767 bytes. SQL> select userenv('language') from dual; USERENV('LANGUAGE') ---------------------------------------------------- AMERICAN_AMERICA.AL32UTF8 18c Environment utf8
Data insertion test
UTF8 A Chinese is 3 bytes, and the maximum 32k extension is 32767, 32767_3 = 10922.3.
The actual insertion test is 10 922 Chinese
Export dmp to 11g test
[ora18c@oradb dump]$ expdp admin/oracle@pdb18c directory=dump dumpfile=ora18c_admin.dmp schemas=admin version=11.2.0.4
warning: Oracle Data Pump is exporting from a database that supports long identifiers to a version that does not support long identifiers.
dmp is parsed into sql, and the table after 32k extension is not exported after testing
[ora18c@oradb dump]$ vi m.sql
-- CONNECT ADMIN ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1'; ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1'; ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1'; ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1'; ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1'; ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 '; -- new object type path: SCHEMA_EXPORT/USER CREATE USER "ADMIN" IDENTIFIED BY VALUES 'S:7A5ACCB1287AB38907CAFFF503424A0D675A2715EB61A2593620AFC33C92;T:DE8BE8ECA479D976F2235D53C3AED03C36EDEED3 4943A545DE4A53BEA9E334A5AC5457FDB57F647B98CCD7F84B4264DC7DD68F7FB127D321D2812DCCD7DC187D573F40CFABEFCE73117169B87BFEBDFD' DEFAULT COLLATION "USING_N LS_COMP" DEFAULT TABLESPACE "ADMIN" TEMPORARY TABLESPACE "TEMP"; -- new object type path: SCHEMA_EXPORT/SYSTEM_GRANT GRANT UNLIMITED TABLESPACE TO "ADMIN"; -- new object type path: SCHEMA_EXPORT/ROLE_GRANT GRANT "DBA" TO "ADMIN"; -- new object type path: SCHEMA_EXPORT/DEFAULT_ROLE ALTER USER "ADMIN" DEFAULT ROLE ALL; -- new object type path: SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA BEGIN sys.dbms_logrep_imp.instantiate_schema(schema_name=>SYS_CONTEXT('USERENV','CURRENT_SCHEMA'), export_db_name=>'PDB18C', inst_scn=>'1589586'); COMMIT; END; /
Import to 19c
ORA-39083: Object type TABLE:"ADMIN"."TAB32K" failed to create with error: ORA-00910: specified length too long for its datatype Failing sql is: CREATE TABLE "ADMIN"."TAB32K" ("NAME" VARCHAR2(32767 BYTE)) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ADMIN"
Because 19c did not open 32k extension, the same error was reported