[20171128]rman Input or output Memory Buffers.txt

--//做一个简单测试rman 的Input or output Memory Buffers.

1.环境:
SCOTT@book> @ &r/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

--// drop tablespace sugar including contents and datafiles;
CREATE TABLESPACE SUGAR DATAFILE
  '/mnt/ramdisk/book/sugar01.dbf' SIZE 11M AUTOEXTEND OFF
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

create table t1 tablespace sugar as select rownum id ,lpad('A',32,'A') name from dual connect by level<=2e5;

SCOTT@book> select sum(bytes) from dba_extents where owner=user and segment_name in ('T1');
SUM(BYTES)
----------
  10485760

--//rman配置:
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128k;
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;
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

--//建立测试脚本.
$ cat out.sh
#!/bin/bash
rman target / <<EOF &
backup as copy datafile 7 format '/home/oracle/backup/%b_1' ;
EOF
for i in {1..100}
do
    echo -n $(date +%H%M%S) ":" >> /tmp/aaa.txt
    strings /home/oracle/backup/sugar01.dbf_1 2>/dev/null | grep "AAAAA" |wc >> /tmp/aaa.txt 2>/dev/null
    sleep 1
done

2.做表空间sugar的映像备份:
$ . out.sh
....
Starting backup at 2017-11-28 15:09:25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=144 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/mnt/ramdisk/book/sugar01.dbf
output file name=/home/oracle/backup/sugar01.dbf_1 tag=TAG20171128T150925 RECID=69 STAMP=961254653
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35
channel ORA_DISK_1: throttle time: 0:01:28
Finished backup at 2017-11-28 15:11:00

Starting Control File and SPFILE Autobackup at 2017-11-28 15:11:00
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2017_11_28/o1_mf_s_961254660_f1t304tk_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2017-11-28 15:11:01
....

$ cut -d":" -f2 /tmp/aaa.txt  | uniq -c
      9       0       0       0
      6   20058   34093  725881
      6   41226   70058 1491458
      7   62394  106045 2256986
      6   83562  142017 3023196
      6  104730  178013 3794099
      6  125898  214038 4560480
      6  147066  250034 5326802
      6  168234  286030 6093124
      6  189402  322053 6859500
     36  200000  340080 7243181
--//可以发现前9秒没有AAAA.

$ time strings /home/oracle/backup/sugar01.dbf_1 2>/dev/null | grep "AAAAA" |wc
 200000  340080 7243181
real    0m0.336s
user    0m0.410s
sys     0m0.032s

--//单独执行strings消耗.0410s.这样6次,strings大约消耗2.4秒.这样大约8秒,AAAA的次数就发生变化.
--//而CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128k;这样1M数据量就需要8秒.

--//另外还可以看出前后相减:
 20058 - 0 = 20058
 41226 - 20058 = 21168
 62394 - 41226 = 21168
 83562 - 62394 = 21168
104730 - 83562 = 21168
125898 -104730 = 21168
147066 -125898 = 21168
168234 -147066 = 21168
189402 -168234 = 21168

--//除了第1个数量是20058外,其它都是21168.

