說到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<3;
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<3;
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
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com