RMAN: I/O Slaves and Memory Usage

上一篇 / 下一篇  2007-08-22 00:00:00 / 个人分类:backup&restore

from metalinkITPUB个人空间9E!I:G1~-C-Ld"L j

RMAN: I/O Slaves and Memory Usage

TIP: Click help for a detailed explanation of this page. ITPUB个人空间d+@+V-D \g]
Bookmark Go to End

Subject: RMAN: I/O Slaves and Memory Usage ITPUB个人空间M'o,ZH!O_
Doc ID: Note:73354.1 Type: BULLETIN
,`2xCi5ujLa(t0 Last Revision Date: 28-MAY-2007 Status: PUBLISHED


1Kf&t(WBZ4di0PURPOSE

The pupose of this note is to show how RMAN makes use of memory buffersITPUB个人空间X5U3D$Q c
for backup/restore operations, and also how the use of i/o slaves can
g _wYme5{0 affect this.


aX.Bo9o N0SCOPE & APPLICATION

This note is intended for DBAs and Support Personnel.

RMAN I/O Slaves and Memory Usage
IM-LSu s[T0================================

Contents:

1.0 How Does RMAN make use of memory buffers?
Ru)Y N/R@7W T02.0 Size of Input/Output Buffers
Yy$uw9lC Z.Yx(L?03.0 Why Use I/O Slaves?ITPUB个人空间!t$U+P^|
4.0 Configuring I/O Slaves

ITPUB个人空间5w2TOJ8F!`Z0i/{K
1.0 How Does RMAN make use of memory buffers?ITPUB个人空间%wY"_ \'B1Z0a'T
=============================================

For each backup/restore operation, every server session (ie, RMAN channel) ITPUB个人空间 ` Nl9G{
allocates

a. 4 input buffers for every disk file
(Ku'oA tk0 b. 4 output buffers for every backup piece

memory(input) = #buffers * #files * buffersizeITPUB个人空间 `e _+T|e
= 4 * #files * buffersize

#files = total number of files concurrently open

To reduce the amount of memory used by RMAN set - MAXOPENFILES = <n>
%N#~^ q&jW0EG - Before maxopenfiles
:u8_)TN&I04*100(files)*8192*64 ITPUB个人空间/B-KL#TDW ?
After maxopenfiles = 4
QP [,yv%b;a04*4(files)*8192*64

This can be illustrated by the following:

RMAN> run {ITPUB个人空间6yF T/J9~^q(EE.O
allocate channel c1 type 'SBT_TAPE';ITPUB个人空间uP~Y j F;c'd
backup datafile 1,2;
~%p*RN!tBe]/q0 }

+-----+ file 1
_]NS [$?p/`0 |+-----+ input buffersITPUB个人空间!N_a6qYb
||+-----+ITPUB个人空间_DYQ4v$yP(X
|||+-----+
'i3y8r]![V8Wi0 |||| | output buffersITPUB个人空间qsP Xzz,R
+||| |
WZ f Z!a:JPX I0 +|| | +-----+ITPUB个人空间6xOVD J.pdD}s4l
+| | +-----------+ |+-----+ +------+ITPUB个人空间 P2@9sije5g5N {N
+-----+ | server | ||+-----+ | o__o |ITPUB个人空间#^e Nh&`0i Y,q
+-----------+ |||+-----+ +------+ITPUB个人空间)?6c^"x,^dV#HGv
|||| |
-Yo#I&j.g p9Z[ K0 +-----+ +||| |
Tr]5s%Rd0 |+-----+ +|| |ITPUB个人空间.]_9L(p%N+mS
||+-----+ +| |
7Z6Dr+_B8x,s E5o-g0 |||+-----+ +-----+ITPUB个人空间p5]7`;Q"VG
|||| | file 2ITPUB个人空间\CL5T fT"N4dm
+||| | input buffers
_2G4Xc0u{;~{0 +|| |ITPUB个人空间LgCy?gB ~
+| |
? Z#f5G;D8a;XC [*^0 +-----+

ITPUB个人空间9Hu#K0Ya3n1imP0C
The server process reads data from the disk file into one of the input buffers.ITPUB个人空间#U;w FYewd
A given buffer is dedicated to a file whilst a server process is operating on
:G fJ,LqGu$o0that file. When one buffer fills up, the server process writes to one of the
.?-_]U Z0other three. The buffers are used in a circular fashion.

The input buffers will contain blocks that do not need to be backed up, as wellITPUB个人空间r2ja8SYQ UCZ
as those that do.

A 'memory copy' routine is used to copy the required data from an input to anITPUB个人空间FZ \#EY+U
output buffer. This is where block corruption is checked (ie, validate header,ITPUB个人空间:@6L+d0_t$G
compute checksums if enabled).


;V5E FpsLW02.0 Size of Input/Output BuffersITPUB个人空间@$\E'A/]c
================================

a. input buffersITPUB个人空间8a*J8n/^s4c-K5f2\
----------------

NOTE : DB_FILE_DIRECT_IO_COUNT is not available in Oracle9i onwards.
`;|Fd}js[7u0 In Oracle9i, it is replaced by a hidden _DB_FILE_DIRECT_IO_COUNT which
@$U3m} D+A"E(Z wGxP0 governs the size of direct I/Os in BYTES (not blocks). The default is ITPUB个人空间6aG SL \vY
1Mb butwill be sized down if the max_io_size of the system is smaller.

The input buffer size is:ITPUB个人空间h:g1VC0NO
buffersize = db_block_size * db_file_direct_io_count

