[20190510]rman備份的疑問8.txt

lfree發表於2019-05-10

[20190510]rman備份的疑問8.txt


--//上午測試rman備份多個檔案,探究input memory buffer 的問題.

--//補充測試5個檔案的情況.

--//http://blog.itpub.net/267265/viewspace-2148246/=>[20171204]關於rman備份疑問4.txt 


1.環境:

SCOTT@book> @ ver1

PORT_STRING                    VERSION        BANNER

------------------------------ -------------- --------------------------------------------------------------------------------

x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production


$ cat dx.sql

drop tablespace t&1 including contents and datafiles;

CREATE TABLESPACE T&1 DATAFILE '/mnt/ramdisk/book/T&1..dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;

create table t&1 tablespace t&1 as select rownum id ,to_char(rownum,'FM000000')||lpad('&&2',26,'&&2') name from dual connect by level<=1e5;

--//T&1..dbf 2個點.事後才發現這個小問題.


$ paste -d " " <(seq -f "%02g" 5 ) <((echo A B C D E | tr ' ' '\n' )) | xargs -IQ echo @ dx Q | sqlplus -s -l scott/book


2.修改rman配置:


RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128 K;

using target database control file instead of recovery catalog

old RMAN configuration parameters:

CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 512 K;

new RMAN configuration parameters:

CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128 K;

new RMAN configuration parameters are successfully stored

--//延遲備份寫盤速度,就可以看出一些細節.


--//RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;

--//RMAN> CONFIGURE CONTROLFILE AUTOBACKUP OFF;


3.備份:

RMAN> backup  datafile 9,10,11,12,13 format '/home/oracle/backup/t12345_%t_%U' ;


Starting backup at 2019-05-10 17:16:28

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=58 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00009 name=/mnt/ramdisk/book/T01dbf

input datafile file number=00010 name=/mnt/ramdisk/book/T02dbf

input datafile file number=00011 name=/mnt/ramdisk/book/T03dbf

input datafile file number=00012 name=/mnt/ramdisk/book/T04dbf

input datafile file number=00013 name=/mnt/ramdisk/book/T05dbf

channel ORA_DISK_1: starting piece 1 at 2019-05-10 17:16:28

channel ORA_DISK_1: finished piece 1 at 2019-05-10 17:20:33

piece handle=/home/oracle/backup/t12345_1007918188_2ju1773c_1_1 tag=TAG20190510T171628 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:04:05

channel ORA_DISK_1: throttle time: 0:04:00

Finished backup at 2019-05-10 17:20:33


--//執行如下:

SELECT set_count

        ,device_type

        ,TYPE

        ,filename

        ,buffer_size

        ,buffer_count

        ,open_time

        ,close_time

    FROM v$backup_async_io

   where set_count=83

ORDER BY set_count

        ,TYPE

        ,open_time

        ,close_time;


SET_COUNT DEVICE_TYPE TYPE      FILENAME                                           BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME

--------- ----------- --------- -------------------------------------------------- ----------- ------------ ------------------- -------------------

       83 DISK        AGGREGATE                                                              0            0 2019-05-10 17:16:28 2019-05-10 17:20:28

       83 DISK        INPUT     /mnt/ramdisk/book/T01dbf                                524288            6 2019-05-10 17:16:28 2019-05-10 17:20:28

       83 DISK        INPUT     /mnt/ramdisk/book/T02dbf                                524288            6 2019-05-10 17:16:28 2019-05-10 17:20:28

       83 DISK        INPUT     /mnt/ramdisk/book/T03dbf                                524288            6 2019-05-10 17:16:32 2019-05-10 17:20:28

       83 DISK        INPUT     /mnt/ramdisk/book/T04dbf                                524288            6 2019-05-10 17:16:36 2019-05-10 17:20:28

       83 DISK        INPUT     /mnt/ramdisk/book/T05dbf                                524288            6 2019-05-10 17:16:40 2019-05-10 17:20:28

       83 DISK        OUTPUT    /home/oracle/backup/t12345_1007918188_2ju1773c_1_1     1048576            4 2019-05-10 17:16:28 2019-05-10 17:20:28

7 rows selected.

--//注意看OPEN_TIME的時間,間隔4秒.順序啟動讀取T03,T04,T05.

--//單個輸入快取512K ,512*6=3M.

--//開始啟動同時讀取T01,T02

--//也就是寫出512K時,開始讀取T03.再寫出512K,讀取T04.再再寫出512K時,讀取T05.

--//而512K就是一個input buffer 的大小,也就是開始階段寫完1個input buffer到output buffer,讀取新資料檔案.


