如何测试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 ...
随机推荐
- 大数据【四】MapReduce(单词计数;二次排序;计数器;join;分布式缓存)
前言: 根据前面的几篇博客学习,现在可以进行MapReduce学习了.本篇博客首先阐述了MapReduce的概念及使用原理,其次直接从五个实验中实践学习(单词计数,二次排序,计数器,join,分 ...
- Expo大作战(十四)--expo中消息推送的实现
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...
- Windows10系统的Linux子系统中安装MySQL数据库心得
后端开发童鞋们, 自己开发机用的是Windows系统电脑(台式机或笔记本), 而开发的程序和使用的数据库等要运行在Linux服务器上, 这种情况有木有? 提前声明: 本文并不讨论操作系统的比较, 以及 ...
- (个人记录)Python2 与Python3的版本区别
现在还有些开源模块还没有更新到python3 ,不了解版本区别,无法对不合适的地方进行更改. 由于只追求向Python3靠近,所以对于python2的特别用法不探究. 此文不补全所有版本区别,仅作档案 ...
- excel表格中添加单引号的方法
今天碰到需要插入大量数据的excel表格,其中有很多文本,需要添加单引号. 方法如下: 左边是原始数据,右边是我即将添加单引号的空白区域. 第一步:在需要添加的位置输入= 第二步:输入等号之后点击需要 ...
- Character Sets: Migrating to utf8mb4 with pt_online_schema_change
David Berube | June 12, 2018 | Posted In: MySQL Modern applications often feature the use of data ...
- 【转】Java学习---内存溢出的排查经历
[原文]https://www.toutiao.com/i6595365358301872643/ 前言 OutOfMemoryError 问题相信很多朋友都遇到过,相对于常见的业务异常(数组越界.空 ...
- 原生JS简单的无缝自动轮播
最近在不断的加强巩固js.在学习jq和vue之后发现很多东西其实都是不明所以,有些底层的东西自己不懂,到头来也只是一昧的使用,一直在用别人的东西,对自己的成长帮助也不大. 万丈高楼平地起,基础打扎实了 ...
- 解决PC有道云笔记卸载重装后无法数据同步问题
将客户端内容成功同步后,按键盘win键选择文件资源管理器,将以下路径一次粘贴到搜索框按回车搜索,将搜索到的所有内容(文件,文件夹)全部删除,再重启软件登录账户同步试试看 配置目录:%USERPROFI ...
- Netty入门(五)ChanneHandler
本节主要讨论了 Netty 的数据处理组件 ChannelHandler. 一.Channel 生命周期 Channel 有个简单但强大的状态模型,下面是 Channel 的四个状态: Channel ...