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

  • 相关阅读:
    缓存雪崩与缓存穿透
    读取表中最大值
    使用vscode在谷歌上运行代码
    elment 中tree组件展开所有和收缩所有节点
    深度系统商店提示无法安装软件依赖错误
    诗词,理解,品论
    《45个十分钟读懂资本论》原文、适合朗读版和个人见解
    《论持久战》全文
    OSError: [WinError 126] 找不到指定的模块。
    C++ 获取序列最大(或最小)的 N 个元素
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/8023863.html
Copyright © 2011-2022 走看看