欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

[20190509]rman备份的疑问5.txt

程序员文章站 2022-09-13 23:34:47
[20190509]rman备份的疑问5.txt--//别人跟我提到的rman备份问题,我开始以为是assm与mssm的问题,实际测试情况不是.--//开始备份时生成的备份集文件很大,以后会回缩(对方采用压缩方式).我以前测试也遇到类似的情况,我重复演示看看.1.环境:SYS@book> @ ver ......

[20190509]rman备份的疑问5.txt

--//别人跟我提到的rman备份问题,我开始以为是assm与mssm的问题,实际测试情况不是.
--//开始备份时生成的备份集文件很大,以后会回缩(对方采用压缩方式).我以前测试也遇到类似的情况,我重复演示看看.

1.环境:
sys@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

sys@book> show parameter filesystem
name                 type   value
-------------------- ------ -----
filesystemio_options string none
--//测试不要使用异步io.主要跟踪看到的异步io信息目前我看不懂!!

create tablespace t01 datafile '/mnt/ramdisk/book/t01.dbf' size 40m autoextend off logging online extent management local autoallocate blocksize 8k segment space management manual;
create tablespace t02 datafile '/mnt/ramdisk/book/t02.dbf' size 40m autoextend off logging online extent management local autoallocate blocksize 8k segment space management auto;
--//注意建立的数据文件autoextend off,一个mssm,一个assm.主要避免一个数据文件快满时,oracle会自动提前扩展数据文件.

create table t01 tablespace  t01 as select rownum id ,lpad('a',32,'a') name from dual connect by level<=7e5;
create table t02a tablespace t02 as select rownum id ,lpad('a',32,'a') name from dual connect by level<=1e5;
create table t02b tablespace t02 as select rownum id ,lpad('b',32,'b') name from dual connect by level<=1e5;
create table t02c tablespace t02 as select rownum id ,lpad('c',32,'c') name from dual connect by level<=1e5;
create table t02d tablespace t02 as select rownum id ,lpad('d',32,'d') name from dual connect by level<=1e5;
create table t02e tablespace t02 as select rownum id ,lpad('e',32,'e') name from dual connect by level<=1e5;
create table t02f tablespace t02 as select rownum id ,lpad('f',32,'f') name from dual connect by level<=1e5;
create table t02g tablespace t02 as select rownum id ,lpad('g',32,'g') name from dual connect by level<=1e5;
--//基本写满这个数据文件.

2.建立测试脚本:
rman> report schema ;
report of database schema for database with db_unique_name book
list of permanent datafiles
===========================
file size(mb) tablespace           rb segs datafile name
---- -------- -------------------- ------- ------------------------
1    760      system               ***     /mnt/ramdisk/book/system01.dbf
2    1150     sysaux               ***     /mnt/ramdisk/book/sysaux01.dbf
3    865      undotbs1             ***     /mnt/ramdisk/book/undotbs01.dbf
4    128      users                ***     /mnt/ramdisk/book/users01.dbf
5    346      example              ***     /mnt/ramdisk/book/example01.dbf
6    6        tea                  ***     /mnt/ramdisk/book/tea01.dbf
7    16       undotbs1             ***     /mnt/ramdisk/book/undotbs02.dbf
8    16       undotbs1             ***     /mnt/ramdisk/book/undotbs03.dbf
9    40       t01                  ***     /mnt/ramdisk/book/t01.dbf
10   40       t02                  ***     /mnt/ramdisk/book/t02.dbf

list of temporary files
=======================
file size(mb) tablespace           maxsize(mb) tempfile name
---- -------- -------------------- ----------- --------------------
1    414      temp                 4096        /mnt/ramdisk/book/temp01.dbf

rman> configure controlfile autobackup off;
old rman configuration parameters:
configure controlfile autobackup on;
new rman configuration parameters:
configure controlfile autobackup off;
new rman configuration parameters are successfully stored
--//测试前关闭控制文件自动备份,避免干扰.

rman> configure channel 1 device type disk rate 5m;

old rman configuration parameters:
configure channel 1 device type disk rate 10 m;
new rman configuration parameters:
configure channel 1 device type disk rate 5 m;
new rman configuration parameters are successfully stored
--//数据文件40m,40/5=8秒,监测15秒应该足够了(我自己先测了1次).这样备份慢一些,我监控可以看到信息.

$ cat tt.sh
#! /bin/bash
file=$1
>| /tmp/xx_${file}
>| /tmp/yy_${file}
strace -ftt -x -o /tmp/tt_${file}.txt rman target / <<< "backup as compressed backupset datafile "$file" format \"/home/oracle/backup/t_"${file}"_%u\" ;" &
seq 30 | xargs -i{} echo "ls -l /home/oracle/backup/t_${file}_*;sleep 0.5" | bash 2>/dev/null| ts.awk >> /tmp/xx_${file} 2>/dev/null &
seq 30 | xargs -i{} echo "stat -c '%s %b %b' /home/oracle/backup/t_${file}_*;sleep 0.5" | bash  2>/dev/null | ts.awk >> /tmp/yy_${file} 2>/dev/null &
wait

3.测试:
$ . tt.sh 9
recovery manager: release 11.2.0.4.0 - production on thu may 9 09:25:27 2019
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to target database: book (dbid=1337401710)

rman>
starting backup at 2019-05-09 09:25:30
using target database control file instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=156 device type=disk
allocated channel: ora_disk_2
channel ora_disk_2: sid=170 device type=disk
allocated channel: ora_disk_3
channel ora_disk_3: sid=184 device type=disk
channel ora_disk_1: starting compressed full datafile backup set
channel ora_disk_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/mnt/ramdisk/book/t01.dbf
channel ora_disk_1: starting piece 1 at 2019-05-09 09:25:33
channel ora_disk_1: finished piece 1 at 2019-05-09 09:25:48
piece handle=/home/oracle/backup/t_9_12u13n4c_1_1 tag=tag20190509t092532 comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:15
channel ora_disk_1: throttle time: 0:00:06
finished backup at 2019-05-09 09:25:48

rman>

recovery manager complete.
[1]   done                    strace -ftt -x -o /tmp/tt_${file}.txt rman target / <<< "backup as compressed backupset datafile "$file" format \"/home/oracle/backup/t_"${file}"_%u\" ;"
[2]-  done                    seq 30 | xargs -i{} echo "ls -l /home/oracle/backup/t_${file}_*;sleep 0.5" | bash 2> /dev/null | ts.awk >> /tmp/xx_${file} 2> /dev/null
[3]+  done                    seq 30 | xargs -i{} echo "stat -c '%s %b %b' /home/oracle/backup/t_${file}_*;sleep 0.5" | bash 2> /dev/null | ts.awk >> /tmp/yy_${file} 2> /dev/null

$ uniq -c /tmp/xx_9
      2 [2019-05-09 09:25:33] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:34] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:35] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:36] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:37] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:38] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:39] -rw-r----- 1 oracle oinstall 41975808 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:40] -rw-r----- 1 oracle oinstall 2826240 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      2 [2019-05-09 09:25:41] -rw-r----- 1 oracle oinstall 2826240 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1
      1 [2019-05-09 09:25:42] -rw-r----- 1 oracle oinstall 2826240 may  9 09:25 /home/oracle/backup/t_9_12u13n4c_1_1

$ ls -l /mnt/ramdisk/book/t01.dbf
-rw-r----- 1 oracle oinstall 41951232 2019-05-09 10:25:02 /mnt/ramdisk/book/t01.dbf

--//41975808-41951232 = 24576
--//24576/8192 = 3 , 比数据文件多3个数据块.

$ uniq -c /tmp/yy_9
      2 [2019-05-09 09:25:33] 41975808 2072 512
      2 [2019-05-09 09:25:34] 41975808 2072 512
      2 [2019-05-09 09:25:35] 41975808 2072 512
      2 [2019-05-09 09:25:36] 41975808 2072 512
      1 [2019-05-09 09:25:37] 41975808 2072 512
      1 [2019-05-09 09:25:37] 41975808 4120 512
      2 [2019-05-09 09:25:38] 41975808 4120 512
      2 [2019-05-09 09:25:39] 41975808 4120 512
      2 [2019-05-09 09:25:40] 2826240 5528 512
      2 [2019-05-09 09:25:41] 2826240 5528 512
      1 [2019-05-09 09:25:42] 2826240 5528 512

--//可以发现开始备份文件大小41975808,而实际占2072块(每块512字节),2072*512 = 1060864,实际占用1m上下,也就是备份开始建立的
--//文件像临时表空间文件一样,是稀疏文件.
--//你可以发现最后生成的文件才2826240,而实际占5528块(单位512字节).这也是对方看到的情况.
--//我开始以为是使用mssm的缘故,我改成assm也是一样.也就是与这个无关.

$ . tt.sh 10
recovery manager: release 11.2.0.4.0 - production on thu may 9 09:49:54 2019
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to target database: book (dbid=1337401710)
rman>
starting backup at 2019-05-09 09:49:57
using target database control file instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=212 device type=disk
allocated channel: ora_disk_2
channel ora_disk_2: sid=226 device type=disk
allocated channel: ora_disk_3
channel ora_disk_3: sid=241 device type=disk
channel ora_disk_1: starting compressed full datafile backup set
channel ora_disk_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/mnt/ramdisk/book/t02.dbf
channel ora_disk_1: starting piece 1 at 2019-05-09 09:49:59
channel ora_disk_1: finished piece 1 at 2019-05-09 09:50:15
piece handle=/home/oracle/backup/t_10_14u13oi7_1_1 tag=tag20190509t094959 comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:16
channel ora_disk_1: throttle time: 0:00:06
finished backup at 2019-05-09 09:50:15

rman>

recovery manager complete.
[1]   done                    strace -ftt -x -o /tmp/tt_${file}.txt rman target / <<< "backup as compressed backupset datafile "$file" format \"/home/oracle/backup/t_"${file}"_%u\" ;"
[2]-  done                    seq 30 | xargs -i{} echo "ls -l /home/oracle/backup/t_${file}_*;sleep 0.5" | bash 2> /dev/null | ts.awk >> /tmp/xx_${file} 2> /dev/null
[3]+  done                    seq 30 | xargs -i{} echo "stat -c '%s %b %b' /home/oracle/backup/t_${file}_*;sleep 0.5" | bash 2> /dev/null | ts.awk >> /tmp/yy_${file} 2> /dev/null

$ uniq -c /tmp/xx_10
      2 [2019-05-09 09:50:00] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:01] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:02] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:03] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:04] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:05] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:06] -rw-r----- 1 oracle oinstall 41975808 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:07] -rw-r----- 1 oracle oinstall 2867200 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      2 [2019-05-09 09:50:08] -rw-r----- 1 oracle oinstall 2867200 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1
      1 [2019-05-09 09:50:09] -rw-r----- 1 oracle oinstall 2867200 may  9 09:50 /home/oracle/backup/t_10_14u13oi7_1_1

$ uniq -c /tmp/yy_10
      2 [2019-05-09 09:50:00] 41975808 2072 512
      2 [2019-05-09 09:50:01] 41975808 2072 512
      2 [2019-05-09 09:50:02] 41975808 2072 512
      2 [2019-05-09 09:50:03] 41975808 2072 512
      2 [2019-05-09 09:50:04] 41975808 2072 512
      2 [2019-05-09 09:50:05] 41975808 4120 512
      2 [2019-05-09 09:50:06] 41975808 4120 512
      2 [2019-05-09 09:50:07] 2867200 5608 512
      2 [2019-05-09 09:50:08] 2867200 5608 512
      1 [2019-05-09 09:50:09] 2867200 5608 512
--//assm也是一样.

4.继续测试:
--//删除几个表看看.
scott@book> drop table t02a purge ;
table dropped.

scott@book> drop table t02b purge ;
table dropped.

scott@book> drop table t02c purge ;
table dropped.

--//重复备份数据文件10.注意先删除前面数据文件10的备份,主要我写的监测脚本不是很好.使用模糊查询.
rman> delete backupset 34;
using channel ora_disk_1
using channel ora_disk_2
using channel ora_disk_3

list of backup pieces
bp key  bs key  pc# cp# status      device type piece name
------- ------- --- --- ----------- ----------- ----------
34      34      1   1   available   disk        /home/oracle/backup/t_10_14u13oi7_1_1

do you really want to delete the above objects (enter yes or no)? yes
deleted backup piece
backup piece handle=/home/oracle/backup/t_10_14u13oi7_1_1 recid=34 stamp=1007805000
deleted 1 objects

--//重复测试.
$ uniq -c /tmp/yy_10
      2 [2019-05-09 10:11:24] 41975808 2072 512
      2 [2019-05-09 10:11:25] 41975808 2072 512
      2 [2019-05-09 10:11:26] 41975808 2072 512
      2 [2019-05-09 10:11:27] 41975808 2072 512
      2 [2019-05-09 10:11:28] 41975808 2072 512
      2 [2019-05-09 10:11:29] 41975808 2072 512
      2 [2019-05-09 10:11:30] 41975808 2072 512
      2 [2019-05-09 10:11:31] 41975808 2072 512
      1 [2019-05-09 10:11:32] 41975808 2072 512
      1 [2019-05-09 10:11:32] 2097152 4104 512
      1 [2019-05-09 10:11:33] 2097152 4104 512
--//看到的情况还是一样.

5.再继续测试:
--//重新建立表空间t02,以及对应表.打开autoextend on看看.
scott@book> alter database datafile '/mnt/ramdisk/book/t02.dbf' autoextend on next 16m maxsize unlimited;
database altered.

--//重复测试,注意删除前面的备份.
$ uniq -c /tmp/yy_10
      2 [2019-05-09 10:22:41] 41975808 2072 512
      2 [2019-05-09 10:22:42] 41975808 2072 512
      2 [2019-05-09 10:22:43] 41975808 2072 512
      2 [2019-05-09 10:22:44] 41975808 2072 512
      1 [2019-05-09 10:22:45] 41975808 2072 512
      1 [2019-05-09 10:22:45] 41975808 4120 512
      2 [2019-05-09 10:22:46] 41975808 4120 512
      2 [2019-05-09 10:22:47] 41975808 4120 512
      2 [2019-05-09 10:22:48] 2859008 5592 512
      2 [2019-05-09 10:22:49] 2859008 5592 512
      1 [2019-05-09 10:22:50] 2859008 5592 512
--//看到的情况还是一样.

scott@book> alter database   datafile '/mnt/ramdisk/book/t02.dbf' resize 100m;
database altered.

--//重复测试,注意删除前面的备份.
$ uniq -c /tmp/yy_10
      1 [2019-05-09 10:25:13] 1056768 2072 512
      1 [2019-05-09 10:25:14] 1056768 2072 512
      2 [2019-05-09 10:25:15] 1056768 2072 512
      2 [2019-05-09 10:25:16] 1056768 2072 512
      2 [2019-05-09 10:25:17] 1056768 2072 512
      2 [2019-05-09 10:25:18] 1056768 2072 512
      2 [2019-05-09 10:25:19] 2105344 4120 512
      2 [2019-05-09 10:25:20] 2105344 4120 512
      2 [2019-05-09 10:25:21] 2105344 4120 512
      2 [2019-05-09 10:25:22] 2105344 4120 512
      1 [2019-05-09 10:25:23] 2105344 4120 512

$ uniq -c /tmp/xx_10
      1 [2019-05-09 10:25:13] -rw-r----- 1 oracle oinstall 1056768 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      1 [2019-05-09 10:25:14] -rw-r----- 1 oracle oinstall 1056768 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:15] -rw-r----- 1 oracle oinstall 1056768 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:16] -rw-r----- 1 oracle oinstall 1056768 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:17] -rw-r----- 1 oracle oinstall 1056768 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:18] -rw-r----- 1 oracle oinstall 1056768 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:19] -rw-r----- 1 oracle oinstall 2105344 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:20] -rw-r----- 1 oracle oinstall 2105344 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:21] -rw-r----- 1 oracle oinstall 2105344 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      2 [2019-05-09 10:25:22] -rw-r----- 1 oracle oinstall 2105344 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
      1 [2019-05-09 10:25:23] -rw-r----- 1 oracle oinstall 2105344 may  9 10:25 /home/oracle/backup/t_10_1cu13qk9_1_1
--//这又看到另外的情况,当数据文件大于一定程度后,orcle备份方式生产的文件不再是接近数据文件大小.边界在哪里呢?
--//修改脚本延迟监测时间以及监测间隔.
$ cat  tt.sh
#! /bin/bash
file=$1
>| /tmp/xx_${file}
>| /tmp/yy_${file}
strace -ftt -x -o /tmp/tt_${file}.txt rman target / <<< "backup as compressed backupset datafile "$file" format \"/home/oracle/backup/t_"${file}"_%u\" ;" &
seq 30 | xargs -i{} echo "ls -l /home/oracle/backup/t_${file}_*;sleep 1" | bash 2>/dev/null| ts.awk >> /tmp/xx_${file} 2>/dev/null &
seq 30 | xargs -i{} echo "stat -c '%s %b %b' /home/oracle/backup/t_${file}_*;sleep 1" | bash  2>/dev/null | ts.awk >> /tmp/yy_${file} 2>/dev/null &
wait

--//采用不断尝试的方法最终确定:

scott@book> alter database   datafile '/mnt/ramdisk/book/t02.dbf' resize 65512k;
database altered.

scott@book> select 64*1024-8*3 from dual ;
64*1024-8*3
-----------
      65512

--//也就是64m-3*8k 就出现这个现象.
--//注:自己有点不转弯,在测试63m,64m时,应该可以猜测应该是64m-3*8k.在这里浪费许多时间...
--//只要数据文件再增加8k,这个现象就消失,不会开始建立的备份文件文件与数据文件接近,并且是稀疏文件.

$ . tt.sh 10
recovery manager: release 11.2.0.4.0 - production on thu may 9 10:46:27 2019
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to target database: book (dbid=1337401710)

rman>
starting backup at 2019-05-09 10:46:30
using target database control file instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=170 device type=disk
allocated channel: ora_disk_2
channel ora_disk_2: sid=184 device type=disk
allocated channel: ora_disk_3
channel ora_disk_3: sid=198 device type=disk
channel ora_disk_1: starting compressed full datafile backup set
channel ora_disk_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/mnt/ramdisk/book/t02.dbf
channel ora_disk_1: starting piece 1 at 2019-05-09 10:46:33
channel ora_disk_1: finished piece 1 at 2019-05-09 10:46:48
piece handle=/home/oracle/backup/t_10_1ku13rs9_1_1 tag=tag20190509t104632 comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:15
channel ora_disk_1: throttle time: 0:00:12
finished backup at 2019-05-09 10:46:48
rman>
recovery manager complete.
[1]   done                    strace -ftt -x -o /tmp/tt_${file}.txt rman target / <<< "backup as compressed backupset datafile "$file" format \"/home/oracle/backup/t_"${file}"_%u\" ;"
[2]-  done                    seq 30 | xargs -i{} echo "ls -l /home/oracle/backup/t_${file}_*;sleep 1" | bash 2> /dev/null | ts.awk >> /tmp/xx_${file} 2> /dev/null
[3]+  done                    seq 30 | xargs -i{} echo "stat -c '%s %b %b' /home/oracle/backup/t_${file}_*;sleep 1" | bash 2> /dev/null | ts.awk >> /tmp/yy_${file} 2> /dev/null

$ uniq -c /tmp/xx_10
      1 [2019-05-09 10:46:33] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:34] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:35] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:36] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:37] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:38] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:39] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:40] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:41] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:42] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:43] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:44] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:45] -rw-r----- 1 oracle oinstall 67117056 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:46] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:47] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:48] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:49] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:50] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:51] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:53] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:54] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:55] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:56] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1
      1 [2019-05-09 10:46:57] -rw-r----- 1 oracle oinstall 2859008 may  9 10:46 /home/oracle/backup/t_10_1ku13rs9_1_1

$ ls -l /mnt/ramdisk/book/t02.dbf
-rw-r----- 1 oracle oinstall 67092480 2019-05-09 10:46:33 /mnt/ramdisk/book/t02.dbf
--//数据文件大小是 65512+8 = 65520k(包括os头8k),65520*1024 = 67092480.
--//67117056 - 67092480 = 24576
--//24576/8192 = 3,也就是生成备份集文件大小是64m+8k= 64*1024*1024+8192 = 67117056
--//顺便讲一下我看了rman的压缩备份文件,我发现一个特点,位图区并不压缩.

$ uniq -c /tmp/yy_10
      1 [2019-05-09 10:46:33] 67117056 2072 512
      1 [2019-05-09 10:46:34] 67117056 2072 512
      1 [2019-05-09 10:46:35] 67117056 2072 512
      1 [2019-05-09 10:46:36] 67117056 2072 512
      1 [2019-05-09 10:46:37] 67117056 2072 512
      1 [2019-05-09 10:46:38] 67117056 4120 512
      1 [2019-05-09 10:46:39] 67117056 4120 512
      1 [2019-05-09 10:46:40] 67117056 4120 512
      1 [2019-05-09 10:46:41] 67117056 4120 512
      1 [2019-05-09 10:46:42] 67117056 4120 512
      1 [2019-05-09 10:46:43] 67117056 4120 512
      1 [2019-05-09 10:46:44] 67117056 4120 512
      1 [2019-05-09 10:46:45] 67117056 4120 512
      1 [2019-05-09 10:46:46] 2859008 5592 512
      1 [2019-05-09 10:46:47] 2859008 5592 512
      1 [2019-05-09 10:46:48] 2859008 5592 512
      1 [2019-05-09 10:46:49] 2859008 5592 512
      1 [2019-05-09 10:46:50] 2859008 5592 512
      1 [2019-05-09 10:46:51] 2859008 5592 512
      1 [2019-05-09 10:46:52] 2859008 5592 512
      1 [2019-05-09 10:46:53] 2859008 5592 512
      1 [2019-05-09 10:46:54] 2859008 5592 512
      1 [2019-05-09 10:46:55] 2859008 5592 512
      1 [2019-05-09 10:46:56] 2859008 5592 512

--//感觉还与rman的output buffer有关,rman有4个输出缓存,每个1m.

$ egrep "pwrite\(259|close\(259|pread\(261" /tmp/tt_10.txt | egrep -v '"\\x15\\xc2|\\x00\\xc2'
--//过滤egrep -v '"\\x15\\xc2|\\x00\\xc2'是控制文件.

