21 Sep How To Connect To Oracle When You Forgot Your Password
Back in July I installed an instance of Oracle on my laptop. It is now September. Late September, actually, and almost a full three months since I installed that instance. Can you guess what I may have forgotten in that time? That’s right, I forgot the password. Actually, I forgot more than just the password, I couldn’t even remember that the Oracle equivalent of ‘sa’ is named ‘SYS’. And even after I found the SYS name I just could not remember the password.
I pinged one of my colleagues at Confio for some help. His first reply suggested that there wasn’t much he could do for me since it would require using a command window and he wasn’t sure that a MS SQL Server DBA was able to use a command line interface (well, he wasn’t sure that *I* could use one, but I think he was being polite by grouping me in with others. I work with some truly thoughtful people.)
He did, however, point me in the direction of the local Windows group named ora_dba. Apparently it is possible for me to add my local account to this group and then I can get access to the instance through SQL*Plus. So I did that…and it didn’t work.
[Bonus points awarded to the person that explains why.]
It didn’t work because I needed to bounce the instance (obviously). And once I did that I was able to connect by issuing the following command:
>sqlplus "/ as sysdba"
After connecting I was able to reset the password
>alter user sys identified by <whatever pwd you want>;
After that I was finally able to connect to the Database Control panel in my browser.
So there you go, an easy way to get access to your Oracle instance should you ever forget your password, and your DBA hasn’t locked things down.