LinuxRPC http sourceforge netprojectsrstatd rootrstatd configure make install

  • Slides: 56
Download presentation

Linux服务器RPC组建安装 • 下载http: //sourceforge. net/projects/rstatd • 使用root用户安装rstatd –. /configure – make install 配置 编译

Linux服务器RPC组建安装 • 下载http: //sourceforge. net/projects/rstatd • 使用root用户安装rstatd –. /configure – make install 配置 编译 安装 • 启动. /rpc. rstatd start

使用awk生成大文本文件 • 用户表subscriber有4个字段(subsid, name, Subs. Cat, REGISTDATE),其中name非必填字段

使用awk生成大文本文件 • 用户表subscriber有4个字段(subsid, name, Subs. Cat, REGISTDATE),其中name非必填字段

使用awk生成大文本文件 • 使用awk内置函数printf生成文件,例如: awk ‘{ file=sprintf(“subscriber. txt”) for( i=0; i<10; i++ ) { printf”

使用awk生成大文本文件 • 使用awk内置函数printf生成文件,例如: awk ‘{ file=sprintf(“subscriber. txt”) for( i=0; i<10; i++ ) { printf” 136%08 d, A, 20090801 101213 /n”, i >file } }’ </dev/null

使用awk生成大文本文件 生成文件subscriber. txt内容: 1360000, A, 20090801 101213 13600000001, A, 20090801 101213 13600000002, A, 20090801

使用awk生成大文本文件 生成文件subscriber. txt内容: 1360000, A, 20090801 101213 13600000001, A, 20090801 101213 13600000002, A, 20090801 101213 13600000003, A, 20090801 101213 13600000004, A, 20090801 101213 13600000005, A, 20090801 101213 13600000006, A, 20090801 101213 13600000007, A, 20090801 101213 13600000008, A, 20090801 101213 13600000009, A, 20090801 101213

使用sqlloader导入文件到数据库 • 创建控制文件: subscriber. ctl LOAD DATA --导入标识 INFILE 'subscriber. txt' --导入文本文件 INTO TABLE

使用sqlloader导入文件到数据库 • 创建控制文件: subscriber. ctl LOAD DATA --导入标识 INFILE 'subscriber. txt' --导入文本文件 INTO TABLE Subscriber --表 APPEND --导入方式 FIELDS TERMINATED BY ', ' --字段分隔符 (Subs. Id, Subs. Cat, REGISTDATE "YYYYMMDDHH 24 MISS" 型的需要说明 ) --date类

使用sqlloader导入文件到数据库 • 执行导入 sqlldr dbuser/oracle control=subscriber. ctl rows=10000 bindsize=8192000 readsize=8192000 自动调整到较大者 log=subscriber_. log bad=subscriber.

使用sqlloader导入文件到数据库 • 执行导入 sqlldr dbuser/oracle control=subscriber. ctl rows=10000 bindsize=8192000 readsize=8192000 自动调整到较大者 log=subscriber_. log bad=subscriber. bad direct=true >/dev/null 析 --数据库连接串 --控制文件 --每次提交的记录数 --每次提交记录的缓冲区 --与bindsize成对使用,其中较小者会 --日志文件 --错误记录文件 --通过直通方式上载,不进行SQL解

调用dll中的函数 • 本地调用:使用lr_load_dll 函数 • dll文件放在脚本目录下 lr_load_dll("lrlib. dll"); …… lr_start_transaction("Auth. Price. Req_WAPPull"); lrs_save_param("socket 0",

调用dll中的函数 • 本地调用:使用lr_load_dll 函数 • dll文件放在脚本目录下 lr_load_dll("lrlib. dll"); …… lr_start_transaction("Auth. Price. Req_WAPPull"); lrs_save_param("socket 0", LRS_LAST_RECEIVED , "Length", 0, 4); length = lrs_hex_str_to_int( lr_eval_string("<Length>" ));

Unique number类型参数介绍 • Number Range – Start,开始值 – Block Size, 循环块大小,可以理解为两个Vuser之间的间隔 • 如果Start= 0,

Unique number类型参数介绍 • Number Range – Start,开始值 – Block Size, 循环块大小,可以理解为两个Vuser之间的间隔 • 如果Start= 0, Block Size= 10; 2个Vuser,迭代 10次 迭代次 1 数 2 3 4 5 6 7 8 9 10 Vuser 1 0 1 2 3 4 5 6 7 8 9 Vuser 2 10 11 12 13 14 15 16 17 18 19

Unique number类型参数介绍 • When out of value – Abort the Vuser 终止 – Continue

Unique number类型参数介绍 • When out of value – Abort the Vuser 终止 – Continue in a cyclic manner 从开始值循环取值 – Continue with last value 使用最后一个值 • 避免Unique number越界 – When out of value使用“Abort the Vuser ”时,控制好Block Size 、 Vuser数量、迭代次数之间的关系; Block Size 最好大于等于迭代 次数;

数据库性能定位 • 查找存在性能瓶颈的sql:在数据库主机上使用top,找 到cpu占用率最高的pid; select sql_text from v$sqltext_with_newlines where (hash_value, address) in (select sql_hash_value,

数据库性能定位 • 查找存在性能瓶颈的sql:在数据库主机上使用top,找 到cpu占用率最高的pid; select sql_text from v$sqltext_with_newlines where (hash_value, address) in (select sql_hash_value, sql_address from v$session where sid = (select ses. sid from v$session ses, v$process pro where pro. spid = &spid and ses. paddr = pro. addr)) order by address, piece;

数据库性能定位 • 查锁表 SELECT /*+ rule */ lpad(' ', decode(l. xidusn , 0, 3,

数据库性能定位 • 查锁表 SELECT /*+ rule */ lpad(' ', decode(l. xidusn , 0, 3, 0))||l. oracle_username User_name, o. owner, o. object_name, o. object_type, s. machine, s. terminal, s. program, s. osuser, s. username, s. sid, s. serial#, s. process, x. sql_text FROM v$locked_object l, dba_objects o, v$session s, v$sqlarea x WHERE l. object_id=o. object_id AND l. session_id=s. sid AND s. sql_hash_value=x. hash_value(+) ORDER BY o. object_id, xidusn DESC;