36698 10:46:33.097624 close(259)        = 0
36698 10:46:33.163305 pread(261, "\x00\xa2\x00\x00\x00\x00\xc0\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9b\xe5\x00\x00\x00\x20\x00\x00\xfd\x1f\x00\x00\x7d\x7c\x7b\x7a"..., 8192, 0) = 8192
36698 10:46:33.163385 pread(261, "\x00\xa2\x00\x00\x00\x00\xc0\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9b\xe5\x00\x00\x00\x20\x00\x00\xfd\x1f\x00\x00\x7d\x7c\x7b\x7a"..., 8192, 0) = 8192
36698 10:46:33.163637 pread(261, "\x0b\xa2\x00\x00\x01\x00\x80\x02\x00\x00\x00\x00\x00\x00\x01\x04\x46\xd2\x00\x00\x00\x00\x00\x00\x00\x04\x20\x0b\x6e\x21\xb7\x4f"..., 1040384, 8192) = 1040384
36698 10:46:33.164208 pread(261, "\x20\xa2\x00\x00\x80\x00\x80\x02\x39\x4a\x84\x7d\x03\x00\x04\x04\x7a\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 1048576) = 1048576
36698 10:46:33.165452 pread(261, "\x20\xa2\x00\x00\x00\x01\x80\x02\x39\x4a\x84\x7d\x03\x00\x02\x04\x30\xe2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 2097152) = 1048576
36698 10:46:33.166685 pread(261, "\x20\xa2\x00\x00\x80\x01\x80\x02\x39\x4a\x84\x7d\x03\x00\x02\x04\x32\xe2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 3145728) = 1048576
36698 10:46:33.167927 pread(261, "\x20\xa2\x00\x00\x00\x02\x80\x02\x39\x4a\x84\x7d\x03\x00\x02\x04\x34\xe2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 4194304) = 1048576
36698 10:46:33.169149 pread(261, "\x20\xa2\x00\x00\x80\x02\x80\x02\x39\x4a\x84\x7d\x03\x00\x02\x04\x36\xe2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 5242880) = 1048576
36698 10:46:33.170374 pread(261, "\x20\xa2\x00\x00\x00\x03\x80\x02\x86\x4a\x84\x7d\x03\x00\x04\x04\x5e\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 6291456) = 1048576
36698 10:46:33.171624 pread(261, "\x20\xa2\x00\x00\x80\x03\x80\x02\x86\x4a\x84\x7d\x03\x00\x02\x04\x94\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 7340032) = 1048576
36698 10:46:33.172845 pread(261, "\x20\xa2\x00\x00\x00\x04\x80\x02\x86\x4a\x84\x7d\x03\x00\x02\x04\x96\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 8388608) = 1048576
36698 10:46:33.174057 pread(261, "\x20\xa2\x00\x00\x80\x04\x80\x02\x86\x4a\x84\x7d\x03\x00\x02\x04\x90\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 9437184) = 1048576
36698 10:46:33.175269 pread(261, "\x20\xa2\x00\x00\x00\x05\x80\x02\x86\x4a\x84\x7d\x03\x00\x02\x04\x92\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 10485760) = 1048576
36698 10:46:33.176554 pread(261, "\x20\xa2\x00\x00\x80\x05\x80\x02\xba\x4a\x84\x7d\x03\x00\x04\x04\xaa\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 11534336) = 1048576
36698 10:46:33.177782 pread(261, "\x20\xa2\x00\x00\x00\x06\x80\x02\xba\x4a\x84\x7d\x03\x00\x02\x04\xe0\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 12582912) = 1048576
36698 10:46:33.178994 pread(261, "\x20\xa2\x00\x00\x80\x06\x80\x02\xba\x4a\x84\x7d\x03\x00\x02\x04\xe2\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 13631488) = 1048576
36698 10:46:33.180217 pread(261, "\x20\xa2\x00\x00\x00\x07\x80\x02\xba\x4a\x84\x7d\x03\x00\x02\x04\xe4\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 14680064) = 1048576
36698 10:46:33.181433 pread(261, "\x20\xa2\x00\x00\x80\x07\x80\x02\xba\x4a\x84\x7d\x03\x00\x02\x04\xe6\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 15728640) = 1048576
36698 10:46:33.184438 pread(261, "\x20\xa2\x00\x00\x00\x08\x80\x02\xef\x4a\x84\x7d\x03\x00\x04\x04\xbd\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 16777216) = 1048576
36698 10:46:33.185021 pwrite(259, "\x13\xa2\x00\x00\x01\x00\x00\x00\x05\x56\x84\x7d\x03\x00\x01\x04\xd3\x5e\x00\x00\x00\x04\x20\x0b\x00\x04\x20\x0b\x6e\x21\xb7\x4f"..., 1048576, 8192) = 1048576
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36698 10:46:34.224895 pread(261, "\x20\xa2\x00\x00\x80\x08\x80\x02\xef\x4a\x84\x7d\x03\x00\x02\x04\x77\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 17825792) = 1048576
36698 10:46:34.260169 pread(261, "\x20\xa2\x00\x00\x00\x09\x80\x02\xef\x4a\x84\x7d\x03\x00\x02\x04\x75\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 18874368) = 1048576
36698 10:46:34.295845 pread(261, "\x20\xa2\x00\x00\x80\x09\x80\x02\xef\x4a\x84\x7d\x03\x00\x02\x04\x73\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 19922944) = 1048576
36698 10:46:34.331109 pread(261, "\x20\xa2\x00\x00\x00\x0a\x80\x02\xef\x4a\x84\x7d\x03\x00\x02\x04\x71\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 20971520) = 1048576
36698 10:46:34.332389 pread(261, "\x20\xa2\x00\x00\x80\x0a\x80\x02\x23\x4b\x84\x7d\x03\x00\x04\x04\x22\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 22020096) = 1048576
36698 10:46:35.368528 pread(261, "\x20\xa2\x00\x00\x00\x0b\x80\x02\x23\x4b\x84\x7d\x03\x00\x02\x04\x68\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 23068672) = 1048576
36698 10:46:35.404228 pread(261, "\x20\xa2\x00\x00\x80\x0b\x80\x02\x23\x4b\x84\x7d\x03\x00\x02\x04\x6a\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 24117248) = 1048576
36698 10:46:35.439582 pread(261, "\x20\xa2\x00\x00\x00\x0c\x80\x02\x23\x4b\x84\x7d\x03\x00\x02\x04\x6c\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 25165824) = 1048576
36698 10:46:35.474894 pread(261, "\x20\xa2\x00\x00\x80\x0c\x80\x02\x23\x4b\x84\x7d\x03\x00\x02\x04\x6e\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 26214400) = 1048576
36698 10:46:35.510190 pread(261, "\x20\xa2\x00\x00\x00\x0d\x80\x02\x58\x4b\x84\x7d\x03\x00\x04\x04\xac\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 27262976) = 1048576
36698 10:46:36.546546 pread(261, "\x20\xa2\x00\x00\x80\x0d\x80\x02\x58\x4b\x84\x7d\x03\x00\x02\x04\x66\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 28311552) = 1048576
36698 10:46:36.581819 pread(261, "\x20\xa2\x00\x00\x00\x0e\x80\x02\x58\x4b\x84\x7d\x03\x00\x02\x04\x64\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 29360128) = 1048576
36698 10:46:36.617296 pread(261, "\x20\xa2\x00\x00\x80\x0e\x80\x02\x58\x4b\x84\x7d\x03\x00\x02\x04\x62\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 30408704) = 1048576
36698 10:46:36.646622 pread(261, "\x20\xa2\x00\x00\x00\x0f\x80\x02\x58\x4b\x84\x7d\x03\x00\x02\x04\x60\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 31457280) = 1048576
36698 10:46:36.663066 pread(261, "\x20\xa2\x00\x00\x80\x0f\x80\x02\x8f\x4b\x84\x7d\x03\x00\x04\x04\x55\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 32505856) = 1048576
36698 10:46:37.698958 pread(261, "\x20\xa2\x00\x00\x00\x10\x80\x02\x8f\x4b\x84\x7d\x03\x00\x02\x04\x1f\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 33554432) = 1048576
36698 10:46:37.734314 pread(261, "\x20\xa2\x00\x00\x80\x10\x80\x02\x8f\x4b\x84\x7d\x03\x00\x02\x04\x1d\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 34603008) = 1048576
36698 10:46:37.770135 pread(261, "\x20\xa2\x00\x00\x00\x11\x80\x02\x8f\x4b\x84\x7d\x03\x00\x02\x04\x1b\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 35651584) = 1048576
36698 10:46:37.805641 pread(261, "\x20\xa2\x00\x00\x80\x11\x80\x02\x8f\x4b\x84\x7d\x03\x00\x02\x04\x19\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 1048576, 36700160) = 1048576
36698 10:46:37.841105 pread(261, "\x00\xa2\x00\x00\xf8\x1f\x80\x02\x00\x00\x00\x00\x00\x00\x01\x05\x78\xba\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 49152, 67043328) = 49152
36698 10:46:38.877862 pwrite(259, "\x38\xa2\x00\x00\x81\x00\x40\x00\x05\x56\x84\x7d\x03\x00\x01\x04\xd7\x67\x00\x00\x4b\x47\x43\x80\x01\x48\x44\x52\x4a\x31\x20\xa2"..., 1048576, 1056768) = 1048576
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36698 10:46:46.253197 pwrite(259, "\x38\xa2\x00\x00\x81\x00\x40\x00\x05\x56\x84\x7d\x03\x00\x01\x04\x26\xf1\x00\x00\x85\x61\x58\x56\x15\x85\x61\x58\x56\x15\x85\x61"..., 753664, 2105344) = 753664
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36698 10:46:46.257606 close(259)        = 0
36685 10:46:48.294566 close(259)        = 0
36685 10:46:48.338566 close(259)        = 0
36685 10:46:48.345322 close(259)        = 0
36685 10:46:48.459072 pread(261, "\x0b\xa2\x00\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x01\x04\xcd\xf4\x00\x00\x00\x00\x00\x00\x00\x04\x20\x0b\x6e\x21\xb7\x4f"..., 8192, 8192) = 8192
36685 10:46:48.607071 close(259)        = 0
--//注意看下划写的写入时间.与前面stat的输出对比blocks的变换.
--//2072*512 = 1060864,参考http://blog.itpub.net/267265/viewspace-2641011/=>[20190411]linux stat 命令疑问.txt
--//实际上大小还有减去4096(这块是间接块). 1060864-4096 = 1056768,
--//文件大小是1048576+8192 = 1056768,注意8192是偏移量是备份集的os文件头.
--//(4120-2072)*512 = 1048576
--//(5592 - 4120)*512 = 753664
--//写入量与stat的输出监测一致.

--//可以猜测rman压缩备份的大致步骤:
--//input buffer => compress => output buffer => write file.输出缓存到1m后写入备份文件.
--//不大可能如下:
--//input buffer => output buffer => compress => write file.因为这样每次的写入量大小不一致.当然这个是我的猜测.

6.bbed观察备份文件:
bbed> info
 file#  name                                  size(blks)
 -----  ----                                  ----------
     9  /mnt/ramdisk/book/t02.dbf                    0
    10  /mnt/ramdisk/book/t02.dbf                    0
   100  /home/oracle/backup/t_10_1ku13rs9_1_1        0

--//发现位图区并不压缩.
$ seq 1 349   | xargs -i{} echo "dump /v dba 100,{} count 4 offset 0" | rlbbed | grep a20000 |  uniq -c | cut -c1-20
      1  13a20000
      1  14a20000
      1  1da20000
    125  1ea20000
    219  38a20000
      1  37a20000

 $ seq 129   | xargs -i{} echo "dump /v dba 10,{} count 4 offset 0" | rlbbed | grep a20000 |  uniq -c | cut -c1-20
      1  0ba20000
      1  1da20000
    125  1ea20000
      1  20a20000
      1  21a20000

--//可以发现位图区开始信息都没有变.开头还是0x1ea20000,而且备份文件与数据文件存在1个块的偏移.备份集文件位图区前面正好是3*8k.(我测
--//试备份文件集仅仅1个数据文件的情况,其它我没有测试)
--//备份压缩开始数据块头都是0x38a20000,结尾是0x37a20000.

7.附上增加8k的测试情况:
scott@book> alter database   datafile '/mnt/ramdisk/book/t02.dbf' resize 65520k;
database altered.

$ . tt.sh 10
recovery manager: release 11.2.0.4.0 - production on thu may 9 11:38:45 2019
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to target database: book (dbid=1337401710)

rman>
starting backup at 2019-05-09 11:38:47
using target database control file instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=170 device type=disk
allocated channel: ora_disk_2
channel ora_disk_2: sid=184 device type=disk
allocated channel: ora_disk_3
channel ora_disk_3: sid=198 device type=disk
channel ora_disk_1: starting compressed full datafile backup set
channel ora_disk_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/mnt/ramdisk/book/t02.dbf
channel ora_disk_1: starting piece 1 at 2019-05-09 11:38:50
channel ora_disk_1: finished piece 1 at 2019-05-09 11:39:05
piece handle=/home/oracle/backup/t_10_1lu13uua_1_1 tag=tag20190509t113850 comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:15
channel ora_disk_1: throttle time: 0:00:12
finished backup at 2019-05-09 11:39:05
rman>
recovery manager complete.
[1]   done                    strace -ftt -x -o /tmp/tt_${file}.txt rman target / <<< "backup as compressed backupset datafile "$file" format \"/home/oracle/backup/t_"${file}"_%u\" ;"
[2]-  done                    seq 30 | xargs -i{} echo "ls -l /home/oracle/backup/t_${file}_*;sleep 1" | bash 2> /dev/null | ts.awk >> /tmp/xx_${file} 2> /dev/null
[3]+  done                    seq 30 | xargs -i{} echo "stat -c '%s %b %b' /home/oracle/backup/t_${file}_*;sleep 1" | bash 2> /dev/null | ts.awk >> /tmp/yy_${file} 2> /dev/null

$ uniq -c /tmp/xx_10
      1 [2019-05-09 11:38:51] -rw-r----- 1 oracle oinstall 1056768 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:52] -rw-r----- 1 oracle oinstall 1056768 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:53] -rw-r----- 1 oracle oinstall 1056768 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:54] -rw-r----- 1 oracle oinstall 1056768 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:55] -rw-r----- 1 oracle oinstall 1056768 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:56] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:57] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:58] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:38:59] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:00] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:01] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:02] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:03] -rw-r----- 1 oracle oinstall 2105344 may  9 11:38 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:04] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:05] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:06] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:07] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:08] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:09] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:10] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:11] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:12] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:13] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1
      1 [2019-05-09 11:39:14] -rw-r----- 1 oracle oinstall 2867200 may  9 11:39 /home/oracle/backup/t_10_1lu13uua_1_1

$ uniq -c /tmp/yy_10
      1 [2019-05-09 11:38:51] 1056768 2072 512
      1 [2019-05-09 11:38:52] 1056768 2072 512
      1 [2019-05-09 11:38:53] 1056768 2072 512
      1 [2019-05-09 11:38:54] 1056768 2072 512
      1 [2019-05-09 11:38:55] 1056768 2072 512
      1 [2019-05-09 11:38:56] 2105344 4120 512
      1 [2019-05-09 11:38:57] 2105344 4120 512
      1 [2019-05-09 11:38:58] 2105344 4120 512
      1 [2019-05-09 11:38:59] 2105344 4120 512
      1 [2019-05-09 11:39:00] 2105344 4120 512
      1 [2019-05-09 11:39:01] 2105344 4120 512
      1 [2019-05-09 11:39:02] 2105344 4120 512
      1 [2019-05-09 11:39:03] 2105344 4120 512
      1 [2019-05-09 11:39:04] 2867200 5608 512
      1 [2019-05-09 11:39:05] 2867200 5608 512
      1 [2019-05-09 11:39:06] 2867200 5608 512
      1 [2019-05-09 11:39:07] 2867200 5608 512
      1 [2019-05-09 11:39:08] 2867200 5608 512
      1 [2019-05-09 11:39:09] 2867200 5608 512
      1 [2019-05-09 11:39:10] 2867200 5608 512
      1 [2019-05-09 11:39:11] 2867200 5608 512
      1 [2019-05-09 11:39:12] 2867200 5608 512
      1 [2019-05-09 11:39:13] 2867200 5608 512
      1 [2019-05-09 11:39:14] 2867200 5608 512

7.总结:
--//1.当小数据文件备份时(8k数据块)(备份集1个数据文件的情况),大小小于等于64m-3*8k时,开始备份生成的备份集文件大小等于数据
--//文件大小(包括os块)+3*8k.
--//2.我没有测试一个备份集包含多个文件的情况.
--//3.oracle为什么这样设计小数据文件的备份方式,也看不出有什么优势啊...