Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
4Activity
0 of .
Results for:
No results containing your search query
P. 1
Books > Spfile and Initora

Books > Spfile and Initora

Ratings:

4.0

(1)
|Views: 276|Likes:
Published by api-3745527

More info:

Published by: api-3745527 on Oct 17, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

Title
Using SPFILE and INIT.ORA
Author
Petra Kn\u00f6bl (petra.knoebel@trivadis.com)
Info
Technical Background Info (March 2002)
Source
Trivadis NF9I Course and NF9i Techno Circle
Introduction

Oracle9i allows more and more parameters to be changed on-the-fly without having to restart the database. Consequentl y, the DBA has to remember, more and more often, to change the parameter file accordingly before the next restart of the database. Oracle9i

enables dynamically altered parameters to be simultaneously written to the parameter file
using server parameter files (SPFILE) so that changes are consistent with ALTER SYSTEM.
SPFILE and INIT.ORA
Up to version 8i, Oracle traditionally stored initialization parameters in a text file
INIT.ORA (PFILE). With Oracle9i, server parameter files (SPFILE) can also be used. An
SPFILE can be regarded as a repository for initialization parameters which is located on the
database server.
SPFILEs are small binary files that cannot be edited. Editing SPFILEs corrupts the file and
either the instance fails to start or an active instance may crash.

^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^G^@^@^@^@^B...
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
*.db_block_size=8192
*.db_domain='ttc.trivadis.com'
*.db_file_multiblock_read_count=16
*.db_files=1022
*.db_name='TVD901A'
...

* . means: all instances of this database system. This is also valid syntax in conventional INIT.ORA files. This is particularly interesting for Real Application Cluster (RAC) \u2013 see below for more information.

At database startup, if no PFILE is specified at the OS-dependent default location
($ORACLE_HOME/dbs under UNIX, $ORACLE_HOME\database under NT), the startup
command searches for:

1. spfile${ORACLE_SID}.ora
2. spfile.ora
3. init${ORACLE_SID}.ora
Of course, the option of explicitly specifying a PFILE is still available.
SQL> connect sys/manager as sysdba
Connected to an idle instance.
SQL>startup pfile=/u00/app/oracle/admin/TVD901A/pfile/initTVD901A.ora
ORACLE instance started.
Total System Global Area 172967504 bytes
...
SQL>
However, a SPFILE cannot be specified for STARTUP with PFILE :

SQL> startup pfile='/u00/app/oracle/admin/TVD901A/pfile/spfileTVD901A.ora'
LRM-00101: unknown parameter name 's044'
ORA-01078: failure in processing system parameters

To facilitate this, the best option is to create a conventional INIT.ORA with default name:
\u008a
init ${ ORACLE_SID} .ora
This file only contains the path of the SPFILE:
SPFILE =c:\oracle\admin\db1\pfile\spfileDB1.ora
Creat e SPFI LE
A SPFILE is initially created from a conventional text initialization parameters file (PFILE,
INIT.ORA). This can be carried out without a started instance. SYSDBA or SYSOPER
privileges are required to create the SPFILE.
If SPFILE is available at the default location, STARTUP uses this SPFILE if no PFILE is
specified.
Creating an SPFILE from a PFILE at the default location:
SQL> CREATE SPFILE
2 FROM PFILE='/u00/app/oracle/admin/TVD901A/pfile/initTVD901A.ora';
File created.
SQL>
Creating an SPFILE from a PFILE at the non-default location:
SQL> CREATE SPFILE='/u00/app/oracle/admin/TVD901A/pfile/spfileTVD901A.ora'
2 FROM PFILE='/u00/app/oracle/admin/TVD901A/pfile/initTVD901A.ora';
File created.
SQL>
Oracle recommends using the default location (eases administration-). Trivadis
recommends storing parameter files outside the software directory (OFA).
The best solution is to create a (conventional) INIT.ORA with default name in the default
location, which contains only the path to the SPFILE (see above).
Working with links, if necessary, on UNIX:
sqlplus "/ as sysdba"
startup
create spfile='/u00/app/oracle/admin/TDBT901A/pfile/spfileTVD901A.ora' from
pfile='/u00/app/oracle/admin/SID/pfile/initTVD901A.ora';
shutdown immediate
exit
cd $ORACLE_HOME/dbs
ln -s /u00/app/oracle/admin/TDBT901A/pfile/spfileTVD901A.ora .
sqlplus "/ as sysdba"
startup
Backi ng up an SPFILE
The CREATE PFILE command can be used to back up an SPFILE:
SQL> CREATE PFILE='/u00/app/oracle/admin/TVD901A/pfile/bck_init.ora'
2
FROM SPFILE;
File created.
SQL>
This creates a directly usable INIT.ORA file:

*.background_dump_dest='/u00/app/oracle/admin/TVD901A/bdump'
*.compatible='9.0.1'
*.control_file_record_keep_time=90
*.core_dump_dest='/u00/app/oracle/admin/TVD901A/cdump'

It i s defi ni tel y a good i dea to al w ays keep a PFILE as a backup of an SPFILE so that a new SPFILE can be created from the PFILE in the \u201c worst case scenario\u201d . The creation of a PFILE backup copy from an SPFILE can be automated in the nightly backup job or in a STARTUP trigger, for example:

SQL> CREATE OR REPLACE TRIGGER copy_spfile
2 AFTER STARTUP ON DATABASE
3 DECLARE
4
cPath CONSTANT varchar2(80) := 'D:\oracle\admin\DB9\pfile';
5 BEGIN
6
EXECUTE IMMEDIATE
7
'create pfile='''||cPath||'\initora.'||
8
TO_CHAR(SYSDATE,'yyyymmdd_hh24mi')||''' from spfile';
9 EXCEPTION
10
WHEN others THEN NULL;
11 END;
12 /
Trigger created.
SQL>
Changes i n the SPFILE
There are two options for implementing changes in the SPFILE:
1. Using the ALTER SYSTEM command
2. Using the export method

Activity (4)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
harish09_be liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->