rman優化tip

myownstars發表於2013-06-04

RMAN依靠channel進行資料讀寫,其備份可分3個階段

1

讀資料,將資料從磁碟讀入input I/O buffer

4個因素影響RMAN讀取速度

 

Input buffer

backup multiplexing的影響--Backup multiplexing is RMAN's ability to read several files in a backup simultaneously from different sources and then write them to a single backup piece.

其對應關係見下表

Data File Read Buffer Sizing Algorithm

Level of Multiplexing

Input Disk Buffer Size

Less than or equal to 4

The RMAN channel allocates 16 buffers of size 1 megabyte (MB) so that the total buffer size for all the input files is 16 MB.

Greater than 4 but less than or equal to 8

The RMAN channel allocates a variable number of disk buffers of size 512 kilobytes (KB) so that the total buffer size for all the input files is less than 16 MB.

Greater than 8

The RMAN channel allocates 4 disk buffers of 128 KB for each file, so that the total buffer size for each input file is 512 KB.

 

對於ASMinput buffer數量等同於該磁碟組物理磁碟數;如果某磁碟組包含16個物理磁碟,則channel分配16input buffer

 

DISK IO

同步IO—程式一次只能執行一個任務

非同步IO—程式不必等待IO返回便可執行其他任務

10R2預設支援非同步IO

 

IO子程式:

對於不支援非同步IOOSDB可通過IO Slave間接實現此功能,可通過靜態引數dbwr_io_slaves設定dbwr可使用的IO子程式數;

 

Rate引數

在分配或配置channel時可指定,為每秒可讀取最大位元組數;

此引數限定rman channel可消耗的IO頻寬,以便為其他程式預留資源;

 

 

 

複製資料

將資料從input buffer複製到output buffer,並進行validation/compression/encryption等額外處理

 

3

寫資料

將資料從output buffer寫入儲存裝置,分為磁帶和磁碟兩種,處理方式類似

 

磁帶

Tape buffer—預設每個channel分配4個,buffer大小則因平臺而已

IO Slave—backup_tape_io_slaves引數決定:true—tape bufferSGA分配,false—bufferPGA分配

IO—讀寫磁帶只能採用同步IO  ,也可通過tape slaves模擬非同步IO

介質管理器管理網路吞吐/傳輸速率/磁碟壓縮/block size

 

磁碟

最主要的因素為buffer size,每個channel分配41Mbuffer

 

 

其流程圖大致如下

 

 

 

 

調優建議

1

去除channelrate限制

2

如果使用同步IO,設定dbmr_io_slaves

3

設定large_pool_size

尤其在使用IO Slave時,如果無法申請到足夠的SGA,可能遭遇如下錯誤

ksfqxcre: failure to allocate shared memory means sync I/O will be used whenever async I/O to file not supported natively

4

通過對照backup validatebackup執行時間,確定瓶頸源於讀或寫;

調優讀

調整multiplexing級別

ASM

Striped Disk

Recommendation

No

Yes

Increase the level of multiplexing. Determine which is the minimum, MAXOPENFILES or the number of files in each backup set, and then increase this value.

In this way, you increase the rate at which RMAN fills tape buffers, which makes it more likely that buffers are sent to the media manager fast enough to maintain streaming.

No

No

Increase the MAXOPENFILES setting on the channel.

Yes

Not applicable

Set the MAXOPENFILES parameter on the channel to 1 or 2.

 

調優複製/

改用增量備份

使用高階壓縮選項替代basic壓縮演算法

如果有足夠CPU資源且採用binary壓縮,考慮增加channel數量

如果備份集要加密,使用AES128演算法,其消耗CPU最小

如果向ASM寫備份,增加channel數量,最大與物理磁碟數持平

 

 

相關檢視

V$session_longops

SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,

       ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"

FROM   V$SESSION_LONGOPS

WHERE  OPNAME LIKE 'RMAN%'

AND    OPNAME NOT LIKE '%aggregate%'

AND    TOTALWORK != 0

AND    SOFAR <> TOTALWORK;

 

V$backup_sync_io/v$backup_async_io

SELECT   LONG_WAITS/IO_COUNT, FILENAME

FROM     V$BACKUP_ASYNC_IO

WHERE    LONG_WAITS/IO_COUNT > 0

ORDER BY LONG_WAITS/IO_COUNT DESC;

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

相關文章