ORACLE推導引數Derived Parameter介紹

lhrbest發表於2016-10-31

ORACLE推導引數Derived Parameter介紹

2016-10-30 23:46 by 瀟湘隱者, 16 閱讀, 0 評論, 收藏編輯

Oracle的推導引數(Derived Parameters)其實是初始化引數的一種。推導引數值通常來自於其它引數的運算,依賴其它引數計算得出。官方文件關於推導引數(Derived Parameters)的概念如下:

 

Derived Parameters

Some initialization parameters are derived, meaning that their values are calculated from the values of other parameters. Normally, you should not alter values for derived parameters, but if you do, then the value you specify will override the calculated value.

For example, the default value of the SESSIONS parameter is derived from the value of the PROCESSES parameter. If the value of PROCESSES changes, then the default value of SESSIONS changes as well, unless you override it with a specified value.

 

很奇怪的是官方資料關於推導引數(Derived Parameters)的介紹非常少,幾乎就是那麼一點,無法從v$parameter等系統檢視獲取那些是推導引數(Derived Parameters),查了一些資料似乎還有下面一些引數是推導引數.

 

· _enqueue_hash_chains- The default value is derived from processesparameter.

·

· db_block_checkpoint_batch - This parameter specifies the number of blocks that the DBWR writes in one batch when performing a checkpoint. Setting this value too high causes the system to flood the I/O devices during the checkpoint, severely degrades performance, and increases response times--maybe to unacceptable levels.

·

· enqueue_resources - This parameter specifies the number of resources that can be locked by the lock manager. The default value is derived fromprocessesand is usually sufficient.

·

· nls_currency - This parameter is derived from nls_territory, and specifies the string to use as the local currency symbol for the L number format element.

·

· nls_date_format - This parameter is derived from nls_territory and definesthe default date format to use with the to_char and to_date functions. The value of this parameter is any valid date format mask.

·

· nls_iso_currency - Derived from nls_territory, this parameter defines the string to use as the international currency symbol for the C number format element.

·

· nls_numeric_characters - This is derived from nls_territory, and defines the characters to be used as the group separator and decimal.

·

· nls_sort - Derived from nls_language, this parameter is set to BINARY, the collating sequence for ORDER BY is based on the numeric values of the characters. A linguistic sort decides the order based on the defined linguistic sort. A binary sort is much more efficient and uses much less overhead.

·

· sessions - This parameter specifies the total number of user and system sessions, and is set to 1.1 times the value of the processes parameter.

 

以前在這篇文章裡面ORACLE會話連線程式三者總結,我一直有個關於修改了session值後,session與process的關係公式不成立了的問題,當時一直沒有搞明白,當時不知道推導引數概念,現在想想其實非常簡單,其實就是因為我修改sessions這個推導引數,覆蓋了推導值。下面再演示一下:

 
SQL> show parameter process;
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     0
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
job_queue_processes                  integer     10
log_archive_max_processes            integer     10
processes                            integer     870
SQL> show parameter session;
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
java_max_sessionspace_size           integer     0
java_soft_sessionspace_limit         integer     0
license_max_sessions                 integer     0
license_sessions_warning             integer     0
logmnr_max_persistent_sessions       integer     1
session_cached_cursors               integer     400
session_max_open_files               integer     10
sessions                             integer     962
shared_server_sessions               integer
SQL> select ceil(870*1.1) +5 from dual;
 
CEIL(870*1.1)+5
---------------
            962

 

同時修改引數sessions和processes,然後重啟資料庫,然後檢查引數processes與sessions的關係。

 

SQL> alter system set sessions=800 scope=spfile;
 
System altered.
 
SQL> alter system set processes=600 scope=spfile;                    
 
System altered.
 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
 
 
SQL> startup;
ORACLE instance started.
 
Total System Global Area 1509949440 bytes
Fixed Size                  2096472 bytes
Variable Size            1358955176 bytes
Database Buffers          100663296 bytes
Redo Buffers               48234496 bytes
Database mounted.
Database opened.
SQL> show parameter processes;
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     0
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
job_queue_processes                  integer     10
log_archive_max_processes            integer     10
processes                            integer     600
SQL> show parameter session
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
java_max_sessionspace_size           integer     0
java_soft_sessionspace_limit         integer     0
license_max_sessions                 integer     0
license_sessions_warning             integer     0
logmnr_max_persistent_sessions       integer     1
session_cached_cursors               integer     400
session_max_open_files               integer     10
sessions                             integer     800
shared_server_sessions               integer
SQL> select ceil(1.1*600)+5 from dual;
 
CEIL(1.1*600)+5
---------------
            665

clip_image001

 

如上所示,processes與sessions的關係已經不成立了:sessions=(1.1 * processes) + 5(Oracle 10g)。主要還是因為推導引數session設定後,覆蓋了推導值。這個引數值已經寫入了引數檔案spfile或pfile當中。

SQL> create pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/init_session.ora' from spfile;
 
File created.
 
SQL> 
 
 
[oracle@DB-Server dbs]$ grep session init_session.ora
*.session_cached_cursors=400
*.sessions=800
[oracle@DB-Server dbs]$ grep process init_session.ora
*.job_queue_processes=10
*.log_archive_max_processes=10
*.processes=600

 

參考資料:

作者:瀟湘隱者

本文版權歸作者所有,歡迎轉載,但未經作者同意必須保留此段宣告,且在文章頁面明顯位置給出原文連線.


...............................................................................................................................

● 本文來自於部落格園轉載文章,若有侵權,請聯絡小麥苗及時刪除,非常感謝原創作者瀟湘隱者的無私奉獻

● 本文在itpub(http://blog.itpub.net/26736162)、部落格園(http://www.cnblogs.com/lhrbest)和個人微信公眾號(xiaomaimiaolhr)上有同步更新

● QQ群:230161599  微信群:私聊

● 原文地址:http://www.cnblogs.com/kerrycode/p/6014469.html

● 小麥苗雲盤地址:http://blog.itpub.net/26736162/viewspace-1624453/

● QQ群: 230161599   微信群:私聊

● 聯絡我請加QQ好友(642808185),註明新增緣由

●【版權所有,文章允許轉載,但須以連結方式註明源地址,否則追究法律責任】

...............................................................................................................................

手機長按下圖識別二維碼或微信客戶端掃描下邊的二維碼來關注小麥苗的微信公眾號:xiaomaimiaolhr,免費學習最實用的資料庫技術。





來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2127374/,如需轉載,請註明出處,否則將追究法律責任。

相關文章