As there are 4 input buffers, the total input buffer memory use per channel is:ITPUB个人空间"`A(sNTU
memory(input) = #buffers * #files * buffersize
zX*J ]U(k0 = 4 * #files * buffersize

For example, if 2 channels are used, and each of these channels backs up 3
,f-zH_v0files, then for each channel

memory(input) = 4 * 3 * db_block_size * db_file_direct_io_count

ITPUB个人空间/N$b;qe B
b. output buffersITPUB个人空间:t&h#w1I;j+H8ip
-----------------

For disk channels, the output buffer size is:ITPUB个人空间fm/d;Q Qvi
buffersize = db_block_size * db_file_direct_io_count

For SBT_TAPE channels, the output buffer size in Oracle8/8i is o/s dependant. (On Solaris,ITPUB个人空间 Ej|.Q eU;w4W
this defaults to 64k) On 9i it defaults to 256k for all platforms. The BLKSIZE argument to 'allocate channel...' can beITPUB个人空间+e!~p8^F'g
used to override the default value.

As there are 4 output buffers,ITPUB个人空间?_'f2]-f LotP
memory(output) = #buffers * buffersizeITPUB个人空间0o!u5o,~G7F/d+N c
= 4 * buffersize


W,e8Cp[R0O0c. Allocation of Memory
_`b @#K&\F A0-----------------------

This memory is allocated from the channel server process PGA, unless i/o slavesITPUB个人空间G9Uh9r;P4g8f
are used. I/O slave memory is allocated from the SGA in order for the memory to
3kHF;{6~W0be shared between the I/O slave and the channel server process. In this case,ITPUB个人空间x&VVX:}7PaH7W3\
Oracle recommends the 'large pool' feature is used, i.e. Set the "init.ora"ITPUB个人空间m*BY g7w
parameter to:

LARGE_POOL_SIZE = <nnn>

where <nnn> is the size of the large pool, calculated from the above.

If the I/O slave cannot acquire the required memory from the SGA, then anITPUB个人空间!V_`1esQ6]
ORA-04031 error is asserted (see "alert.log"), and the operation continuesITPUB个人空间 Q)D.P]Lwn]z
synchronously by allocating memory from the channel server's PGA.


XXmL(pp03.0 Why Use I/O Slaves?
"L(| sY0c7Rn\0=======================

For optimal performance during backup/restore operations, the goal shouldITPUB个人空间d:L(F/v4qN
be to keep the tape streaming i.e. continually moving. Stopping and startingITPUB个人空间!\XJH%eX7z$U K
tapes are expensive operations. Additionally, potential tape stretching willITPUB个人空间-V9X(zp._a5W
lower the life span of the tape.

I/O slaves can be used to provide such a performance enhancement by simulating
)s1oOPz,h0asynchronous I/O. There are two types of I/O slaves; disk slaves and
l!M|2B _'B0tape slaves.

By default, all I/O to tape is synchronous. This means that the channel serverITPUB个人空间K2[C$L`9h&n{'J!f
process is blocked from doing any work while waiting for a tape to complete a
#f@jDU j/`/bm0write. Tape i/o slaves allow the channel server process to continue to fill and
u%@Qp0S!V+i S0G0process buffers whilst the tape write is completing.

It is also important to quickly fill the input buffers with data. On platformsITPUB个人空间St7GjgS
that do not support asynchronous I/O, the channel server process can be
T?zS#ls's0M0blocked on a file read, thus preventing it from processing the buffers.ITPUB个人空间5`(@)C H@PS
Disk I/O slaves can be used to asynchronously read from files,
*hp.O Hgy0thus enabling channel server process to continue to process the buffers.

This is especially important during incremental backups, or backups of 'empty'
7Y [*hR!K@0files, where the number of modified buffers is sufficiently low that the tape
E^ BE4g*?cs0is writing faster than the output buffers are being filled.

ITPUB个人空间5G#q]7v ] rey9@/A
4.0 Configuring I/O SlavesITPUB个人空间 Z f:_/G ?/n
==========================

a. Disk SlavesITPUB个人空间z_6C$b,s)Xp}+U0q5y
--------------

For Oracle 8.0, set the "init.ora" parameter

BACKUP_DISK_IO_SLAVES = <n>

where <n> is the number of disk i/o slaves to start.

Oracle recommends that no more than 4 disk slaves are started. In this case,ITPUB个人空间Qv U-h:u'_ hf
extra channels should be considered.

For Oracle 8i/9i, set the "init.ora" parameter

DBWR_IO_SLAVES > 0

This causes 4 disk i/o slaves to be started.

Note that every channel server process doing a backup/restore will be assigned
M0I3l nn0this number of disk i/o slaves.


#^\@Lwtgb0b. Tape SlavesITPUB个人空间8~ fL ~V;t
--------------

Set the "init.ora" parameter

BACKUP_TAPE_IO_SLAVES = true

This causes one tape I/O slave to be assigned to each channel server process.

In 8i/9i, if the DUPLEX option is specified, then tape I/O slaves must be enabled.ITPUB个人空间 ]9H!c Uv"u3n:m
In this case, for DUPLCEX=<n>, there are <n> tape slaves per channel. These N slaves
.YT |$`*@ xRah nN0all operate on the same four output buffers. Consequently, a buffer is not freed
Z^;d+l` R1k*t4o\%v)A0up until all <n> slaves have finished writing to tape.

ITPUB个人空间3u8X$l$f1?6ze
c. init.ora
| tZ r#hI6S0-----------

Each I/O slave is an Oracle server process. The "init.ora" parameters'
6C0N%c9P,v!S1Gc,kX"R0processes and sessions need to be set accordingly.


b?6@8J:g]6_t @0


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-12-02  
 123456
78910111213
14151617181920
21222324252627
28293031   

数据统计

  • 访问量: 4816
  • 日志数: 649
  • 建立时间: 2007-12-21
  • 更新时间: 2008-09-06

RSS订阅

Open Toolbar