'PLS-00103: Encountered the symbol “USERENV” when expecting one of the following * & = – + ; ' During Database Upgrade to 12.1 (Doc ID 2224806.1)

Last updated on APRIL 17, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.1 to 12.1.0.2 [Release 12.1]
Information in this document applies to any platform.

Symptoms

Error during Database upgrade from 11.2 to 12.1 using DBUA, even manual upgrade fails with same error:

19:18:56 49 — SYS_FBA_PARTITIONS
19:18:56 50 execute immediate
19:18:56 51 q’#create table SYS_FBA_PARTITIONS
19:18:56 52 ( OBJ# number,
19:18:56 53 PARTITIONSCN number not null,
19:18:56 54 FLAGS number,
19:18:56 55 SPARE number) #’;
19:18:56 56
19:18:56 57 — SYS_FBA_USERS
19:18:56 58 execute immediate
19:18:56 59 q’#create table SYS_FBA_USERS
19:18:56 60 ( FA# number,
19:18:56 61 USER# number not null,
19:18:56 62 FLAGS number,
19:18:56 63 unique (FA#, USER#)) #’;

declare
*
ERROR at line 1:
ORA-00904: : invalid identifier
ORA-06512: at line 58

*
*
*
*
19:21:07 50 select o.*,
19:21:07 51 !’ || — drop back into PL/SQL to define the columns conditionally
19:21:07 52 case when use_new_cols then ”
19:21:07 53 else ‘null, 0, 0, 0, ‘ end || q’!
19:21:07 54 o.spare3,
19:21:07 55 case when (o.type# not in (select ue.type# from user_editioning$ ue
19:21:07 56 where ue.user# = o.spare3) or
19:21:07 57 bitand(o.flags, 1048576) = 1048576 or
19:21:07 58 bitand(u.spare1, 16) = 0) then
19:21:07 59 null
19:21:07 60 when (u.type# = 2) then
19:21:07 61 (select eo.name from obj$ eo where eo.obj# = u.spare2)
19:21:07 62 else
19:21:07 63 ‘ORA$BASE’
19:21:07 64 end
19:21:07 65 from obj$ o, user$ u
19:21:07 66 where o.owner# = u.user#
19:21:07 67 and ( /* non-versionable object */
19:21:07 68 ( ( o.type# not in (select type# from user_editioning$ ue
19:21:07 69 where ue.user# = o.spare3)
19:21:07 70 and o.type# != 88)
19:21:07 71 or bitand(o.flags, 1048576) = 1048576
19:21:07 72 or bitand(u.spare1, 16) = 0)
19:21:07 73 /* versionable object visible in current edition */
19:21:07 74 or ( o.type# in (select ue.type# from user_editioning$ ue
19:21:07 75 where ue.user# = o.spare3)
19:21:07 76 and ( (u.type# <> 2 and
19:21:07 77 sys_context(‘userenv’, ‘current_edition_name’) = ‘ORA$BASE’)
19:21:07 78 or (u.type# = 2 and

*
ERROR at line 77:
ORA-06550: line 77, column 34:
PLS-00103: Encountered the symbol “USERENV” when expecting one of the
following:
* & = – + ; < / > at in is mod remainder not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or
like like2 like4 likec between into using || bulk member
submultiset

RDBMS Component remains invalid, rest other components are valid in Alert log.

SERVER COMPONENT id=CATPROC: timestamp=2016-09-19 18:08:28
Mon Sep 19 18:08:29 2016
Thread 1 advanced to log sequence 149 (LGWR switch)
Current log# 2 seq# 149 mem# 0: /u01/app/oracle/oradata/redo02.log
Mon Sep 19 18:08:41 2016
SERVER COMPONENT id=RDBMS: status=INVALID, version=12.1.0.2.0, timestamp=2016-09-19 18:08:41
Mon Sep 19 18:08:47 2016
Thread 1 cannot allocate new log, sequence 150

 

Changes

 Error is raised during Database upgrade.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms