Solved

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

Posted on 2011-03-02
5
548 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
Comment Utility
hi

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

Author Comment

by:mordi
Comment Utility
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
Comment Utility

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

0
 
LVL 34

Accepted Solution

by:
johnsone earned 500 total points
Comment Utility
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
Comment Utility
Many thanks.
p.d. In windows you search for a backslash instead.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now