SCOTT@book> column PARTITION_NAME noprint
SCOTT@book> select * from dba_extents where segment_name='T1';
OWNER  SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME  EXTENT_ID    FILE_ID   BLOCK_ID      BYTES     BLOCKS RELATIVE_FNO
------ ------------ ------------ --------------- ---------- ---------- ---------- ---------- ---------- ------------
SCOTT  T1           TABLE        SUGAR                    0          7        128      65536          8            7
SCOTT  T1           TABLE        SUGAR                    1          7        136      65536          8            7
SCOTT  T1           TABLE        SUGAR                    2          7        144      65536          8            7
SCOTT  T1           TABLE        SUGAR                    3          7        152      65536          8            7
SCOTT  T1           TABLE        SUGAR                    4          7        160      65536          8            7
SCOTT  T1           TABLE        SUGAR                    5          7        168      65536          8            7
SCOTT  T1           TABLE        SUGAR                    6          7        176      65536          8            7
SCOTT  T1           TABLE        SUGAR                    7          7        184      65536          8            7
SCOTT  T1           TABLE        SUGAR                    8          7        192      65536          8            7
SCOTT  T1           TABLE        SUGAR                    9          7        200      65536          8            7
SCOTT  T1           TABLE        SUGAR                   10          7        208      65536          8            7
SCOTT  T1           TABLE        SUGAR                   11          7        216      65536          8            7
SCOTT  T1           TABLE        SUGAR                   12          7        224      65536          8            7
SCOTT  T1           TABLE        SUGAR                   13          7        232      65536          8            7
SCOTT  T1           TABLE        SUGAR                   14          7        240      65536          8            7
SCOTT  T1           TABLE        SUGAR                   15          7        248      65536          8            7
SCOTT  T1           TABLE        SUGAR                   16          7        256    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   17          7        384    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   18          7        512    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   19          7        640    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   20          7        768    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   21          7        896    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   22          7       1024    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   23          7       1152    1048576        128            7
SCOTT  T1           TABLE        SUGAR                   24          7       1280    1048576        128            7
25 rows selected.

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 128 and 256-1;
  COUNT(*)
----------
     20058

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 256 and 384-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 384 and 512-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 512 and 640-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 640 and 768-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 768 and 896-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 896 and 1024-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 1024 and 1152-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 1152 and 1280-1;
  COUNT(*)
----------
     21168

SCOTT@book> select count(*) from t1 where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) >= 1280 ;
  COUNT(*)
----------
     10598

--//8*21168+20058=189402
--//189402+10598=200000
--//说明oracle 的输出缓存是1M.

--//你可能认为不是顺序读取.
--//修改一定的记录看看.

update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 128 and 256-1   and rownum<=1;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 256 and 384-1   and rownum<=2;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 384 and 512-1   and rownum<=3;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 512 and 640-1   and rownum<=4;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 640 and 768-1   and rownum<=5;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 768 and 896-1   and rownum<=6;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 896 and 1024-1  and rownum<=7;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 1024 and 1152-1 and rownum<=8;
update t1 set name=lpad('B',32,'B') where DBMS_ROWID.ROWID_BLOCK_NUMBER (rowid) between 1152 and 1280-1 and rownum<=9;
commit;
alter system checkpoint;
alter system checkpoint;
alter system checkpoint;

$ cat out1.sh
#!/bin/bash
rman target / <<EOF &
backup as copy datafile 7 format '/home/oracle/backup/%b_1' ;
EOF
for i in {1..100}
do
    echo -n $(date +%H%M%S-%N) ":" >> /tmp/aaa.txt
    strings /home/oracle/backup/sugar01.dbf_1 2>/dev/null | grep "BBBBB" |wc >> /tmp/aaa.txt 2>/dev/null
    sleep 1
done

$ . out1.sh
....
Starting backup at 2017-11-28 15:22:35
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=132 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/mnt/ramdisk/book/sugar01.dbf
output file name=/home/oracle/backup/sugar01.dbf_1 tag=TAG20171128T152235 RECID=70 STAMP=961255443
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35
channel ORA_DISK_1: throttle time: 0:01:28
Finished backup at 2017-11-28 15:24:10

Starting Control File and SPFILE Autobackup at 2017-11-28 15:24:10
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2017_11_28/o1_mf_s_961255450_f1t3rtys_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2017-11-28 15:24:11
...

$ cut -d":" -f2 /tmp/aaa.txt  | uniq -c
      9       0       0       0
      6       1       1      34
      6       3       5     105
      7       6       8     209
      6      10      16     352
      6      15      26     541
      7      21      38     762
      6      28      47    1009
      6      36      63    1304
     30      45      81    1636

--//前后相减正好是1,2,3,4,5,6,7,8,9.不正说明是顺序读取的吗?
--//没有测试input memory buffer.有点长,另外写一篇.

[20171128]rman Input or output Memory Buffers.txt的更多相关文章

  1. Input and Output File

    Notes from C++ Primer File State Condition state is used to manage stream state, which indicates if ...

  2. Java中的IO流,Input和Output的用法,字节流和字符流的区别

    Java中的IO流:就是内存与设备之间的输入和输出操作就成为IO操作,也就是IO流.内存中的数据持久化到设备上-------->输出(Output).把 硬盘上的数据读取到内存中,这种操作 成为 ...

  3. 7. Input and Output

    7. Input and Output There are several ways to present the output of a program; data can be printed i ...

  4. [20160704]Addition program that use JOptionPane for input and output

    //Addition program that use JOptionPane for input and output. import javax.swing.JOptionPane; public ...

  5. Python Tutorial 学习(七)--Input and Output

    7. Input and Output Python里面有多种方式展示程序的输出.或是用便于人阅读的方式打印出来,或是存储到文件中以便将来使用.... 本章将对这些方法予以讨论. 两种将其他类型的值转 ...

  6. [Python] Print input and output in table

    Print the input and output in a table using prettyTable. from prettytable import PrettyTable import ...

  7. Angular4学习笔记(六)- Input和Output

    概述 Angular中的输入输出是通过注解@Input和@Output来标识,它位于组件控制器的属性上方. 输入输出针对的对象是父子组件. 演示 Input 新建项目connInComponents: ...

  8. Python - 3. Input and Output

    from:http://interactivepython.org/courselib/static/pythonds/Introduction/InputandOutput.html Input a ...

  9. Angular2中Input和Output

    @Input @Input是用来定义模块的输入的,用来让父模块往子模块传递内容: @Output 子模块自定义一些event传递给父模块用@Output. 对于angular2中的Input和Outp ...

随机推荐

  1. scrapy 框架入门

    运行流程 官网:https://docs.scrapy.org/en/latest/intro/overview.html 流程图如下: 组件 1.引擎(EGINE):负责控制系统所有组件之间的数据流 ...

  2. inception安装使用

    一个集审核.执行.备份及生成回滚语句于一身的MySQL自动化运维工具,由去哪网开源 安装 CentOS 7 Python 3.6 安装基础环境 yum -y install cmake libncur ...

  3. 课程四(Convolutional Neural Networks),第一周(Foundations of Convolutional Neural Networks) —— 1.Practice questions:The basics of ConvNets

    [解释] 100*(300*300*3)+ 100=27000100 [解释] (5*5*3+1)*100=7600 [中文翻译] 您有一个输入是 63x63x16, 并 将他与32个滤波器卷积, 每 ...

  4. Python获取网页指定内容(BeautifulSoup工具的使用方法)

    Python用做数据处理还是相当不错的,如果你想要做爬虫,Python是很好的选择,它有很多已经写好的类包,只要调用,即可完成很多复杂的功能,此文中所有的功能都是基于BeautifulSoup这个包. ...

  5. Eclipse常用注释设置

    菜单:Window→Preferences→Java→Code Style→Code Template Files /** * @Title: ${file_name} * @Package ${pa ...

  6. 从零开始学 Web 之 jQuery(三)元素操作,链式编程,动画方法

    大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...

  7. 从零开始学 Web 之 移动Web(二)JD移动端网页,移动触屏事件

    大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...

  8. SQL 必知必会·笔记<7>汇总数据——使用聚合函数

    有时候我们需要对表中的数据进行汇总,而不需要数据本身,为了方便这些类型的检索,SQL给出了5个聚合函数,SQL聚合函数在各主要的SQL实现中得到了相当一致的支持.如下: 1.1 AVG()函数 AVG ...

  9. kubeadm部署kubernetes-1.12.0 HA集群-ipvs

    一.概述 主要介绍搭建流程及使用注意事项,如果线上使用的话,请务必做好相关测试及压测. 1.基础环境准备 系统:ubuntu TLS 16.04  5台 docker-ce:17.06.2 kubea ...

  10. About me & 一些置顶的博文

    About me 一只历史上最弱的 \(\text{hnoier}\) ... 身在 \(\text{hn}\) 弱校,除了在四大名校夹缝中生存,还要受到同校 \(\text{Julao}\) 的鄙视 ...