您好,欢迎访问一九零五行业门户网

Oracle之参数文件探究

说到oracle参数文件,那么这是要给非常重要的文件,在数据库启动实例的过程中进行内存、数据库名称等等环境的初始化,只有参数文
之前有很多刚刚开始学习数据库的朋友经常问我参数文件备份恢复以及误操作导致无法启动实例等等问题,我也是一个求道之人,今天写了这篇日志,希望对大家有所帮助,彼此互相学习互相进步。在此记录一下。
说到oracle参数文件,那么这是要给非常重要的文件,在数据库启动实例的过程中进行内存、数据库名称等等环境的初始化,只有参数文件配置正确那么数据库才能启动实例,进而可以mount and open。
 1)参数视图介绍
 与参数文件有关的视图有v$parameter,v$spparameter,v$system_parameter,v$parameter2,v$system_parameter2。
 v$parameter
v$parameter 视图显示的是当前会话中生效的初始化参数信息,每一个新的会话开始都会从v$system_parameter视图中继承一些参数。可见v$parameter是基于当前会话的,而v$system_parameter是基于实例的。类似于linux的profile环境参数。
 v$parameter displays information about the initialization parameters that are currently in effect for the session. a new session inherits parameter values from the instance-wide values displayed by the v$system_parameter view.
v$spparameter
 该参数记录的是在参数文件(spfile)中的参数设置内容,如果参数文件没有使用,那么该参数中的每一个值在isspecified列都是false。
v$spparameter displays information about the contents of the server parameter file. if a server parameter file was not used to start the instance, then each row of the view will contain false in the isspecified column.
 eg:
 sys@orcl#select sid,name,type,value,isspecified,ordinal from v$spparameter where rownum 
si name                type                          value                          isspecified    ordinal
 -- -------------------- ------------------------------ ------------------------------ ------------ ----------
 *  lock_name_space      string                                                        false                0
 *  processes            integer                        160                            true                  1
 sys@orcl#create pfile='/opt/oracle/pfile.ora' from spfile;
文件已创建。
sys@orcl#shutdown immediate
 数据库已经关闭。
 已经卸载数据库。
 oracle 例程已经关闭。
 sys@orcl#startup pfile='/opt/oracle/pfile.ora';
 oracle 例程已经启动。
total system global area  805875712 bytes
 fixed size                  2148720 bytes
 variable size            511706768 bytes
 database buffers          285212672 bytes
 redo buffers                6807552 bytes
 数据库装载完毕。
 数据库已经打开。
 sys@orcl#select sid,name,type,value,isspecified,ordinal from v$spparameter where rownum 
si name                type                          value                          isspecified    ordinal
 -- -------------------- ------------------------------ ------------------------------ ------------ ----------
 *  lock_name_space      string                                                        false                0
 *  processes            integer                                                      false                0
sys@orcl#
v$system_parameter
该试图对instance而言的,其他的会话信息都是基于该试图进行“copy”的。
v$system_parameter displays information about the initialization parameters that are currently in effect for the instance. a new session inherits parameter values from the instance-wide values.
 v$parameter2
该参数文件就是对v$parameter参数中的多项值进行format。
v$parameter2 displays information about the initialization parameters that are currently in effect for the session, with each list parameter value appearing as a row in the view. a new session inherits parameter values from the instance-wide values displayed in the v$system_parameter2 view.
presenting the list parameter values in this format enables you to quickly determine the values for a list parameter. for example, if a parameter value is a, b, then the v$parameter view does not tell you if the parameter has two values (both a and b) or one value (a, b). v$parameter2 makes the distinction between the list parameter values clear.
eg:
sys@orcl#select name,value from v$parameter where;
name                value
 -------------------- ------------------------------
 control_files        /opt/oracle/oradata/orcl/contr
                      olfile/o1_mf_7q9c8orh_.ctl, /o
                      pt/oracle/flash_recovery_area/
                      orcl/controlfile/o1_mf_7q9c8pc
                      f_.ctl
其它类似信息

推荐信息