DROP USER fails with "ORA-01918: user does not exist" when username contains newline (Doc ID 1665546.1)

Last updated on SEPTEMBER 16, 2015

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.

Symptoms

A DROP USER command fails even though the user appears in DBA_USERS.  Unlike Note 1297361.1, the username has been specified in the correct case and in double quotes.

Inspecting the username using the LENGTH function reveals that the username contains an extra, unprintable, character.  

For example, for a username of "ops$scott", which is 9 characters long, the following would be observed:

SQL> select length(username) x from dba_users where username like 'ops$scott%';

        X
----------
       10

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