4.如果我驗證備份時3個檔案,T03讀取是8秒以後就可以驗證我的判斷.


RMAN> backup  datafile 9,10,11 format '/home/oracle/backup/t1_%t_%U' ;

Starting backup at 2019-05-10 17:28:09

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00009 name=/mnt/ramdisk/book/T01dbf

input datafile file number=00010 name=/mnt/ramdisk/book/T02dbf

input datafile file number=00011 name=/mnt/ramdisk/book/T03dbf

channel ORA_DISK_1: starting piece 1 at 2019-05-10 17:28:09

channel ORA_DISK_1: finished piece 1 at 2019-05-10 17:30:34

piece handle=/home/oracle/backup/t1_1007918889_2mu177p9_1_1 tag=TAG20190510T172809 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:25

channel ORA_DISK_1: throttle time: 0:02:24

Finished backup at 2019-05-10 17:30:34


SELECT set_count

        ,device_type

        ,TYPE

        ,filename

        ,buffer_size

        ,buffer_count

        ,open_time

        ,close_time

    FROM v$backup_async_io

   where set_count=86

ORDER BY set_count

        ,TYPE

        ,open_time

        ,close_time;


SET_COUNT DEVICE_TYPE TYPE      FILENAME                                       BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME

--------- ----------- --------- ---------------------------------------------- ----------- ------------ ------------------- -------------------

       86 DISK        AGGREGATE                                                          0            0 2019-05-10 17:28:09 2019-05-10 17:30:33

       86 DISK        INPUT     /mnt/ramdisk/book/T01dbf                           1048576            5 2019-05-10 17:28:09 2019-05-10 17:30:33

       86 DISK        INPUT     /mnt/ramdisk/book/T02dbf                           1048576            5 2019-05-10 17:28:09 2019-05-10 17:30:33

       86 DISK        INPUT     /mnt/ramdisk/book/T03dbf                           1048576            5 2019-05-10 17:28:17 2019-05-10 17:30:33

       86 DISK        OUTPUT    /home/oracle/backup/t1_1007918889_2mu177p9_1_1     1048576            4 2019-05-10 17:28:09 2019-05-10 17:30:33


--//注意看OPEN_TIME的時間,間隔8秒.啟動讀取T03.

--//單個輸入快取1024K ,1024*5=3M.

--//開始啟動同時讀取T01,T02

--//也就是寫出1M時,開始讀取T03.

--//而1024K就是一個input buffer 的大小,也就是開始階段寫完1個input buffer到output buffer,讀取新資料檔案.


--//貼出4個檔案的情況:

RMAN> backup  datafile 9,10,11,12 format '/home/oracle/backup/t1_%t_%U' ;

Starting backup at 2019-05-10 17:35:43

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00009 name=/mnt/ramdisk/book/T01dbf

input datafile file number=00010 name=/mnt/ramdisk/book/T02dbf

input datafile file number=00011 name=/mnt/ramdisk/book/T03dbf

input datafile file number=00012 name=/mnt/ramdisk/book/T04dbf

channel ORA_DISK_1: starting piece 1 at 2019-05-10 17:35:43

channel ORA_DISK_1: finished piece 1 at 2019-05-10 17:38:58

piece handle=/home/oracle/backup/t1_1007919343_2nu1787f_1_1 tag=TAG20190510T173543 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:03:15

channel ORA_DISK_1: throttle time: 0:03:12

Finished backup at 2019-05-10 17:38:58


SET_COUNT DEVICE_TYPE TYPE      FILENAME                                           BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME

--------- ----------- --------- -------------------------------------------------- ----------- ------------ ------------------- -------------------

       87 DISK        AGGREGATE                                                              0            0 2019-05-10 17:35:43 2019-05-10 17:38:55

       87 DISK        INPUT     /mnt/ramdisk/book/T01dbf                               1048576            4 2019-05-10 17:35:43 2019-05-10 17:38:55

       87 DISK        INPUT     /mnt/ramdisk/book/T02dbf                               1048576            4 2019-05-10 17:35:43 2019-05-10 17:38:55

       87 DISK        INPUT     /mnt/ramdisk/book/T03dbf                               1048576            4 2019-05-10 17:35:51 2019-05-10 17:38:55

       87 DISK        INPUT     /mnt/ramdisk/book/T04dbf                               1048576            4 2019-05-10 17:35:59 2019-05-10 17:38:55

       87 DISK        OUTPUT    /home/oracle/backup/t1_1007919343_2nu1787f_1_1         1048576            4 2019-05-10 17:35:43 2019-05-10 17:38:55

6 rows selected.

--//自己看,不再解析了.


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

相關文章