MORE ABOUT ME
Welcome! I’m Thomas…
Resources

How To Connect To Oracle When You Forgot Your Password

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.

  • I thought it was safe to assume your password was Bacon.

    Seriously, going back to my Oracle DB days TOAD for Oracle was a great application. It was like SSSMS before its time and better. I think it also had source control back in 2005. If you can snag a copy it might help eliminate the text commands.

    • Thomas LaRock

      Well, “bacon” didn’t work, so I really don’t know what I was thinking when I configured the instance.

      Regardless of TOAD, I would still need to be able to connect to the instance, and I couldn’t do that until I hacked my way in first (since I had forgotten the password).

  • Dave Dustin

    Is the ‘ora_dba’ group something that can be overridden, much like removing the ‘Administrators’ group from the sysadmin role in MS-SQL?

    • Thomas LaRock

      Dave,

      I would imagine that it can be overridden. Unfortunately the interface I am using to admin the Oracle instance is less than intuitive for navigation. So, I haven’t been able to find it easily. But there must be a way to override the default settings, otherwise this steamer would never pass an audit.

  • Next time just ask for help on Twitter 🙂

    • ThomasLaRock

      Jeff,

      I don’t think I knew you then, but yeah…next time!

  • Demba Ba

    Hie guys…

    I recently install Oracle R12 on Windows Xp (vision install- for my study purposes, connected to the Ms loop adapter). The thing is when I try to use the Oracle forms.. they were not opening at all. So ,I tried to run the Ad utility(adadmin) but then my access to it got locked coz I confused the passwords. Now I have to use SQLplus to unlock it..when I log in SQLplus using system / sydba it is rejected, i have tried Scott / tiger stil it does not work now Im stuck..Any help..i would appreciate it!!!

    • ThomasLaRock

      Is there an ora_dba group available? If so, is your windows account added as a member of the ora_dba group?

  • RocketX

    i am a sql+ user and i changes the user name ‘scott’ to my name and some password during installation after ~ a mounth i forgot my password and tried your code in another account but i got an error which says that i have insufficient privileges to do that
    now please take me out of this problem i am in great danger ‘cuz i have exams

    • ThomasLaRock

      RocketX,

      If the ora_dba group isn’t a login to the Oracle instance, then you are out of luck if you don’t remember your password. I’d suggest you contact the admin for the instance or think about doing a reinstall. Good luck on your exams.

  • John Matovu

    Thanks a lot. This has helped me from a similar situation.