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

  • 相关阅读:
    javaScript表单焦点自动切换
    JavaScript禁止用户多次提交方法
    javaScript事件机制兼容【整理】
    DOM元素尺寸和位置(clientwidth ,scrollwidth , offsetwidth.......)
    javaScript给元素添加多个class
    javaScript增加样式规则(新增样式)
    javaScript动态添加样式
    工作中遇到的各种jar包说明
    springboot—Jpa原生sql使用
    Des3EncryptionUtil加密与解密
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/8023863.html
Copyright © 2011-2022 走看看