Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Questions and answers begin here Logo Questions and answers begin here Logo
Sign InSign Up

Questions and answers begin here

Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Blog
  • Contact Us

Error ORA-65096 Invalid common user or role name in Oracle Database.

Home/ Questions/Q 242
Next
Answered
Error ORA-65096 Invalid common user or role name in Oracle Database.
pulczynskaa
pulczynskaa Teacher

I have been working on an Oracle database and encountered an error message that says “ORA-65096: invalid common user or role name”. I have checked the user name and role name multiple times, and they both seem valid to me. Can anyone help me identify what could be causing this error?
Here is a code snippet that shows the user and role creation statements that I executed:

CREATE USER my_user IDENTIFIED BY my_password;
GRANT CONNECT, RESOURCE, DBA TO my_user;
CREATE ROLE my_role;
GRANT my_role TO my_user;

I executed these statements in SQL Developer, and they didn’t throw any errors. However, when I try to execute a query using the user, I get the ORA-65096 error message. I have also tried dropping and recreating the user and role, but it hasn’t resolved the issue.
Any insights from the community would be greatly appreciated! I’m relatively new to database management, so please let me know if there’s any additional information that would be helpful.

databaseerrorinvalid-common-useroraclerole-namesecuritysql
  • 662
  • 0 Followers
  • 1
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    andreacortesi Teacher
    2019-06-25T20:09:32+00:00Added an answer about 4 years ago

    Hey there! I understand that you are facing an issue with the “ORA-65096: invalid common user or role name” error in Oracle database. Let me explain it to you in a detailed manner.
    This error occurs when you are creating a common user names or role names that do not follow the standard naming conventions. The basic rule is to follow the naming conventions and make the names unique within the PDB. The naming convention requires that the names start with C## or c## for common users and R## or r## for common roles, where ## is any integer value between 00 and 99.
    Another aspect to note is that the common user or role name should also not conflict with any reserved words. A reserved word is a word that the system has reserved for a specific purpose, and it cannot be used as a common user or role name. Some examples of reserved words include SELECT, INSERT, UPDATE, DELETE, and others.
    To solve this error, try to rename the common user or role name to follow the standard naming conventions and avoid any conflicts with reserved words. One other thing to check is if you have the necessary privileges to create the common user or role.
    If you still face the same error, then you can try to check if any different processes are running in the database that are using the same name as the common user or role name that you are trying to create. In that case, you can either use a unique name or kill the process using the same name.
    In conclusion, ensuring that the naming convention is followed and the name is unique within PDB can solve the “ORA-65096: invalid common user or role name” error in Oracle database. Also, make sure to avoid reserved words and check for any other process using the same name. I hope this helps you. Good luck!

    • 165
    • Reply
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. serilas Pundit
    2019-06-30T20:58:43+00:00Added an answer about 4 years ago

    If you’re getting the error “ORA-65096: invalid common user or role name” in Oracle Database, it means that the name you are trying to create for a user or role is not valid. In particular, it could be because the name you are trying to use is a reserved word or contains special characters that are not allowed.
    To fix this error, you need to choose a new name for your user or role that is valid according to Oracle’s rules. Typically, this means avoiding reserved words and using only letters, numbers, and underscores in your name.
    One possible approach is to use a naming convention that includes a prefix or suffix to ensure that your name is unique and follows the rules for valid user and role names. For example, you could use a prefix like “usr_” or “rol_” to indicate that this is a user or role respectively, and then add a unique identifier to the end of the name.
    Another option is to consult the Oracle Database documentation or seek help from a Oracle database administrator or expert to ensure that your chosen name is valid and follows best practices. By following these guidelines and choosing a valid name, you can avoid the “ORA-65096: invalid common user or role name” error and create your new user or role with confidence.

    • 23
    • Reply
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  3. svetlanko_11 Teacher
    2019-06-30T17:53:35+00:00Added an answer about 4 years ago

    To fix the ORA-65096 error, you need to make sure that the name of the role or user doesn’t conflict with any of the Oracle’s reserved keywords. A possible solution is to modify the name of the user or role to avoid the keywords. If you’re using a keyword, ensure that it’s enclosed with quotes.

    For example, let’s say you’re trying to create a role named “SELECT”, which is a reserved keyword in Oracle. Here’s how you can avoid the error:

    CREATE ROLE “MY_SELECT_ROLE”;

    By enclosing the role name in quotes, you’re telling Oracle that it should be treated as a literal value, and not as a reserved keyword. This is just an example, you should try to use a more specific and relevant name for your role.

    In summary, ORA-65096 error occurs when you’re trying to create a role or user with a name that conflicts with Oracle’s reserved keywords. The solution is to modify the name to avoid the keywords or to use quotes to escape them.

    • 18
    • Reply
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  4. yannilebar Teacher
    2019-06-30T18:43:08+00:00Added an answer about 4 years ago

    To fix the ‘ORA-65096: invalid common user or role name’ error in Oracle Database, ensure that the username that you are attempting to create does not already exist as a keyword in Oracle or as a predefined SQL language keyword. In other words, avoid using reserved words such as ‘CREATE’ or ‘SELECT’. You can avoid this problem by prefixing your username with a prefix such as ‘C##’ and then the actual name you would like to use.
    For example, if you want to create a user with name ‘test’, you can use ‘C##test’ instead. This solution eliminates the problem of common user names and predefined SQL language keywords. You can add this prefix to your user name using the following syntax:
    ‘CREATE USER C##username IDENTIFIED BY password’
    This should help you create a new user without running into any naming issues.

    • 13
    • Reply
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  5. linaparraante Teacher
    2019-06-27T12:28:29+00:00Added an answer about 4 years ago

    When you encounter an ORA-65096 error in Oracle, it means that you’ve tried to create a user or role that starts with C##, but you didn’t have the “common” privilege first. One solution to the problem is to grant the “common” privilege to the user who’s creating the new user or role. This can be done using the GRANT COMMON_USER_OR_ROLE privilege statement.

    In some cases, though, the user you’re trying to grant privilege to might not have enough permissions to do so. If that’s the case, you can try logging in as a different user with necessary permissions, creating the user or role with the needed privileges, and then granting the common privilege to the user you’re originally trying to add.

    Furthermore, some versions of Oracle may have different requirements for whether a C## user or role should be created by a common user. As such, you should check the documentation for your specific version of Oracle to verify these requirements.

    Overall, the solution for this error depends on your specific situation and database. However, by ensuring that the user creating the user or role has the necessary “common” privilege and checking for any version-specific requirements, you can typically resolve this issue without much trouble.

    • 1
    • Reply
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.