5 SPFILE Commands - Which Command You Miss
5 SPFILE Commands - Which Command You Miss
SPFILE in Oracle Play a role for parameter file which is used at time of instance start and
defines databaes behavior on the basis of values given to the parameters. In lower version of
database Database used to start with Text version of file called as PFILE. Now, PFILE is still
there but database used to use SPFILE a binary version of file.
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.
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.
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.
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
3. Display SPFILE parameter value: To check spfile parameter value DBA can
use 'show parameter' command.
eg.
SQL> show parameter sga_max_size;
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. !!