Execute Immediate Create User Identified Globally Fails 'ORA-00922: missing or invalid option' / 'ORA-00911: invalid character' / 'ORA-00972: identifier is too long'

(Doc ID 2365542.1)

Last updated on FEBRUARY 26, 2018

Applies to:

Advanced Networking Option - Version 11.2.0.4 and later
Information in this document applies to any platform.

Goal

Create user from dynamic SQL  EXECUTE IMMEDIATE CREATE USER IDENTIFIED GLOBALLY failing:

Trying to execute a simple "create user ... IDENTIFIED GLOBALLY as '' from dynamic SQL.

declare
cn VARCHAR2(1000):='CN=user1,OU=Laptop Users,OU=Active Accounts,DC=int,DC=us,DC=oracle,DC=com';
begin
execute immediate 'create user USER1 IDENTIFIED GLOBALLY as '||CHR(34)||cn||CHR(34)||' ;';
end;

declare
*
ERROR at line 1:
ORA-00972: identifier is too long
ORA-06512: at line 4

or

*
11.2.0.4 DB Error:
ERROR at line 1:
ORA-00911: invalid character
ORA-06512: at line 4

or


12.1.0.2 DB Error:
ERROR at line 1:
ORA-00922: missing or invalid option
ORA-06512: at line 4

Solution

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