0

after installing oracle 19 C it was asking for username and password. what to type in that and how to create a new user with all permissions and authentication rights.(note i tried create user command by login as SYSDBA but it showing error as invalid common user or role name. enter image description here

[enter image description here][2]

Jon Heller
  • 34,999
  • 6
  • 74
  • 132
vamsi saggurthi
  • 71
  • 1
  • 3
  • 12
  • 3
    Possible duplicate of [error: ORA-65096: invalid common user or role name in oracle](https://stackoverflow.com/questions/33330968/error-ora-65096-invalid-common-user-or-role-name-in-oracle) – gile Sep 22 '19 at 09:29

3 Answers3

2

create user c##yourusername identified by tiger;

1

To create a user in a particular container do follows:

  • alter session set container
  • Crate user

Example:

  • alter session set "_ORACLE_SCRIPT"=true;
  • CREATE USER your_user_name IDENTIFIED BY your_password

After finished user creation please add grant permission to your user. Otherwise you may not be able to login in with this user.

  • GRANT Dba to your_user_name
Subarata Talukder
  • 5,407
  • 2
  • 34
  • 50
  • The above example does not actually match the description. The command `alter session set "_ORACLE_SCRIPT"=true;` is *not* a way to set the container. It's an undocumented command that lets you ignore Oracle's error which is telling you that you're not logged into a PDB. Running that command will "work", but it creates the user in the wrong place and will cause problems later. The real solution is to ensure you're connecting to a PDB instead of the CDB root. – Jon Heller Jun 11 '23 at 05:16
-1
alter session set "_ORACLE_SCRIPT"=true;

After execute the above script user has been created.

4b0
  • 21,981
  • 30
  • 95
  • 142
ARUN
  • 9
  • Welcome to Stack Overflow! Please read [answer] and [edit] your answer to contain an explanation as to why this code would actually solve the problem at hand. Always remember that you're not only solving the problem, but are also educating the OP and any future readers of this post. – Adriaan Dec 09 '22 at 08:39