Professional Documents
Culture Documents
In pre Oracle 11g releases we had the feature of conversion from SPFILE to PFILE and vice
versa. But Oracle 11g has gone one step further, SPFILE can now be created directly from
memory.
This command will capture all the settings from the memory and dump them to an SPFILE. This
is a very useful utility to take backup of your SPFILE before any changes are made using alter
system command. In order to check and read the new created file the following command can be
used : -
SQL>!strings /u01/app/spfileorcl.bak
In traditional PFILE, To make any change in to parameter Database Administrator has to restart
the database but now DBA can change database parameter using SPFILE without restarting
Instance.
When DBA creates a new database, SPFILE is created automatically at it's default location
ORACLE_HOME/dbs in UNIX and ORACLE_HOME\database in windows environment. One
most important fact about SPFILE, this file is not editable using OS commands. DBA can only
change this file values using database commands "alter system".
File Created.
Creating spfile doesn't means that, database is using SPFILE, To achieve this DBA has to restart
the Database and then by default SPFILE will be used.
DBA can also create pfile from spfile for backup or to see parameters in spfile.
SQL> create pfile from spfile;
File created.
SQL> !
[oracle@database OPatch]$ cd /etc/oracle/oracle/dbs/
If you have a RAC database with ASM, In that case SPFILE will be stored at shared ASM
location. All Database instances will use same spfile, here you will find two types of parameters
first same across all database instances and second instance specific parameters.
dbms42.__pga_aggregate_target=17179869184
dbms41.__pga_aggregate_target=17179869184
dbms42.__sga_target=25769803776
dbms41.__sga_target=25769803776
dbms42.__shared_io_pool_size=0
dbms41.__shared_io_pool_size=0
dbms42.__shared_pool_size=2952790016
dbms41.__shared_pool_size=3959422976
dbms42.__streams_pool_size=0
dbms41.__streams_pool_size=134217728
*._enable_numa_support=FALSE
*._file_size_increase_increment=2143289344
*._fix_control='5909305:OFF'
*.audit_sys_operations=TRUE
*.audit_trail='db'
*.cluster_database=true
dbms41.cluster_interconnects='192.168.10.7'
dbms42.cluster_interconnects='192.168.10.8'
*.compatible='11.2.0.3.0'
*.control_files='+DATA/dbms4/controlfile/current.256.809881659','+DATA/dbms4/c
ontrolfile/current.257.809881659'
*.db_block_checking='false'
*.db_block_checksum='typical'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
In the above output, DBA can see that pga_aggregate_target, sga_target and
streams_pool_size are instance specific parameters, that's why they have instance name as
prefix for them. other parameters like audit_trail, audit_sys_operations and cluster_database
are database parametrs, so they are consistent across database instances.
The method of creating spfile and pfile in RAC with ASM is also same in as explained above.
Dynamic SPIFLE parameter can be changed and take effect on database instance immediately.
like SGA_TARGET is a dynamic parameter.
Static SPFILE Parameter can be changed any time but to take effect, DBA has to restart the
Database instance like SGA_MAX_SIZE is a static parameter.
When changing SPFILE parameters SCOPE is defined, which indicates, do we need this
parameter change only into memory or keep it across database restarts. There are mainly three
type of scopes.
SCOPE = SPFILE :- No change is made to the current running instance, The scope applied for
both static and dynamic parameters. The Change applied will take effect after instance restart.
SCOPE = MEMORY :- The change is applied in memory only and will take effect immediately.
This scope is only allowed for dynamic parameters. Changes done are not available across
database restart.
SCOPE = BOTH :- The change is applied in both the server parameter file and memory. This
scope parameter Only applied for dynamic parameters.
Example of Dynamic Parameter with "SCOPE=BOTH"
SQL> show parameter sga_
NAME TYPE VALUE
------------------------------------ --------------------------------
------------------------------
sga_max_size big integer 584M
sga_target big integer 400M
You can notice that sga_target is a dynamic parameter, So changes has taken effect immediately
and will persists across instance restarts.
Since sga_max_size is a static parameter, so DBA can only change it's value using scope=spfile
which will take effect after instance restart.
SQL> startup
ORACLE instance started.
Total System Global Area 535662592 bytes
Fixed Size 1345376 bytes
Variable Size 331352224 bytes
Database Buffers 197132288 bytes
Redo Buffers 5832704 bytes
Database mounted.
Database opened.
If you are working on RAC env then you have to specify Is the change for all database
instance or for specific one only ?
Below is an Example of a Two node RAC env. generating archiving log files on Local System
rather than Shared location.
SQL> show parameter log_archive_dest_state_1
NAME TYPE VALUE
------------------------------------
log_archive_dest_state_1 string enable
To apply changes across all database instances instead on single instance DBA should use sid='*'
as last parameter.
3. Display SPFILE parameter value: To check spfile parameter value DBA can
use 'show parameter' command.
SQL> select name,value from V$parameter where name like 'spfile' order by name;
NAME VALUE
--------------------------------------------------------------------------------
Spfile D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SPFILESTAN.ORA
It gives path of spfile file which is getting used by database for starting up. If no value is given
means database is using Pfile. See How to find database is using Spfile or Pfile ?
Were you missing any command from them or I am missing any command. Please share. !!
You might also like: