SPFILE invalid after being edited in Windows

All we need is an easy explanation of the problem, so here it is.

I was attempting to fix another issue and set sec_case_sensitive_logon to false. I then removed this using Notepad++ instead of the CLI. But I then started getting various errors:

SPFILE invalid after being edited in Windows

When I attempt to run startup, I get the following error:

SPFILE invalid after being edited in Windows

I have no idea why it was trying to use the init ora file because I’ve started this DB fine in the past and this file doesn’t exist.

I attempted to create a new PFILE from the existing SPFILE:
SPFILE invalid after being edited in Windows

So my only conclusion is this must have been from when I updated my SPFILE using Notepad++. But the line endings are correctly showing as LF.

I’m not sure what could be happening here.

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Never edit the spfile directly! spfile settings should only be updated from SQL*Plus or SQLcl using alter system ... scope=spfile commands. The file format is not plain text and should never be edited directly.

If you must edit the config file, use the create pfile from spfile command to create a backup copy (be careful not to overwrite the original pfile, which may contain other info like a pointer to the spfile), edit the pfile copy, then use create spfile from pfile command to recreate the spfile with the changes from your pfile copy.

Method 2

I was able to find an existing PFILE in ..\product\18.0.0\admin\XE\pfile\. I then recreated my SPFILE using CREATE SPFILE='PATH_TO_NEW_SPFILE' FROM PFILE='PATH_TO_PFILE' and started my server using STARTUP PFILE='PATH_TO_PFILE'.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply