ORACLE AUTOMATIC STORAGE MANAGEMENT翻譯-第二章 ASM instance(1)

第二章  ASM INSTANCE
ASM的類型,例如能夠:
10g後ORACLE instance 類型增長了一個ASM種類。參數INSTANCE_TYPE=ASM進行設置。

ASM實例啓動命令:
startup   nomount啓動實例和後臺進程。但沒有掛載磁盤組
mount之後。實例會啓動參數文件裏ASM_DISKGROUPS指定的磁盤組,假設參數爲空就會觸發ORA-15110報錯信息。

ASM 11G之後爲mount命令引入了 restricted啓動參數。以排他方式啓動ASM_DISKGROUPS指定的磁盤組,
限制RDBMS訪問磁盤組。restricted命令在維護磁盤組或rebalance時特別實用。
注意:resticted可以以磁盤組級別掛載磁盤組。而不是實例級別。優勢是提供了細粒度的限制。
如:
alter diskgroup data mount restricted;
select name,state from v$asm_diskgroup;
NAME                               STATE
----------------------            -------------------
DATA                                RESTRICTED


後臺進程:
ASM後臺進程都是以asm_開頭的,就像rdbms是以ora_開頭同樣。

11g asm 後臺進程介紹
ARBx These are the slave processes that do the rebalance activity (where x
is a number).
CKPTThe CKPTprocess manages cross-instance calls (in RAC).
DBWR This process manages the SGA buffer cache in the ASM instance.
DBW Rwrites out dirty buffers (changed metadata buffers) from the ASM
buffer cache to disk.
GMON This process is responsible for managing the disk-level activities
(drop/offline) and advancing diskgroup compatibility.
 KATE The Konductor or ASM Temporary Errands (KATE) process is used
to process disks online. This process runs in the ASM instance and is started
only when an offlined disk is onlined.
LGWRThe LGWRprocess maintains the ASM Active Change Directory
(ACD) buffers from the ASM instance and flushes ACD change records to
disk.
MARK The Mark Allocation Unit (AU) for Resync Koordinator (MARK)
process coordinates the updates to the Staleness Registry when the disks go
offline. This process runs in the RDBMS instance and is started only when
disks go offline in ASM redundancy diskgroups.
PINGThe PINGprocess measures network latency and has the same
functionality in RDBMS instances.
PMON This manages processes and process death in the ASM instance.
PSP0 This process spawner process is responsible for creating and
managing other Oracle processes.
PZ9x These processes are parallel slave processes (where xis a number),
used in fetching data on behalf of GV$queries.
RBAL This opens all device files as part of discovery and coordinates the
rebalance activity.
SMON This process is the system monitor and also acts as a liaison to the
Cluster Synchronization Services (CSS) process (in Oracle Clusterware) for
node monitoring.
VKTM This process is used to maintain the fast timer and has the same
functionality in the RDBMS instances.


ASM SGA和參數設置
ASM啓動僅僅需要很是少的參數。參數文件可以是pfile也可以是spfile
*.instance_type=asm
*.asm_diskgroups=DATA,FLASH
*.processes=100
**** Note that asm_diskstring is site-specific and platform specific
*.asm_diskstring='/dev/rdsk/c3t19d*s4'             --注意假設手動加入asm 磁盤組別忘記更新這個參數否則從新啓動後缺乏的盤組沒法本身主動帶起來
*.remote_login_passwordfile='SHARED'
******
**For 11g use only the diagnostics directory.
*.diagnostic_dest='/opt/app/admin/+ASM/diag'            --11g的diagnostic_dest代替了10g的bdump,cdump,udump顯然簡單介紹多了
*******
**For 10g use the standard dump locations
*.background_dump_dest='/opt/app/admin/+ASM/bdump'
*.core_dump_dest='/opt/app/admin/+ASM/cdump'
*.user_dump_dest='/opt/app/admin/+ASM/udump'
*******

BACKGROUND_DUMP_DEST,CORE_DUMP_DEST, and USER_DUMP_DEST這三個參數在11g中已經棄用了。ASM實例中不要配置這三個參數了。

假設diagnostic_dest沒有配置,默認位置爲$ORACLE_BASE/diagnode

好比如下的文件夾結構會被建立:
$ORACLE_BASE/diag/<INSTANCE type>/<DB_UNIQUE_NAME>/<ORACLE_SID>
SQL> SELECT NAME, VALUE FROM V$DIAG_INFO
NAME VALUE
---------- ---------------
Diag Enabled TRUE
ADR Base /u01/app/oracle
ADR Home /u01/app/oracle /diag/asm/+asm/+ASM1
Diag Trace /u01/app/oracle/diag/asm/+asm/+ASM1/trace
Diag Alert /u01/app/oracle/diag/asm/+asm/+ASM1/alert
Diag Incident /u01/app/oracle /diag/asm/+asm/+ASM1/incident
Diag Cdump /u01/app/oracle/diag/asm/+asm/+ASM1/cdump
Health Monitor /u01/app/oracle/diag/asm/+asm/+ASM1/hm
Default Trace File 
11g中所有的診斷信息都可以使用adrci來管理。


