ORA-01917: user or role does not exist

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 )

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *