1128rman Input or output Memory Buffers

[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.有点长,另外写一篇.

时间: 2024-10-02 11:44:04

1128rman Input or output Memory Buffers的相关文章

[20171128]rman Input or output Memory Buffers.txt

[20171128]rman Input or output Memory Buffers.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.摘要如下: Oracle RMAN 11g Backup and Recovery.pdf 作者:Robert G. Freeman Matthew Hart 页数:689 出版社:Mc graw hill 出版号: ISBN: 978-0-07-162861-7         MHID: 0-07-16286

[20171205]rman output Memory Buffers 2

[20171205]关于rman output Memory Buffers 2.txt --//昨天在QQ上与人聊天,再次提到这个问题.感觉在链接http://blog.itpub.net/267265/viewspace-2147866/上的说服力不强. --//我当时仅仅想说明oracle的备份是顺序读取数据文件的. --//另外在链接http://blog.itpub.net/267265/viewspace-2147878/提到: ■ If the number of files be

C++中格式化输入输出(formatted input and output) 详解

格式化输入输出, 是在<iostream>的头文件中, 控制格式; 如果修改输入输出的格式, 会影响之后的格式, 需要重置, 一般在格式类型之前添加"no", 即可; 支持, 8进制, 16进制, 默认10进制, 以及大写(uppercase)模式; 代码: /* * cppprimer.cpp * * Created on: 2013.11.28 * Author: Caroline */ /*eclipse cdt, gcc 4.8.1*/ #include <i

SQL server中的input和output关键字

问题描述 当什么时候用output,什么时候用input,这样做有何意义? 解决方案 解决方案二:input!~没用过..output是输出参数..可以取到值!~解决方案三:input!~没用过..output是输出参数..解决方案四: 解决方案五:output,做参数还可以返回值解决方案六:当你的存储过程需要返回两个或以上的值的时候,你就会发现Output很有用了.Input我好像没用过解决方案七:input,输入参数,默认的参数就是input的output,输出参数

分清Input与Output的硬件产品才算得上出色

摘要: 点名时间上周末在深圳举办了第三届10x10智能产品趋势大会,创始人张佑宣布点名将放弃众筹的模式开始专注智能硬件领域.同时他还向现场的创业者.投资人分享了其对智能硬件的看 点名时间上周末在深圳举办了第三届10x10智能产品趋势大会,创始人张佑宣布点名将放弃众筹的模式开始专注智能硬件领域.同时他还向现场的创业者.投资人分享了其对智能硬件的看法. 除了宣布点名接下来的定位之外,点名还将与戈壁投资.富智康.36氪.京东与兰亭集势展开合作,打消智能硬件创业者在投资.媒体.销售等一系列问题上的顾虑.

java中的Io(input与output)操作总结(一)_java

所谓IO,也就是Input与Output的缩写.在java中,IO涉及的范围比较大,这里主要讨论针对文件内容的读写 其他知识点将放置后续章节(我想,文章太长了,谁都没耐心翻到最后) 对于文件内容的操作主要分为两大类 分别是: 字符流 字节流 其中,字符流有两个抽象类:Writer Reader 其对应子类FileWriter和FileReader可实现文件的读写操作 BufferedWriter和BufferedReader能够提供缓冲区功能,用以提高效率 同样,字节流也有两个抽象类:Input

multipath多路径设备input及output error读写错误

初始化ocr盘的时候,报磁盘读写错误. 对多路径设备进行读写测试的时候,报错input/output error dd if=/dev/zero of=/dev/mapper/vot1 bs=1Mcount=1000 dd: writing `/dev//mapper/vot1 ':Input/output error 1+0 records in 0+0 records out 原因在多路径的配置上面,产看multipath –ll vot1 (360080e50001fa2d0000003b

java中的Io(input与output)操作总结(三)_java

说实话,其实我并不是很喜欢Java这门语言,尽管它很强大,有很多现成的API可以调用 但我总感觉它把简单的事情弄得太过复杂,甚至有时候会让人迷失 弄不清到底是为了写出东西,还是为了语言本身 我学习的第一门编程语言是Python,虽然学的不深 但是它的简单优雅至今令人难忘(呃,其实也就两年前的事--) 我接触的第二门语言是C,它给我的感觉是一种纯粹,一种高效的灵活 而不是类似java,写一堆含糊的代码来实现一个小小的功能 坦白讲,如果一个人在学习自己不感兴趣的东西,那会很累 支撑我的是,我对移动开

java中的Io(input与output)操作总结(四)_java

前面已经把java io的主要操作讲完了 这一节我们来说说关于java io的其他内容 Serializable序列化 实例1:对象的序列化 复制代码 代码如下: import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; @SuppressWarnings("ser