性能测试常用语句

    xiaoxiao2022-07-02  103

    –在应用服务器查询dump文件(内存过大) jmap -dump:format=b,file=jconsole.dump 端口号 路径: /home

    –CPU过高时查询 线程 jstack 端口号 >>javacore.txt 路径: /root

    –查询进程 select ss.value “CPU used”, sa.SQL_FULLTEXT, sql_text, s.SERIAL#, s.sid, logon_time, last_call_et “time inactive”, nvl(s.username, ‘ORACLE PROCESS’) username, s.machine, s.program, s.sid session_id, s.status, trunc(buffer_gets / (executions + 1)) “BUFF-EXEC”, trunc(buffer_gets / (rows_processed + 1)) “BUFF-ROWS”, first_load_time, executions, parse_calls, disk_reads, buffer_gets, rows_processed from v s e s s i o n s , v session s, v sessions,vsesstat ss, v s t a t n a m e s n , v statname sn, v statnamesn,vsqlarea sa where s.sid = ss.sid and ss.statistic# = sn.statistic# and sn.name = ‘CPU used by this session’ and s.sql_address = sa.address and s.sql_hash_value = sa.hash_value and status=‘ACTIVE’ – and username=‘ZDH20190516’–数据库的名字 – and username=’’ – and last_call_et > 1000 order by ss.value desc

    –查询死锁 SELECT l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user_name, s.machine, s.terminal, o.object_name, s.logon_time FROM v l o c k e d o b j e c t l , a l l o b j e c t s o , v locked_object l, all_objects o, v lockedobjectl,allobjectso,vsession s WHERE l.object_id = o.object_id AND l.session_id = s.sid ORDER BY sid, s.serial#; –删除死锁进程 alter system kill session’247,23861’ ;

    –查询数据库连接数 select count(1),machine,status from v$session where username=‘ZDH20190516’ AND MAChINE=‘linux39’ group by machine,status;

    –打开jconsole cd /home/weblogic/jre/jdk1.7.0_80/bin

    在数据库服务器中: –切换sqlplus状态 su - oracle–是切用户的 sqlplus zdh20190516/zdh20190516–是使用oracle连接数据库 –以dba权限登录数据库 : conn /as sysdba

    –插入节点 Exec dbms_workload_repository.create_snapshot(); –抓取awr报告 @?/rdbms/admin/awrrpt.sql –地址 /home/oracle

    –nmon //-s是采样频率,隔多长时间收集一次,这里我指定的是2秒一次; //-c是采样次数,一共要收集多少次,这里我指定的是900次。 ./nmon -F ycy_chka.nmon -s 10 -c 900 –地址 /home/nmon

    堆内存 /home/weblogic/12c/user_projects/domains/base_8083/bin/setDomainEnv.sh

    –造数公式 =LEFT(A3,7)&RIGHT(A3,LEN(A3)-7)+1

    最新回复(0)