1

Here are the steps

  1. Creating the db on Oracle 12c (12.2.0.1.0)
  2. Creating the admin views and tables
  3. Starting the db in upgrade mode and running utlk32.sql
  4. Starting up is failing with these errors codes and messages
  ORA-00603: ORACLE server session terminated by fatal error
  ORA-01092: ORACLE instance terminated. Disconnection forced
  ORA-14694: database must in UPGRADE mode to begin MAX_STRING_SIZE migration

Can someone please help me to fix this
The following are the detailed steps of the commands:

orapwd file=$ORACLE_HOME/dbs/pwdorclpdb1.ora password=mypwd entries=5
sqlplus /nolog
CONNECT / AS SYSDBA
startup nomount
SET SQLBLANKLINES ON

Create the database

CREATE DATABASE mydb
 USER SYS IDENTIFIED BY mypwd 
USER SYSTEM IDENTIFIED BY mypwd 
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/mydb/redo01.log') SIZE 100M, 
        GROUP 2  ('/u01/app/oracle/oradata/mydb/redo02.log') SIZE 100M, 
        GROUP 3 ('/u01/app/oracle/oradata/mydb/redo03.log') SIZE 100M 
MAXLOGFILES 5 
MAXLOGMEMBERS 5 
MAXLOGHISTORY 1 
MAXDATAFILES 100 
MAXINSTANCES 1 
CHARACTER SET AL32UTF8 
DATAFILE '/u01/app/oracle/oradata/mydb/system01.dbf' SIZE 325M REUSE
         AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED,
        '/u01/app/oracle/oradata/mydb/system02.dbf' SIZE 325M REUSE
         AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED, 
        '/u01/app/oracle/oradata/mydb/system03.dbf' SIZE 325M REUSE 
         AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED 
SYSAUX DATAFILE '/u01/app/oracle/oradata/mydb/sysaux01.dbf' SIZE 325M REUSE 
 AUTOEXTEND ON 
EXTENT MANAGEMENT LOCAL  
DEFAULT TABLESPACE def_t DATAFILE '/u01/app/oracle/oradata/mydb/def_t.dbf' 
  SIZE 100M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED 
DEFAULT TEMPORARY TABLESPACE temp_t 
   TEMPFILE '/u01/app/oracle/oradata/mall/temp_t.dbf' SIZE 100M REUSE 
   AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED 
UNDO TABLESPACE wcs_undo_t 
   DATAFILE '/u01/app/oracle/oradata/mydb/undo_t.dbf' SIZE 200M REUSE 
   AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;

Create dictionary tables and views

@$ORACLE_HOME/rdbms/admin/catalog.sql 
@$ORACLE_HOME/rdbms/admin/catproc.sql 
@$ORACLE_HOME/sqlplus/admin/pupbld.sql 

Create users

shutdown immediate
startup
alter session set "_ORACLE_SCRIPT"=true; 
CREATE USER user1 IDENTIFIED BY mypwd DEFAULT TABLESPACE def_t TEMPORARY TABLESPACE temp_t QUOTA UNLIMITED ON def_t;
GRANT CREATE PROCEDURE, CREATE SEQUENCE, CREATE SESSION, CREATE SYNONYM, 
CREATE TABLE, CREATE TRIGGER, CREATE VIEW, CREATE MATERIALIZED VIEW TO user1;

Apply Oracle12c extended type

PURGE DBA_RECYCLEBIN;
SHUTDOWN IMMEDIATE;
STARTUP UPGRADE;
ALTER SYSTEM SET MAX_STRING_SIZE=EXTENDED;
@?/rdbms/admin/utl32k.sql 
show parameter MAX_STRING_SIZE
NAME               TYPE        VALUE
------------------ ----------- --------------
max_string_size    string      EXTENDED

SHUTDOWN IMMEDIATE;

The issue - All previous commands were successful.

STARTUP;
ORACLE instance started. 
Total System Global Area 3221225472 bytes
Fixed Size                  8625856 bytes
Variable Size            2365587776 bytes
Database Buffers          838860800 bytes
Redo Buffers                8151040 bytes
Database mounted.
ORA-00603: ORACLE server session terminated by fatal error
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-14694: database must in UPGRADE mode to begin MAX_STRING_SIZE migration
Process ID: 20774
Session ID: 2 Serial number: 387
  • Can you confirm this is not a pluggable database? – kevinsky Sep 5 '19 at 17:51
  • Yes it's not. I dont have ENABLE_PLUGGABLE_DATABASE in the .ora file, so it's FALSE (default). The create db command also didn't have any enable_pluggable_database clause – nurub Sep 5 '19 at 17:55
  • Anther comment, I tried to follow liberidu.com/blog/2013/12/24/… and it failed at the 1st command SQL> ALTER DATABASE OPEN migrate; ALTER DATABASE OPEN migrate * ERROR at line 1: ORA-00603: ORACLE server session terminated by fatal error ORA-01092: ORACLE instance terminated. Disconnection forced ORA-14693: The MAX_STRING_SIZE parameter must be EXTENDED. Process ID: 532 Session ID: 244 Serial number: 35210 – nurub Sep 5 '19 at 17:57
  • 1
    What version?.add parameter to pfile *.max_string_size='EXTENDED' and start database or add ALTER SYSTEM SET MAX_STRING_SIZE='EXTENDED' scope=spfile when database is in upgrade mode. – Kumar Sep 5 '19 at 18:57
1

I figured it out
- PURGE DBA_RECYCLEBIN;
- CREATE SPFILE FROM PFILE = '$ORACLE_HOME/dbs/initorcl.ora';
- SHUTDOWN IMMEDIATE;
- startup mount;
- ALTER SYSTEM SET MAX_STRING_SIZE=EXTENDED SCOPE=SPFILE;
- shutdown;
- STARTUP UPGRADE;
- @?/rdbms/admin/utl32k.sql
-show parameter MAX_STRING_SIZE
NAME TYPE VALUE
------------------ ----------- --------------
max_string_size string EXTENDED
- SHUTDOWN IMMEDIATE;
- STARUP;

Now startup is successful and max_string_size = EXTENDED

0

There is an Oracle bug for version 12.1 which should have been fixed but may be applicable. It can occur when you are using the DBCA or database creation tool.

Bug 15845247 If you change the MAX_STRING_SIZE initialization parameter while creating a database using DBCA with a template that includes data files, the database creation fails with the following error:

ORA-14694: database must in UPGRADE mode to begin MAX_STRING_SIZE migration

The workaround is to leave the MAX_STRING_SIZE at the default value and change it after the upgrade is successful.

  • I'm already in a newer version than 12.1. I'm using 12.2.0.1.0 – nurub Sep 5 '19 at 18:31
  • @nurub Yes, I noticed but not all bugs get fixed and some even come back. Can you upgrade successfully without changing the parameter? – kevinsky Sep 5 '19 at 18:35
  • 1
    I got it to work. I posted my changes below. Thanks @kevinsky – nurub Sep 5 '19 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.