201902 – Oracle – What if I lost sys account password?

The company i work in the past has 1 oracle database server running on oracle 11g. It host the old e-commerce site that was no longer in use. For some reason, they still had it online for many years.

The time as long as the DBA has changed to the 5th generation.keepmyfingerscorssed

The sys account password is lost during the time passing by. What we have now is the password for system. And it could handle partial DBA responsibility.

 

I used the system password 1 year ago and now get a ORA-12154 error on could not resolve the connect identifier.

OK, let’s me find the TNSNames.ora file.

Oh, the drive host oracle has 0 byte! Very good. let me fix it first.

diskpart -> list disk -> rescan -> list disk -> list volume -> select volume 8-> extend

ORACLE_BASE: E:\Oracle12

ORACLE_HOME: E:\Oracle12\product\12.1.0\dbhome_2

After checking the file, I found that I remember the instant name wrongly. 😦

Finally I remember one thing, my domain credential as member of ora_dba. I can connect to the instance with no password.


C:\Windows\system32>sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Wed Feb 27 23:57:55 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> alter user sys identified by ABC_Password;
User altered.
SQL> exit;
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64
bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions

Now test about the new password!


C:\Windows\system32>sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Wed Feb 27 23:59:19 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> connect sys@ABC as sysdba
Enter password:
Connected.

Bravo!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s