Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 572
  • Last Modified:

Save a pfile in the same directory where the spfile is located

Hi,
I need to save a pfile in the same directory where the spfile is located, by means of the create pfile from spfile command.
The question is how to extract the directory from the spfile value in v$system_parameter, and then use it in order to create the pfile from spfile in that same directory.
0
mordi
Asked:
mordi
  • 2
  • 2
1 Solution
 
Aaron ShiloChief Database ArchitectCommented:
hi

show parameter spfile;
select value from v$parameter where name = 'spfile';
0
 
mordiAuthor Commented:
I forgot to say: it should be done by a script which will be run on more than one instance.
0
 
Aaron ShiloChief Database ArchitectCommented:

create pfile  ='$oracle_home/database/pfileINSTANCENAME.ora' from spfile.

0
 
johnsoneSenior Oracle DBACommented:
This query should generate the file name for you:

SELECT Substr(a.VALUE, 1, Instr(a.VALUE, '/', -1))
       || 'init'
       || b.NAME
       || '.ora'
FROM   v$parameter a,
       v$database b
WHERE  a.NAME = 'spfile';
0
 
mordiAuthor Commented:
Many thanks.
p.d. In windows you search for a backslash instead.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now