I got ” ORA-01917: user or role does not exist ” error in Oracle database.
ORA-01917: user or role does not exist
Details of error are as follows.
ORA-01917: user or role 'string' does not exist. Cause: There is not a user or role by that name. Action: Re-specify the name. SQL> grant sysdba to mehmet; grant sysdba to mehmet * ERROR at line 1: ORA-01917: user or role 'mehmet' does not exist
user or role ‘string’ does not exist
This ORA-01917 error is related with the user or role by that name.
Re-specify the name or create the related user as follows.
SQL> grant sysdba to mehmet; grant sysdba to mehmet * ERROR at line 1: ORA-01917: user or role 'mehmet' does not exist SQL> create user mehmet identified by deveci; User created. SQL> grant sysdba to mehmet; Grant succeeded. SQL>
Created a schema to install a system but everything I try to do I get the ORA-01917 message: user or role ‘X’ does not exist, but the schema exists, I can view it but I can’t do anything. I am asking the Support assistance to identify the issue.
SQL> select username from dba_users where username='test_user'; USERNAME ------------------------------ test_user <<<<<<<<<<<<<<<<<<<<< User exist in the database SQL> select * from test_user.table1; select * from test_user.tableq * ERROR at line1: ORA-00942: table or view does not exist SQL> grant create session to test_user; <<<<<<<< But hitting ORA-1917, user test_user does not exist grant create session to test_user * ERROR at line 1: ORA-01917: user or role 'TEST_USER' does not exist SQL> drop user test_user cascade; <<<<<<<<<<<<<< While dropping this user, again Oracle says user does not exist drop user test_user cascade * ERROR at line 1: ORA-01918: user 'TEST_USER' does not exist drop user test_user cascade; <<<< Throws USER does not exist error message
ORA-01918 found because the user should have been created with double quote and forced Oracle to create the user in lower case
In the 1st query result from dba_user, you are seeing test_user in dba_users instead of TEST_USER, by default the username is saved in Upper case only.
Only if the user is created forcefully with lower case using double quotes, then the user will get stored in Lower case.
For example:
create user “test_user” identified by ………….
Because of the usage of double quotes, the username will be forced to be stored as lower case.
So kindly try out :
SQL> select * from "test_user".table1; <<<<<<<<<<<< You should be able to fetch the result and/or SQL> drop user "test_user" cascade; <<<<<<<<<<<< This would drop this user, because we are using double quotes
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )