oracle-databaseoracle19c

Getting this error in oracle 19c ORA-01017: invalid username/password; logon denied


I have created user in oracle 19c and grant privileges, but i am not able to login using that user getting logon denied error.

I have logged from command prompt sqlplus / as sysdba

then i created user

create user "c##keyan" identified by "keyan123";

i grant the following privileges

    grant connect to "c##keyan";
    grant dba to "c##keyan";
    grant resource to "c##keyan";
    grant create session  to "c##keyan";

my listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = ORCL)
      (ORACLE_HOME = H:\WINDOWS.X64_193000_db_home)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = ORCL)
      (ORACLE_HOME =  H:\WINDOWS.X64_193000_db_home)
    )
  )

my tnsnames.ora

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

after this i exit from the sql prompt and again login from the command prompt sqlplus c##keyan/keyan123@//localhost:1521/orcl

I am getting this error ERROR:

ORA-01017: invalid username/password; logon denied

Did i missed something? Please advice.


Solution

  • Remove the quotation marks from the username to avoid creating a case sensitive username. Case sensitive passwords are fine, but case sensitive usernames create several problems.

    If you really need a case sensitive username, you must always use it with quotation marks. And on Windows, you need to escape those quotation marks and log in like this:

    sqlplus \"c##keyan\"/keyan123@orcl
    

    Also, are you sure you want to use the CDB instead of the PDB? You likely want to do almost all of your work inside a PDB instead of a CDB. (Or re-install with the "traditional" architecture and avoid all this unnecessary multitenant complexity.)