最佳實踐ASM參數


11g中ASM可以使用AMM特性在init.ora中配置MEMORY_TARGET和MEMORY_MAX_TARGET,與rdbms同樣這兩個參數可以實現內存本身主動管理。
然而,由於asm內存使用率很平穩。ORACLE最佳實踐是不設置這兩個參數,默認使用256M,這個配置符合大多數的環境。
譯者注:在生產環境中ASM使用默認參數可能會引起ASM實例級別的4031錯誤,依據MOS文檔建議內存至少分配1G,這與最佳實踐又是矛盾的,
可見ORACLE的最佳實踐不必定靠譜。但可做爲參考了。

假設有需要手工調整內存,僅僅需要改動MEMORY_TARGET就可以了
alter system set memeory_target=300M;

固然假設你要禁用AMM可以把MEMROY_target設置爲0。但是shared_pool,large_pool,db_cache_size這三個參數就需要配置。

DB_CACHE_SIZE This value determines the size of the buffer cache, which
is used to cache ASM metadata blocks. The DB_CACHE_SIZEis based on
a metadata block size of 4K. This block size is the buffer page size of the
cached metadata and has no bearing or impact on the database block size.
db_cache_size用於緩存metadata block,它是基於metadata block size 及4K。
不受db block size的影響。
SHARED_POOL This is used for standard memory usage (control structures
and so on) to manage the instance. The value is also used to store open file
extent maps.
shared_pool用於存儲管理實例用的數據結構。假設控制結構等。同一時候也存儲
extent maps等。
LARGE_POOLThe LARGE_POOLvalue is used for large page allocations.
PROCESSES This ASM init.ora parameter limits the number of processes
that can start in ASM instance. You may need to modify this parameter from
its default setting for Oracle Database 10gASM instances. The following
recommendation pertains to Oracle Database 10.1.0.3 through 10.2.xand
will work for RAC and non-RAC systems:
Processes = 25 + (10 + [max number of concurrent database file
creations, and file extend operations possible
])*n
PROCESSES配置可以基於如上公式計算。


公式說明:
where n is the number of RDBMS instance (ASM clients) connecting to ASM
The source of concurrent file creations can be any of the following:
Several concurrent CREATE TABLESPACEcommands
Creation of a partitioned table with several tablespace creations
RMAN backup channels
Concurrent archive log file creations
數據庫

max number of concurrent database file creations:
可以是create tablespace併發數。建立分區表涉及的表空間數,rman備份分配的通道數,併發建立歸檔數


10g中,ASM沒有AMM特性,通常配置例如如下:
SHARED_POOL_SIZE: 128MB
LARGE_POOL: 12MB
DB_CACHE_SIZE: 64MB

咱們可以像管理數據庫同樣使用SQLPLUS管理ASM
如:
SQL>SHOW SGA
但是要注意大多數rdbms的參數不適用與ASM實例。如controlfile_files
當你嘗試設置這個參數時就會收到報錯
ORA-15021: parameter "control_files" is not valid in asm instance

注意參數文件參數:
SQL> SHOW PARAMETER CONTROL
NAME TYPE VALUE
------------------------------ ----------- ------------------------------control_files string /opt/oracle/app/product/10gr2/
dbs/cntrl+ASM.dbf

但是到操做系統中你卻找不到這個參數,這個參數時內部默認值對於
ASM是沒有實際意義的

兩個存儲在$ORACLE_HOME/dbs下的文件:
ab_<ASM SID>.dat 這個文件在asm實力啓動時生成。同一時候數據庫實例鏈接ASM實例
時獲取環境信息,假設這個文件被刪除了RDBMS就沒法和ASM實例通信了。


hc_<SID>.dat EM使用這個文件進行實例的監控檢查監控。

假設這個文件被移除,健康緩存

檢查結果就會是錯誤的。

ASM .dat 文件不會對ASM形成性能方面的影響,文件裏存放的僅僅是鏈接信息,需要的時候
與ASM實例通訊。

注意,有時可能需要設置隱含參數。來協助問題診斷,如:
診斷參數_disable_instance_parms_check(這個參數不需要再11g)

-----------------------------------------------------------------------------------------------------------------
本站註明原創和翻譯的均爲原創文章。文章贊成轉載。但必須以連接方式註明源地址,
不然追究法律責任!文章中不免有疏漏歡迎網友批評指正。



QQ:       173386747

Email:    hailong.sun1982@gmail.com

Blog:     http://blog.csdn.net/card_2005


數據結構

相關文章
相關標籤/搜索