Oracle Database and Windows.

Oracle Database and Windows.

Oracle Database on Windows always marches to its own drums. And most of the time, you should tag along because some of your Unix/Linux experiences are not applicable. Let's talk about password files.

I'm not sure about "2Day DBAs," but anyone who has ever ruined a real production database knows that the password file is where DBA users store their encrypted password hashes. and this file is $ORACLE_HOME/dbs/orapw$ORACLE_SID.ora. Windows, for some reason, does not use the same folder and filename as all other operating systems do. For the Windows-based database, the same file name and location looks like %ORACLE_HOME%\database\pwd%ORACLE_SID%.ora.

During database migrations or major upgrades, you should create a new password file to match your current environment. For all other operating systems, you should use the $ORACLE_HOME/bin/orapwd utility, but not for Windows. Well, I stand corrected: You can use orawpd on Windows too, and it will work until it doesn't.

Turns out, the password file was created that way, may cause connectivity issues between primary and standby databases.

💡
Telltale of the password file issue: error messages in alert log: ORA-o1017 (invalid username/password) and ORA-16191 (log shipping client unable to log onto target database).

The alternative is using the Windows-only oradim utility. The steps are:

  • Stop the database and the corresponding Windows Services.
  • Remove the existing password file in the %ORACLE_HOME%\database.
  • Delete the existing database services with the oradim utility.
  • Create the new services and password file using the oradim utility.
C:\> set ORACLE_SID=orcl
C:\> %ORACLE_HOME%\bin\oradim -delete %ORACLE_SID%

Service deleted. 

C:\> %ORACLE_HOME%\bin\oradim -new -sid %ORACLE_SID _
-syspwd <<YOUR-PASSWORD>>

Service created.

Recreate service and password file

  • Copy the new password file to the standby machine and restart services there.