Solved

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

Posted on 2011-03-02
5
565 Views
Last Modified: 2012-05-11
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
Comment
Question by:mordi
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 35016878
hi

show parameter spfile;
select value from v$parameter where name = 'spfile';
0
 
LVL 3

Author Comment

by:mordi
ID: 35018981
I forgot to say: it should be done by a script which will be run on more than one instance.
0
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 35019305

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

0
 
LVL 35

Accepted Solution

by:
johnsone earned 500 total points
ID: 35022213
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
 
LVL 3

Author Closing Comment

by:mordi
ID: 35055155
Many thanks.
p.d. In windows you search for a backslash instead.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
exp/imp 25 98
update using pipeline function 3 32
How to get the current date and Time upon oracle insert into a database table 9 59
plsql job on oracle 18 72
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question