Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
HTML
Text
Oracle Tips Got Q uestions? BEWARE of 11gR2 Upgrade Gotchas! Q SM 02077 Materialized View Log is Newer Than Last Full Refresh Tuning Correlated Subqueries for Fast Speed How to Make PLSQ L Updates Restartable
Now edit the pfile in notepad to make the changes need to allow Oracle to start.
Remote DBA Oracle Tuning Emergency 911 RAC Support Apps Support Analysis Design Implementation Oracle Support
Finally, start the database using the pfile you just edited:
S Q Ls t a r t u pp f i l e = ' C : \ o r a \ p f i l e \ i n i t . o r a ' ; S Q Lc r e a t es p f i l ef r o mp f i l e = ' C : \ o r a \ p f i l e \ i n i t . o r a '
SQL Tuning Security Oracle UNIX Oracle Linux Monitoring Remote support Remote plans Remote services Application Server Applications Oracle Forms Oracle Portal App Upgrades SQL Server Oracle Concepts Softw are Support Remote Support Development Implementation
www.dba-oracle.com/concepts/pfile_spfile.htm
1/5
08/01/13
Implementation
If we were using SPFILES the parameter would keep the same value, even after a database restart. This means you only have to change the parameter value in one place, and that you can forget having to change it in the PFILE of the database. One of the most important benefits of the SPFILE is that Oracle has introduced many automatic tuning features into the core of the database. Without an SPFILE, Oracle can not autotune your database. An SPFILE uses the same formatting for its file name as the PFILE, except the word spfile replaces init. For instance, if your ORACLE_SID is testdb, the resulting spfile would be called spfiletestdb.ora. Create spfile from pfile The spfile is created using the CREATE SPFILE statement; this requires connecting as SYSDBA.
C o n n e c ts y s t e m / m a n a g e ra ss y s d b a ; C R E A T ES P F I L EF R O MP F I L E ;
This command creates an spfile in a non-default location ($ORACLE_HOME/database). However, you can fully-qualify the path name is the create spfile statement:
C R E A T ES P F I L E = ' / u 0 1 / a d m i n / p r o d / p f i l e / f i l e _ m y d b . o r a ' F R O M P F I L E = / u 0 1 / a d m i n / p r o d / p f i l e / i n i t p r o d . o r a ' ;
Warning - After an spfile is created, when you bounce the database you may encounter an error. To get around this, you have to reconnect as SYSDBA and use the STARTUP command. The addition of the spfile has changed the search path for the Oracle startup deck. Oracle now uses the following path: Search for the spfile$ORACLE_SID.ora file in the default location, Look for the spfile.ora; and Search for the pfile by name init$ORACLE_SID.ora.
08/01/13
This will create a PFILE named initSID.ora in your $ORACLE_HOME/database (Windows) or $ORACLE_HOME/dbs (Linux/Unix) directory. Note that the SID in initSID.ora will be replaced with the SID of your database as defined during creation. In addition, you can back up the file directly to the preferred location with the command:
S Q L >c r e a t ep f i l e = / p a t h / t o / b a c k u p . o r af r o ms p f i l e ;
If the time comes that you must put the SPFILE back into place, you can do so with this command:
S Q L > c r e a t es p f i l ef r o mp f i l e = / p a t h / t o / b a c k u p . o r a
If your database is currently running using the SPFILE, be sure to shut down first so Oracle can replace the file. As your SPFILE is in use the entire time your database is running, you should never overwrite it during normal operations You can use the V$PARAMETER dynamic view to see the current setting of the different database parameters. In this example, we use the DESC SQL*Plus command to describe the V$PARAMETER view, and we then query the V$PARAMETER view to see the value of the control_file parameter setting:
S Q L >s e l e c tn a m e ,v a l u ef r o mv $ p a r a m e t e rw h e r en a m e=' c o n t r o l _ f i l e s ' ; N A M E V A L U E -c o n t r o l _ f i l e s C : \ O R A C L E \ O R A D A T A \ B O O K T S T \ B O O K T S T \ C O N T R O L 0 1 . C T L ,C : \ O R A C L E \ O R A D A T A \ B O O K T S T \ B O O K T S T \ C O N T R O L 0 2 . C T L ,C : \ O R A C L E \ O R A D A T A \ B O O K T S T \ B O O K T S T \ C O N T R O L 0 3 . C T L
You may also use the shortcut show parameter command. For instance: SQL> show parameter control_files;
08/01/13
* init.ora If the directory contains none of the above, then the startup will fail. Alternatively, you can tell Oracle where to find a PFILE if you store it in a different location.
S Q L >s t a r t u pp f i l e = / p a t h / t o / p f i l e / i n i t t e s t d b . o r a
Furthermore, you can create a PFILE that contains nothing but the following line:
S P F I L E = / p a t h / t o / s p f i l e t e s t d b . o r a
By doing so, we are able to startup using a PFILE in any location we want, but continue to use an SPFILE that can also be in a different location. This can be very beneficial for those that wish to store their SPFILE in a centralized location, such as a SAN. Now, lets take a quick look at redo log administration. This is an excerpt from the bestselling "Easy Oracle Jumpstart" by Robert Freeman and Steve Karam (Oracle ACE and Oracle Certified Master). Its only $19.95 when you buy it directly from the publisher here.
Guarantee your Success! Oracle is the world's most complex, robust and flexible database, considered impossible to master without a mentor. That's why all BC Oracle trainers are working professionals, experts in Oracle who share their tips and secrets.
www.dba-oracle.com/concepts/pfile_spfile.htm
4/5
08/01/13
Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals. Feel free to ask questions on our Oracle forum. Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications. Errata? Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: and include the URL for the page.
Burleson Consulting
The Oracle of Database Support
Oracle Performance Tuning Remote DBA Services
Copyright 1996 - 2012 All rights re se rve d. O racle is the re giste re d trade mark of O racle Corporation.
www.dba-oracle.com/concepts/pfile_spfile.htm
5/5