Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-29 · container image gvenzl/oracle-free:23-slim
ORA-01918 comes from statements that work on a user: DROP USER, ALTER USER, or creating an object in another schema such as CREATE TABLE app_owner.orders. Oracle 23ai prints the name it looked for, in quotes: user 'APP_USER' does not exist.
The name in the message is the key. Unquoted names are converted to uppercase, so if the user was created as "app_user" (quoted, lowercase), ALTER USER app_user looks for APP_USER and fails. The three runs below were all checked against DBA_USERS first.
01DROP USER for a user that is already gone (re-running a script)
DROP USER app_user CASCADE failed with user 'APP_USER' does not exist. A count in DBA_USERS for APP_USER returned 0.
In a setup script that may run more than once, 23ai accepts DROP USER IF EXISTS app_user CASCADE. It ran without error (SQL*Plus printed User dropped. even though there was nothing to drop).
Setup
DROP USER IF EXISTS app_user CASCADE;User dropped.DROP USER app_user CASCADE;DROP USER app_user CASCADE
*
ERROR at line 1:
ORA-01918: user 'APP_USER' does not exist
Help: https://docs.oracle.com/error-help/db/ora-01918/SELECT COUNT(*) AS user_count FROM dba_users WHERE username = 'APP_USER';USER_COUNT
----------
0
1 row selected.DROP USER IF EXISTS app_user CASCADE;User dropped.02User created with a quoted lowercase name ("app_user")
The user was created as CREATE USER "app_user" .... ALTER USER app_user IDENTIFIED BY ... failed with user 'APP_USER' does not exist, because the unquoted name became APP_USER.
SELECT username FROM dba_users WHERE UPPER(username) = 'APP_USER' showed the stored name app_user in lowercase. Writing it with double quotes, ALTER USER "app_user" IDENTIFIED BY ..., returned User altered.
Setup
DROP USER IF EXISTS "app_user" CASCADE;
CREATE USER "app_user" IDENTIFIED BY "Lab#2026pw";User dropped.
User created.ALTER USER app_user IDENTIFIED BY "New#2026pw";ALTER USER app_user IDENTIFIED BY "New#2026pw"
*
ERROR at line 1:
ORA-01918: user 'APP_USER' does not exist
Help: https://docs.oracle.com/error-help/db/ora-01918/COLUMN username FORMAT A12
SELECT username FROM dba_users WHERE UPPER(username) = 'APP_USER';USERNAME
------------
app_user
1 row selected.The quotes are needed every time this user is named. Creating users without quotes avoids the problem.
ALTER USER "app_user" IDENTIFIED BY "New#2026pw";
DROP USER "app_user" CASCADE;User altered.
User dropped.03CREATE TABLE owner.table before the owner user is created
Running as system, CREATE TABLE app_owner.orders (...) failed with user 'APP_OWNER' does not exist. DBA_USERS had no APP_OWNER: the install script created tables before the schema user.
After CREATE USER app_owner ... QUOTA 10M ON users, the same CREATE TABLE succeeded and DBA_TABLES listed APP_OWNER.ORDERS.
Setup
DROP USER IF EXISTS app_owner CASCADE;User dropped.CREATE TABLE app_owner.orders (id NUMBER PRIMARY KEY, amount NUMBER);CREATE TABLE app_owner.orders (id NUMBER PRIMARY KEY, amount NUMBER)
*
ERROR at line 1:
ORA-01918: user 'APP_OWNER' does not exist
Help: https://docs.oracle.com/error-help/db/ora-01918/SELECT COUNT(*) AS user_count FROM dba_users WHERE username = 'APP_OWNER';USER_COUNT
----------
0
1 row selected.CREATE USER app_owner IDENTIFIED BY "Lab#2026pw" QUOTA 10M ON users;User created.CREATE TABLE app_owner.orders (id NUMBER PRIMARY KEY, amount NUMBER);
COLUMN owner FORMAT A10
COLUMN table_name FORMAT A10
SELECT owner, table_name FROM dba_tables WHERE owner = 'APP_OWNER';
DROP USER app_owner CASCADE;Table created.
OWNER TABLE_NAME
---------- ----------
APP_OWNER ORDERS
1 row selected.
User dropped.FAQ
How do I check whether a user exists in Oracle?
Query DBA_USERS (or ALL_USERS): SELECT username FROM dba_users WHERE username = 'APP_USER';. Names are stored in uppercase unless the user was created with quotes.
The user is in DBA_USERS but I still get ORA-01918. Why?
Check the case of USERNAME. If it is lowercase, the user was created with double quotes and must be written the same way: "app_user".
How do I drop a user only if it exists?
In 23ai use DROP USER IF EXISTS name CASCADE;. It runs without error when the user is missing.
How do I create a table in another schema that does not exist yet?
Create the user first, with a quota on its tablespace (CREATE USER app_owner ... QUOTA 10M ON users), then run CREATE TABLE app_owner.orders ....
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0