Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: spfile vs pfile in 9i
Holger Baer wrote:
> Howard J. Rogers wrote:
>> Holger Baer wrote: >> >> >>>Niall Litchfield wrote: >>>[...] >>> >>> >>> >>>>In the case of the spfile, the fact that you can merrily stuff it up >>>>and then be unable to start the instance (because you can no longer >>>>edit the spfile) or correct the problem without restoring from backup >>>>is a rather large defect. >>>>Niall Litchfield >>> >>>But it's not much effort to get the instance up even without restoring >>>from backup (I've demonstrated it recently and I'm willing to repeat >>>this until the message get's through) ;-) >>> >>>1. create a init.ora with the first line containing >>>spfile=path/yourspfile.ora >>>2. the rest of the init.ora are settings that correct the wrong ones >>> in the spfile. Since only from the last occurence of a setting >>> the value is taken, you can now get your instance up and running >>> by >>>startup open pfile=path/init.ora >> >> >> >> That seems to me to be awfully complicated and potentially confusing (I >> hate the idea of utilising the old flaw that if there are multiple >> repeats of a parameter, it's the last one that gets used).
Exactly. You actually have to fix the problem twice. Which I suppose might mean that at least the person involved will remember not to stuff things up again. But its wasted effort, and twice as many chances of setting something incorrectly.
But my real concern is that you are relying on what I believe to be an undocumented feature (unless you can point me at a bit of doco saying otherwise).
Namely this: we know that in a plain init.ora, if I repeat a parameter two, three or more times discretely through the entire file, it is the last statement of the parameter that gets used.
Your method has an init.ora which calls the spfile. In my mind, that means the spfile is invoked *after* the init.ora. Yet in that special case, it appears explicit parameter settings in the init.ora over-ride those found in the spfile. That is (a) not normal experience of what happens with repeated parameters; (b) is, as I say, undocumented to my knowledge; and therefore (c) liable to be "fixed" in a future release -at which point your suggestion will not continue to work.
I could be wrong on that, of course. I see plenty of references to using an init.ora containing an "SPFILE=/blah/blah/blah" line. But all those references explicitly mention having a one-line init.ora, not that it can itself contain parameters. But I am in speed-reading mode, so I might have missed it...
>> And whatever happened to: >> >> create pfile from spfile >> edit pfile >> create spfile from pfile >> startup >> ??
I think that sort of confusion is just par for the course when one works with the spfile (which is why I also wish that they'd done the job properly, abolished the init.ora entirely, and shipped a small command-line tool that does nothing but edit spfiles directly).
Since you can issue these commands at any time, it is just part of the business of getting to know and love the spfile that you have to understand that "the two can co-exist, but the spfile takes precedence". That seems to me an awful lot easier to formulate and learn as a piece of dogma than to start mucking around with temporary init.oras at a time of crisis.
But what I deem easier or simpler to learn or remember is besides the point. My real concern is that your method relies on undocumented and in any case non-logical behaviour on Oracle's part... and that your method therefore cannot be relied upon to always work.
>> The create X from Y commands do require SQL*Plus, but they don't require >> an instance. >> >> Regards >> HRJ
Absolutely agree. I see no reason whatever for restoring an spfile. I'm not entirely sure there's ever a need to back one up, either! The alert log is the backup for the init.ora, and therefore if I lost my spfile, I could extract the last list of 'non-default initialisation parameters' from the alert log, and thus create a replacement init.ora. Create spfile from pfile, and I'm back in business with an spfile.
Of course, that replacement would not contain the latest results from 'alter system' commands... but since they are all listed in plain text in the alert log too, after the set of initialisation parameters you've just swiped, it wouldn't be too hard to 'replay' them.
On the other hand, put like that, I can see why RMAN for one *does* back the thing up!
Cheers,
HJR
>
> Regards
> Holger
Received on Tue Oct 26 2004 - 14:39:19 CDT