简体   繁体   中英

ORA-01017 invalid username/password logon denied

I am working on a homework problem. I need to get Oracle 12c working with sqldeveloper on Windows and I'm getting:

Test failed: ORA-01017: invalid username/password; logon denied.

Steps I've tried:

  1. alter user sys as identified by "<password>" , then alter user sys account unlock

  2. Select username/password from dba_users - this gives me an output that looks very unclean, ie the format

    USERNAME ------------------------------------------------------------------------------ PASSWORD -------------------------------------------------------------------------------- THINK THIS IS A USERNAME THINK THIS IS A PASSWORD

SOME WORDS

This repeats itself. Assuming the first response is a username and the second is a password, I have tried various combinations of the two. Then I have tried various combinations of the first and third, still no luck. I have unlocked multiple accounts, used quite a few of them. no luck.

  1. Found my tsnames.ora, I don't see anything that looks like a username and password. I do see that it's using localhost and port 1521, which I have in my SQL Developer

  2. Ran Select instance from v$thread; in SQL and got back orcl, used that as my SID

  3. Tried various connection types, including PDBORCL and PDBORCL doesn't seem to be an option for me.

  4. Tried to re-install Oracle 12g, I don't see anywhere where it had asked me for a username. It did ask for a password under global db name. I tried a combination of that password and either SYS or my oracle account online, nothing.

  5. Set my tnsnames directory in advanced settings under preferences in sql developer

  6. Tried to unlock the scott/tiger account - this doesn't seem to be a valid account in 12g

  7. Requested a new password from https://profile.oracle.com , tried that. Same error.

  8. Tried the instructions here, no dice: https://oracle-base.com/articles/misc/os-authentication

  9. ran lsnrctl status and confirmed sql is running

  10. Looked at quite a few stack overflow links

  11. Got the container name as CDB$ROOT and ID of 1. Added USE_SID_AS_SERVICE_CDB$ROOT=on in my listener.ora file and restarted lsnrctl

My tnsnames.ora:

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
  (SID = CLRExtProc)
  (PRESENTATION = RO)
)
)

ORCL =

(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.national.x.com) ) )

OK! So if Oracle doesn't prompt you for a username, the default username is SYSTEM.

SO! Username: SYSTEM
Password: The password i entered on creating the Db (or my account pw, i named them both the same)
sid must be orcl, if not set it as above
localhost and port must match whats in tnsnames.ora

And that solves it! Hopefully someone else will find this helpful and not go down as many rabbit holes as I did

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM