如何测试Oracle并行执行的并行度状况
如何测试Oracle并行执行的并行度状况:
可以通过如下的脚本,来查看要求的并行度,和实际获得的并行度。
脚本来自:
http://askdba.org/weblog/forums/topic/query-to-identify-parallel-slaves/
col username for a12
col module for a10 trunc
col state for a20
col "QC SID" for A6
col SID for a10
col "QC/Slave" for A10
col "ReqDOP" for 999
col "ActDOP" for 999
col "slave set" for A10
col event for a25 trunc
col action for a20 trunc
col p1text for a20 trunc
col secwait for 99999
col state for a10 trunc
col object for a25 trunc
col command for a15 trunc
set pages 300 lines 300
select
s.inst_id,
decode(px.qcinst_id,NULL,s.username,
' - '||lower(substr(s.program,length(s.program)-4,4) ) ) "Username",
decode(px.qcinst_id,NULL, 'QC', '(Slave)') "QC/Slave" ,
to_char( px.server_set) "Slave Set",
to_char(s.sid) "SID",
decode(px.qcinst_id, NULL ,to_char(s.sid) ,px.qcsid) "QC SID",
px.req_degree "Requested DOP",
px.degree "Actual DOP",s.module,s.sql_id,s.event,s.status
from
gv$px_session px,
gv$session s
where
px.sid=s.sid (+) and
px.serial#=s.serial# and
px.inst_id = s.inst_id
order by 2 desc;
在Oracel 11.2.0.4进行实际测试,有效。
实际例子:
$cat q00.sql
col username for a12
col module for a10 trunc
col state for a20
col "QC SID" for A6
col SID for a10
col "QC/Slave" for A10
col "ReqDOP" for 999
col "ActDOP" for 999
col "slave set" for A10
col event for a25 trunc
col action for a20 trunc
col p1text for a20 trunc
col secwait for 99999
col state for a10 trunc
col object for a25 trunc
col command for a15 trunc
set pages 300 lines 300
select
s.inst_id,
decode(px.qcinst_id,NULL,s.username,
' - '||lower(substr(s.program,length(s.program)-4,4) ) ) "Username",
decode(px.qcinst_id,NULL, 'QC', '(Slave)') "QC/Slave" ,
to_char( px.server_set) "Slave Set",
to_char(s.sid) "SID",
decode(px.qcinst_id, NULL ,to_char(s.sid) ,px.qcsid) "QC SID",
px.req_degree "Requested DOP",
px.degree "Actual DOP",s.module,s.sql_id,s.event,s.status
from
gv$px_session px,
gv$session s
where
px.sid=s.sid (+) and
px.serial#=s.serial# and
px.inst_id = s.inst_id
order by 2 desc;
==============================
设置参数:
alter system set PARALLEL_MIN_TIME_THRESHOLD=1 scope=spfile;
alter system set PARALLEL_DEGREE_POLICY=auto scope=spfile;
shu immediate
startup
===================================
通过别的Session,查看状况: <<<<<<<<<<<<<<Requested DOP = 6 、 Actual DOP =6
SQL>@q00.sql
INST_ID Username QC/Slave Slave Set SID QC SID Requested DOP Actual DOP MODULE SQL_ID EVENT STATUS
---------- ------------ ---------- ---------- ---------- ------ ------------- ---------- ---------- -------------------- ------------------------- ------------------------
1 U1 QC 125 125 SQL*Plus 9y3cpa2z9r4zw SQL*Net message from clie INACTIVE
1 - p011 (Slave) 2 19 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p010 (Slave) 2 144 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p009 (Slave) 2 33 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p008 (Slave) 2 142 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p007 (Slave) 2 20 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p006 (Slave) 2 139 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p005 (Slave) 1 18 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p004 (Slave) 1 29 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p003 (Slave) 1 143 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p002 (Slave) 1 141 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p001 (Slave) 1 21 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p000 (Slave) 1 140 125 6 6 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
13行が選択されました。
SQL>
===================================
修改session 级别并行度,再次确认:
alter session force parallel query parallel 3;
select * from dba_segments,dba_extents;
===================================
通过别的Session,查看状况: <<<<< Requested DOP =3 Actual DOP =3
SQL>@q00.sql
INST_ID Username QC/Slave Slave Set SID QC SID Requested DOP Actual DOP MODULE SQL_ID EVENT STATUS
---------- ------------ ---------- ---------- ---------- ------ ------------- ---------- ---------- -------------------- ------------------------- ------------------------
1 U1 QC 125 125 SQL*Plus 9y3cpa2z9r4zw SQL*Net message from clie INACTIVE
1 - p005 (Slave) 2 20 125 3 3 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p004 (Slave) 2 21 125 3 3 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p003 (Slave) 2 144 125 3 3 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p002 (Slave) 1 140 125 3 3 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p001 (Slave) 1 19 125 3 3 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p000 (Slave) 1 148 125 3 3 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
SQL>
===================================
修改session 级别并行度,再次确认:
alter session force parallel query parallel 8;
select * from dba_segments,dba_extents;
===================================
通过别的Session,查看状况: <<<<< Requested DOP = 8 Actual DOP =8
INST_ID Username QC/Slave Slave Set SID QC SID Requested DOP Actual DOP MODULE SQL_ID EVENT STATUS
---------- ------------ ---------- ---------- ---------- ------ ------------- ---------- ---------- -------------------- ------------------------- ------------------------
1 U1 QC 125 125 SQL*Plus 9y3cpa2z9r4zw SQL*Net message from clie INACTIVE
1 - p015 (Slave) 2 153 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p014 (Slave) 2 23 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p013 (Slave) 2 154 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p012 (Slave) 2 29 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p011 (Slave) 2 18 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p010 (Slave) 2 141 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p009 (Slave) 2 33 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p008 (Slave) 2 142 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq: Execution Msg INACTIVE
1 - p007 (Slave) 1 31 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p006 (Slave) 1 139 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p005 (Slave) 1 21 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p004 (Slave) 1 20 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p003 (Slave) 1 144 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p002 (Slave) 1 148 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p001 (Slave) 1 26 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
1 - p000 (Slave) 1 143 125 8 8 SQL*Plus 9y3cpa2z9r4zw PX Deq Credit: send blkd ACTIVE
SQL>
如何测试Oracle并行执行的并行度状况的更多相关文章
- Oracle并行执行特性应用初探
1. 序 在历史数据转出测试过程中,通过不断的优化,包括SQL调整和数据库调整,从AWR中看到,基本上难以进行更多的性能提升,于是准备试试并行执行的特性,从这个任务的特点来分析,也比较适合采 ...
- 测试Oracle 11gr2 RAC 非归档模式下,offline drop数据文件后的数据库的停止与启动测试全过程
测试Oracle 11gr2 RAC 非归档模式下,offline drop数据文件后的数据库的停止与启动测试全过程 最近系统出现问题,由于数据库产生的日志量太大无法开启归档模式,导致offline的 ...
- windows下怎样测试oracle安装是否成功以及在oracle中创建用户并赋予用户权限;和[Err] ORA-65096: 公用用户名或角色名无效的解决方案
测试oracle数据安装是否成功,可按顺序执行以下两个步骤: 测试步骤 1:请执行操作系统级的命令:tnsping orcl 上述命令假定全局数据库名是 orcl.以下是命令执行后的示例(请在cmd命 ...
- 如何取得Oracle并行执行的trace
如何取得Oracle并行执行的trace: ALTER SESSION SET tracefile_identifier='10046_PROD';ALTER SESSION SET max_dump ...
- LoadRunner调用java函数测试oracle
LoadRunner调用java函数测试oracle 测试oracle的方法有很多,可以使用loadrunner的oracle协议直接调用oracle进行测试,也可以调用开发的java程序对oracl ...
- 测试oracle数据库的脱机备份和恢复
环境:windows7.Oracle11g 一.脱机备份 脱机备份是指在数据库关闭情况下的数据备份,也称为冷备份. 在书上学到的备份步骤: 1.记录所要备份数据库文件所在的操作系统路径: 2.关闭数据 ...
- 测试oracle表空间自动扩展
2019-04-1116:01:25 表空间分配10m自动扩展,向表中插入数据,看表空间达到10m以后是否会报错. 测试过程如下: 1.创建表空间 CREATE TABLESPACE TEST DAT ...
- 启动和测试oracle是否安装成功
转自:https://www.cnblogs.com/justdo-it/articles/5112576.html 测试步骤1:请执行操作系统级的命令:tnsping orcl 测试步骤 2:请执行 ...
- Windows 10 64位操作系统 下安装、配置、启动、登录、连接测试oracle 11g
一.下载oracle安装包 1:详细下载安装版本可见官网:https://www.oracle.com/technetwork/database/enterprise-edition/download ...
随机推荐
- Python Django框架笔记(六):模板
(一){%%}和{{ }} {% for post in posts %} <a href=""><h2>{{ post.title }}</h2&g ...
- OneAPM大讲堂 | 监控数据的可视化分析神器 Grafana 的告警实践
文章系国内领先的 ITOM 管理平台供应商 OneAPM 编译呈现. 概览 Grafana 是一个开源的监控数据分析和可视化套件.最常用于对基础设施和应用数据分析的时间序列数据进行可视化分析,也可以用 ...
- kafka入门1:安装及配置
1下载 官方下载地址:https://kafka.apache.org/downloads 案例使用版本:kafka_2.11-1.1.0.tgz 2上传服务器 使用ftp工具将压缩包放置到服务器上 ...
- axios的配置项
最近在学习vue,涉及到axios的ajax操作,记录一下相关Config,方便日后查阅 { // `url`是将用于请求的服务器URL url: '/user', // `method`是发出请求时 ...
- 访问url地址 但tomcat会发两次请求??
statDate===2017-06-27================2017年7月11日 16:06:43执行成功,共删除0条.2017年7月11日 16:06:43执行成功,共插入48835条 ...
- mysql 导入csv文件
导入时,系统会默认一个导入路径,如果导入路径不是默认路径,会报 The MySQL server is running with the --secure-file-priv option so it ...
- RHEL7.3安装python3.6.1
RHEL7.3 install python3.6.1 steps 1. download Python-3.6.1.tgz2. tar -zxvf Python-3.6.1.tgz3. yum in ...
- Redis缓存穿透、缓存雪崩、redis并发问题分析
把redis作为缓存使用已经是司空见惯,但是使用redis后也可能会碰到一系列的问题,尤其是数据量很大的时候,经典的几个问题如下: (一)缓存和数据库间数据一致性问题分布式环境下(单机就不用说了)非常 ...
- 怎么查看自己电脑的IP地址
1/2 使用Windows+R键打开“运行”窗口,然后输入CMD进入命令提示窗口 进入命令窗口之后,输入:ipconfig/all 回车即可看到整个电脑的详细的IP配置信息 1/3 使用网络状态查看I ...
- javascript的基础知识整理
Basic ObjectsArray Properties constructor 属性返回对创建此对象的数组函数的引用 object.constructor prototype 属性使您有能力向对 ...