ITPub博客

首页 > 数据库 > Oracle > [20190510]rman备份的疑问8.txt

[20190510]rman备份的疑问8.txt

原创 Oracle 作者:lfree 时间:2019-05-10 17:45:20 0 删除 编辑

[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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2435
  • 访问量
    6216316