Thursday, February 4, 2021

Lost Oracle SYS and SYSTEM password

 Lost Oracle SYS and SYSTEM password?If your administration is as good as anybodies, you are bound to loose the not-so-frequently used password for the SYS and SYSTEM users of oracle. Here are a few ways I found to re-set those passwords:

Method 1: SQLPLUS (Tested on AIX Oracle 9.2.0.1.0)
Log into the database server as a user belonging to ‘dba’ [unix ] or ‘ora_dba’ [windows ] group , typically ‘oracle’, or an administrator on your windos machine. You are able to log into Oracle as SYS user, and change the SYSTEM password by doing the following:
sqlplus "/ as sysdba"SQL*Plus: Release 9.2.0.1.0 - Production on Mon Apr 5 15:32:09 2004Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Connected to:Oracle9i Enterprise Edition Release 9.2.0.1.0 - ProductionWith the OLAP and Oracle Data Mining optionsJServer Release 9.2.0.1.0 - ProductionSQL> show userUSER is "SYS"SQL> passw systemChanging password for systemNew password:Retype new password:Password changedSQL> quitNext, we need to change the password of SYS:
sqlplus "/ as system"SQL*Plus: Release 9.2.0.1.0 - Production on Mon Apr 5 15:36:45 2004Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.SP2-0306: Invalid option.Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]where <logon> ::= <username>[/<password>][@<connect_string>] | /Enter user-name: systemEnter password:Connected to:Oracle9i Enterprise Edition Release 9.2.0.1.0 - ProductionWith the OLAP and Oracle Data Mining optionsJServer Release 9.2.0.1.0 - ProductionSQL> passw sysChanging password for sysNew password:Retype new password:Password changedSQL> quitYou should now be able to log on the SYS and SYSTEM users, with the passwords you just typed in.
Method 2: Creating pwd file (Tested on Windows Oracle 8.1.7)

  1. Stop the Oracle service of the instance you want to change the passwords of.
  1. Find the PWD###.ora file for this instance, this is usuallly located atC:\oracle\ora81\database\, where ### is the SID of your database.
  1. rename the PWD###.ora file to PWD###.ora.bak for obvious safety reasons.
  1. Create a new pwd file by issuing the command: 
  1. orapwd file=C:\oracle\ora81\database\PWD###.ora password=XXXXX
  1. where ### is the SID and XXXXX is the password you would like to use for the SYS and INTERNAL accounts.
  1. Start the Oracle service for the instance you just fixed. You should be able to get in with the SYS user and change other passwords from there.

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...