zoukankan      html  css  js  c++  java
  • 模拟IO 读写压力测试

    #### 本实验室通过创建一个测试表myTestTable ,分配在一个足够大小的表空间。

    ###然后通过 insert select 方式,创建100个后台进程进行读写操作,每个后台进程预计时间20分钟以上。

    0.create table

    create table myTestTable as
    select rownum as id,
    to_char(sysdate + rownum/24/3600, 'yyyy-mm-dd hh24:mi:ss') as inc_datetime,
    trunc(dbms_random.value(0, 100)) as random_id,
    dbms_random.string('x', 20) random_string
    from dual
    connect by level <= 10;


    1./tmp/dba/select.sql

    select rownum as id,
    to_char(sysdate + rownum/24/3600, 'yyyy-mm-dd hh24:mi:ss') as inc_datetime,
    trunc(dbms_random.value(0, 100)) as random_id,
    dbms_random.string('x', 20) random_string
    from dual
    connect by level <= 100000;

    2./tmp/dba/insert.sql

    insert myTestTable as

    select rownum as id,
    to_char(sysdate + rownum/24/3600, 'yyyy-mm-dd hh24:mi:ss') as inc_datetime,
    trunc(dbms_random.value(0, 100)) as random_id,
    dbms_random.string('x', 20) random_string
    from dual
    connect by level <= 100000;

    (test shell)

    #!/bin/bash

    sum=0

    i=1

    while(( i <= 100 ))
    do
    let "sum+=i"
    let "i += 1"
    done

    echo "sum=$sum"


    4.
    more main.sh
    #!/bin/bash
    sum=0
    i=1
    while ((i <=100))
    do
    ##let "sum+=i"
    nohup sh /tmp/dba1/insert.sh &
    let "i +=1"
    done
    echo "sum=$sum"

    $ more insert.sh

    #!/bin/bash
    sqlplus / as sysdba << eof1
    insert into myTestTable
    select rownum as id,
    to_char(sysdate + rownum/24/3600, 'yyyy-mm-dd hh24:mi:ss') as inc_datetime,
    trunc(dbms_random.value(0, 100)) as random_id,
    dbms_random.string('x', 20) random_string
    from dual
    connect by level <= 10000000;
    commit;
    spool off
    eof1

    6.
    ORACLE_CRS_HOME=/db/core/oracleapp/crs
    HOME=/home/db
    ORACLE_HOME=/db/core/oracleapp/10.2.0

  • 相关阅读:
    python3 进程_multiprocessing模块
    python3 线程_threading模块
    python3 异常处理
    python3 面向对象补充
    python3 多态,绑定方法与非绑定方法
    python3 uper(),继承实现原理,封装
    python3 面向对象、类、继承、组合、派生、接口、子类重用父类方法
    python3 正则表达式re模块
    python3 json、logging、sys模块
    mysql查询练习
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/8023863.html
Copyright © 2011-2022 走看看