Reputation: 677
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:
alter user sys as identified by "<password>"
, then alter user sys account unlock
Select username/password from dba_users
- this gives me an output that looks very unclean, i.e. 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.
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
Ran Select instance from v$thread;
in SQL and got back orcl, used that as my SID
Tried various connection types, including PDBORCL and PDBORCL doesn't seem to be an option for me.
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.
Set my tnsnames directory in advanced settings under preferences in sql developer
Tried to unlock the scott/tiger account - this doesn't seem to be a valid account in 12g
Requested a new password from https://profile.oracle.com, tried that. Same error.
Tried the instructions here, no dice: https://oracle-base.com/articles/misc/os-authentication
ran lsnrctl status and confirmed sql is running
Looked at quite a few stack overflow links
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) ) )
Upvotes: 4
Views: 37817
Reputation: 677
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
Upvotes: 7