清理王者荣耀如何清理缓存的游戏数据的话会怎样?要不要重新下载?

博客访问: 645015
博文数量: 190
博客积分: 3063
博客等级: 中校
技术积分: 2693
注册时间:
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Oracle
查看dba_tables数据字典时,可以发现有“DEGREE”字段,这个字段表示的就是数据表的并行度。这个参数的设置,关系着数据库的I/O,以及sql的执行效率。
并行度的优点就是能够最大限度的利用机器的多个cpu资源,是多个cpu同时工作,从而达到提高数据库工作效率的目的。在系统空闲时间,使用并行是个不错的选择,但是好东西总是相对而言,没有绝对的好坏,不当的使用,同样会引起数据库的新的问题产生。
1、 &此参数的大小设置
orcl@ SCOTT> select table_name,degree from user_
TABLE_NAME & & & & & & & & & & DEGREE
------------------------------ & & & & --------------------
T1 & & & & & & & & & & & & & & & & & & &1
TAB_REGISTER & & & & & & & & & & & & & &1
EMP & & & & & & & & & & & & & & & & & & 1
EMP_BAK & & & & & & & & & & & & & & & & 1
SALGRADE & & & & & & & & & & & & & & & &1
BONUS & & & & & & & & & & & & & & & & & 1
DEPT & & & & & & & & & & & & & & & & & &1
LETTER_USER & & & & & & & & & & & & & & 1
T2 & & & & & & & & & & & & & & & & & & &1
BASE_LOG & & & & & & & & & & & & & & & &1
T & & & & & & & & & & & & & & & & & & & 1
通过上例的例子大家可以观察,此参数的默认值为1,这个数值,我们认为的增加,当设置表的并行度非常高的时候,sql优化器将可能对表进行全表扫描,引起 Direct Path Read 等待 。
在使用并行查询前需要慎重考虑, 因为并行查询尽管能提高程序的响应时间, 但是会
消耗比较多的资源。 对于低配置的数据库服务器需要慎重。 此外, 需要确认并行度的设置要与 IO 系统的配置相符(建议并行度为 2~4 * CPU 数) 。&
2、 &并行度的修改
alter table t parallel(degree 1);------直接指定表的并行度
al & &----------设置表的并行度为default
3、 &如何在sql语句中使用表的并行度,并选择合适的并行等级
示例:使用并行查询的执行计划
orcl@ SCOTT> SELECT /*+ PARALLEL(4) */
& 2 & MAX(sal),
& 3 & AVG(comm)
& 4 & &FROM emp,dept
& 5 & WHERE emp.deptno=dept.deptno
& 6 & GROUP BY 1
已用时间: &00: 00: 00.09
----------------------------------------------------------
Plan hash value:
---------------------------------------------------------------------------------------------------------------
| Id &| Operation & & & & & & | Name & & | Rows &| Bytes | Cost (%CPU)| Time & & | & &TQ &|IN-OUT| PQ Distrib |
---------------------------------------------------------------------------------------------------------------
| & 0 | SELECT STATEMENT & & &| & & & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | & & & &| & & &| & & & & |
| & 1 | &HASH GROUP BY & & & &| & & & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | & & & &| & & &| & & & & |
| & 2 | & PX COORDINATOR & & &| & & & & &| & & & | & & & | & & & & & &| & & & & &| & & & &| & & &| & & & & |
| & 3 | & &PX SEND QC (RANDOM)| :TQ10000 | & &14 | & 126 | & & 2 & (0)| 00:00:01 | &Q1,00 | P->S | QC (RAND) &|
| & 4 | & & PX BLOCK ITERATOR | & & & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | &Q1,00 | PCWC | & & & & |
|* &5 | & & &TABLE ACCESS FULL| EMP & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | &Q1,00 | PCWP | & & & & |
---------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
& &5 - filter("EMP"."DEPTNO" IS NOT NULL)
& &- automatic DOP: computed degree of parallelism is 4
----------------------------------------------------------
& & & & &20 &recursive calls
& & & & & 0 &db block gets
& & & & & 5 &consistent gets
& & & & & 0 &physical reads
& & & & & 0 &redo size
& & & & 482 &bytes sent via SQL*Net to client
& & & & 416 &bytes received via SQL*Net from client
& & & & & 2 &SQL*Net roundtrips to/from client
& & & & & 1 &sorts (memory)
& & & & & 0 &sorts (disk)
1 &rows processed
SELECT /*+ no_parallel */ ename, dname FROM emp e, dept d
WHERE e.deptno=d.
自动并行度
SELECT /*+ parallel(auto) */ ename, dname FROM emp e, dept d
WHERE e.deptno=d.
4、 &并行查询的使用范围
大表查询,join,分区索引的查询,
创建大量的index,
创建大量的表(包括固化视图),
批量的insert,update,delete;
查行执行适合场景:
对称多处理器,集群,并行系统,
cpu利用不足,
足够的内存用于其他操作,排序,hash,缓存,
查行执行适合与dss与数据仓库,也适合于批量操作的OLTP系统,不适合OLTP简介的dml或select操作;
并行执行不适合场景:
非常短的查询或事务
基本硬件要求:
并行执行设计需要多个cpu与io来实现快速的查询,每个硬件都应该维持在同一个吞吐量
哪些操作可以用并行
全表查询,分区查询,索引快速查询
nested loop, sort merge, hash, and star transformation
CREATE TABLE AS SELECT, &CREATEINDEX, REBUILDINDEX,
REBUILD INDEX PARTITION,&
And MOVE/SPLIT/COALESCEPARTITION
INSERT AS SELECT,UPDATE,DELETE,
&And MERGE operations
5、 &在并行操作中默认情况并行查询和并行DDL操作可以无障碍使用并行,但是如果想使用并行DML,需要先修改dml并行配置
alter session
11g new feature:
For a statement-level PARALLEL hint:
■ PARALLEL: The statement always is run parallel, and the database computes the&
degree of parallelism, which can be 2 or greater.
■ PARALLEL (DEFAULT): The same as PARALLEL. The DEFAULT keyword is&
included for completeness.
■ PARALLEL (AUTO): The database computes the degree of parallelism, which can be&
1 or greater. If the computed degree of parallelism is 1, then the statement runs&
■ PARALLEL (MANUAL): The optimizer is forced to use the parallel settings of the&
objects in the statement.
■ PARALLEL (integer): The optimizer uses the degree of parallelism specified by&
In the following example, the optimizer calculates the degree of parallelism. The&
statement always runs in parallel.
SELECT /*+ PARALLEL */ last_name
In the following example, the optimizer calculates the degree of parallelism, but that&
degree may be 1, in which case the statement will run serially.
SELECT /*+ PARALLEL (AUTO) */ last_name
阅读(6157) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。数据库-Oracle(40)
数据库-SQL(14)
查看dba_tables数据字典时,可以发现有“DEGREE”字段,这个字段表示的就是数据表的并行度。这个参数的设置,关系着数据库的I/O,以及sql的执行效率。
并行度的优点就是能够最大限度的利用机器的多个cpu资源,是多个cpu同时工作,从而达到提高数据库工作效率的目的。在系统空闲时间,使用并行是个不错的选择,但是好东西总是相对而言,没有绝对的好坏,不当的使用,同样会引起数据库的新的问题产生。
1、 &此参数的大小设置
orcl@ SCOTT& select table_name,degree from user_
TABLE_NAME & & & & & & & & & & DEGREE
------------------------------ & & & & --------------------
T1 & & & & & & & & & & & & & & & & & & &1
TAB_REGISTER & & & & & & & & & & & & & &1
EMP & & & & & & & & & & & & & & & & & & 1
EMP_BAK & & & & & & & & & & & & & & & & 1
SALGRADE & & & & & & & & & & & & & & & &1
BONUS & & & & & & & & & & & & & & & & & 1
DEPT & & & & & & & & & & & & & & & & & &1
LETTER_USER & & & & & & & & & & & & & & 1
T2 & & & & & & & & & & & & & & & & & & &1
BASE_LOG & & & & & & & & & & & & & & & &1
T & & & & & & & & & & & & & & & & & & & 1
通过上例的例子大家可以观察,此参数的默认值为1,这个数值,我们认为的增加,当设置表的并行度非常高的时候,sql优化器将可能对表进行全表扫描,引起 Direct Path Read 等待 。
在使用并行查询前需要慎重考虑, 因为并行查询尽管能提高程序的响应时间, 但是会
消耗比较多的资源。 对于低配置的数据库服务器需要慎重。 此外, 需要确认并行度的设置要与 IO 系统的配置相符(建议并行度为 2~4 * CPU 数) 。&
2、 &并行度的修改
alter table t parallel(degree 1);------直接指定表的并行度
al & &----------设置表的并行度为default
3、 &如何在sql语句中使用表的并行度,并选择合适的并行等级
示例:使用并行查询的执行计划
orcl@ SCOTT& SELECT /*+ PARALLEL(4) */
& 2 & MAX(sal),
& 3 & AVG(comm)
& 4 & &FROM emp,dept
& 5 & WHERE emp.deptno=dept.deptno
& 6 & GROUP BY 1
已用时间: &00: 00: 00.09
----------------------------------------------------------
Plan hash value:
---------------------------------------------------------------------------------------------------------------
| Id &| Operation & & & & & & | Name & & | Rows &| Bytes | Cost (%CPU)| Time & & | & &TQ &|IN-OUT| PQ Distrib |
---------------------------------------------------------------------------------------------------------------
| & 0 | SELECT STATEMENT & & &| & & & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | & & & &| & & &| & & & & |
| & 1 | &HASH GROUP BY & & & &| & & & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | & & & &| & & &| & & & & |
| & 2 | & PX COORDINATOR & & &| & & & & &| & & & | & & & | & & & & & &| & & & & &| & & & &| & & &| & & & & |
| & 3 | & &PX SEND QC (RANDOM)| :TQ10000 | & &14 | & 126 | & & 2 & (0)| 00:00:01 | &Q1,00 | P-&S | QC (RAND) &|
| & 4 | & & PX BLOCK ITERATOR | & & & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | &Q1,00 | PCWC | & & & & |
|* &5 | & & &TABLE ACCESS FULL| EMP & & &| & &14 | & 126 | & & 2 & (0)| 00:00:01 | &Q1,00 | PCWP | & & & & |
---------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
& &5 - filter(&EMP&.&DEPTNO& IS NOT NULL)
& &- automatic DOP: computed degree of parallelism is 4
----------------------------------------------------------
& & & & &20 &recursive calls
& & & & & 0 &db block gets
& & & & & 5 &consistent gets
& & & & & 0 &physical reads
& & & & & 0 &redo size
& & & & 482 &bytes sent via SQL*Net to client
& & & & 416 &bytes received via SQL*Net from client
& & & & & 2 &SQL*Net roundtrips to/from client
& & & & & 1 &sorts (memory)
& & & & & 0 &sorts (disk)
1 &rows processed
SELECT /*+ no_parallel */ ename, dname FROM emp e, dept d
WHERE e.deptno=d.
自动并行度
SELECT /*+ parallel(auto) */ ename, dname FROM emp e, dept d
WHERE e.deptno=d.
4、 &并行查询的使用范围
大表查询,join,分区索引的查询,
创建大量的index,
创建大量的表(包括固化视图),
批量的insert,update,delete;
查行执行适合场景:
对称多处理器,集群,并行系统,
cpu利用不足,
足够的内存用于其他操作,排序,hash,缓存,
查行执行适合与dss与数据仓库,也适合于批量操作的OLTP系统,不适合OLTP简介的dml或select操作;
并行执行不适合场景:
非常短的查询或事务
基本硬件要求:
并行执行设计需要多个cpu与io来实现快速的查询,每个硬件都应该维持在同一个吞吐量
哪些操作可以用并行
全表查询,分区查询,索引快速查询
nested loop, sort merge, hash, and star transformation
CREATE TABLE AS SELECT, &CREATEINDEX, REBUILDINDEX,
REBUILD INDEX PARTITION,&
And MOVE/SPLIT/COALESCEPARTITION
INSERT AS SELECT,UPDATE,DELETE,
&And MERGE operations
5、 &在并行操作中默认情况并行查询和并行DDL操作可以无障碍使用并行,但是如果想使用并行DML,需要先修改dml并行配置
alter session
11g new feature:
For a statement-level PARALLEL hint:
■ PARALLEL: The statement always is run parallel, and the database computes the&
degree of parallelism, which can be 2 or greater.
■ PARALLEL (DEFAULT): The same as PARALLEL. The DEFAULT keyword is&
included for completeness.
■ PARALLEL (AUTO): The database computes the degree of parallelism, which can be&
1 or greater. If the computed degree of parallelism is 1, then the statement runs&
■ PARALLEL (MANUAL): The optimizer is forced to use the parallel settings of the&
objects in the statement.
■ PARALLEL (integer): The optimizer uses the degree of parallelism specified by&
In the following example, the optimizer calculates the degree of parallelism. The&
statement always runs in parallel.
SELECT /*+ PARALLEL */ last_name
In the following example, the optimizer calculates the degree of parallelism, but that&
degree may be 1, in which case the statement will run serially.
SELECT /*+ PARALLEL (AUTO) */ last_name
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:95988次
积分:3686
积分:3686
排名:第7201名
原创:261篇
转载:122篇
评论:16条
(22)(24)(41)(11)(33)(29)(31)(8)(30)(31)(44)(22)(7)(17)(21)(6)(2)(8)(1)下次自动登录
现在的位置:
& 综合 & 正文
Oracle rebuild index 使用 parallel 时 与 并行度 的注意事项
一.Rebuild 索引 与 并行度 说明
在之前的Blog里整理了一些列有关索引相关的Blog,如下:
在索引create 和rebuild的时候,在CPU 允许的情况下,我们可以使用parallel来加快操作的速度。但是这里有一个注意的问题,有关索引的并行度,这个对表同样要注意。
对于OLTP类型的数据库,除非只用于做统计、报表类的表或索引,建议不对相关表或索引调置并行度。在数据库有开启并行查询的情况下,在表或索引上存在默认并行度,将导致数据库优先采用全表或全索引扫描的执行计划,另外将生成多个并行子进程,对于OLTP类应用将反而降低相关SQL的执行效率。
有关parallel,官网的说明如下:
The parallel_clause letsyou parallelize creation of the table and set the default degree of parallelismfor queries and the DML INSERT, UPDATE, DELETE,andMERGE after table creation.
NOPARALLEL: Specify NOPARALLEL forserial execution. This is the default,即并行度为1.
(2)PARALLEL:
Specify PARALLEL ifyou want Oracle to select a degree of parallelism equal to the number of CPUsavailable on all participating instances times the value ofthe PARALLEL_THREADS_PER_CPU initialization parameter.
(3)PARALLEL integer: Specificationof integer indicates the degree of parallelism, which is thenumber of parallel threads used in the parallel operation. Each parallel threadmay use one or two parallel execution servers. Normally Oracle calculates the optimumdegree of parallelism, so it is not necessary for you to specify integer.
Oracle在并行处理时,会启动多少个并行进程来同时执行任务,并行度越高, 并行进程越多,执行速度 会越快,默认是noparallel,如果我们设置并行度为default值,那么此时的并行度是:
服务器CPU数*每个CPU启用的线程数(PARALLEL_THREADS_PER_CPU)
所以一般我们建议使用Noparallel,或者将并行度设置为1,而不是default。
可以通过dba_tables 和 dba_indexes 视图的degree 字段来查看相关对象的并行度。
要注意的就是在我们用并行来rebuild索引的时候,rebuild结束后,我们索引的并行度也会改成我们rebuild的并行度,所以在我们rebuild 结束之后还需要对索引的并行度进行一个修改操作。
测试环境: win7 +oracle 11.2.0.1
SQL& select * from v$version where rownum=1;
-----------------------------------------------------------------------------
Oracle Database 11g Enterprise EditionRelease 11.2.0.1.0 - 64bit Production
--查看并行参数:
SQL& show parameter parallel_max_servers
----------------------------------------------- ------
parallel_max_servers
SQL& show parameter PARALLEL_THREADS_PER_CPU
----------------------------------------------- ------
parallel_threads_per_cpu
--测试表Dave信息:
SQL& select count(*)
----------
SQL& col segment_name for a15
1*select segment_name,bytes/||'M' as "size" from dba_segmentswhere segment_name='DAVE' and owner='SYS'
SEGMENT_NAME
--------------------------------------------------------
--使用默认值创建索引:
SQL& create index idx_dave_id on dave(object_id) ;
Index created.
--查看默认值:
SQL& select degree from dba_indexes where index_name='IDX_DAVE_ID';
----------------------------------------
--这里默认为noparallel,即为1.
--使用并行度为4,对索引进行rebuild:
SQL& ater index idx_dave_id rebuildparallel 4;
Index altered.
--在次查看索引的并行度:
SQL& select degree from dba_indexes where index_name='IDX_DAVE_ID';
----------------------------------------
这里变成了4,也就是说启用了索引自己的并行,这样在我们使用索引时会影响执行计划,也会消耗很多的资源。所以,我们需要对这个并行度进行修改,改成noparallel。
--修改并行度为noparallel:
SQL& alter index idx_dave_
Index altered.
--查看并行度:
SQL& select degree from dba_indexes where index_name='IDX_DAVE_ID';
----------------------------------------
这里又变成了1.
使用并行来处理时,我们可以通过v$px_session 来查看相关的等待事件:
SQL& select a.sql_id,a.event,count(*)from v$session a,v$px_session b where a.sid=b.sid group by a.sql_id,a.
关于并行的更多测试参考:
-------------------------------------------------------------------------------------------------------
版权所有,允许转载,但必须以链接方式注明源地址,否则追究法律责任!
tianlesoftware
-------加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请----
DBA1 群:(满);
DBA2 群:(满)
DBA3 群:(满)
DBA 超级群:(满);
&&&&推荐文章:
【上篇】【下篇】查看: 2928|回复: 5
关于表并行度的问题
论坛徽章:1
大表复制的的时候,我采用这种方式开的并行 create table a parallel unrecoverable as select *
建好之后 alter table&&a parallel (degree 1);
可是意想不到, select count(1)的时候发现还是 开了8个通道;大家帮忙看看怎么才能把通道数量
降下来?这个并行度与什么相关呢?
论坛徽章:37
alter table&&
论坛徽章:12
确认表的并行度是不是1:
select degree from user_tables where table_name='A';
如果不是1,用下面告种手段:
alter session
alter table a parallel(degree 1);------直接指定表的并行度
al& & ----------设置表的并行度为default
alter table&&
查询语句中加hints:/*+ no_parallel */
论坛徽章:1
gyj_hobby 发表于
确认表的并行度是不是1:
select degree from user_tables where table_name='A';
如果不是1,用下面告种手 ...
我写的可能不够详细, 我就是建表的时候 create table a parallel unrecoverable as select *
建好之后已经设置了 alter table&&a parallel (degree 1); 并且 dba_tables 里面该表并行度还是1;
但是为什么select count(1) from a 的时候还是多个session 呢?
论坛徽章:1
最后加了个 alter table&& 好了
论坛徽章:1
itpub.net All Right Reserved. 北京皓辰网域网络信息技术有限公司版权所有    
 北京市公安局海淀分局网监中心备案编号: 广播电视节目制作经营许可证:编号(京)字第1149号查看: 5259|回复: 6
请教个索引并行度的问题
论坛徽章:0
发现索引并行度会自动打开,不知道什么原因导致。
用select degree from dba_indexes where degree &1 ,发现了一批索引并行度大于1.
然后用alter index&&xxx.关闭。
但是过了一段时间后,又自动开起来了。
这个是啥原因呢?
另外,dbms_stats.gather_table_stats的优化,是不是导致其并行度不关的罪魁祸首?
ORACLE&&10G
论坛徽章:0
我想知道可能的原因是啥
招聘 : 认证徽章论坛徽章:368
audit alter indexx..
论坛徽章:136
是不是你们定期重建索引啊 ,重建索引的时候用了parallel,没有改成noparallel
招聘 : 认证徽章论坛徽章:20
估计是重建的时候使用了parallel,忘记收尾工作了
论坛徽章:226
收集统计信息不会导致索引并发度变化
查询DBA_OBJECTS的LAST_DDL_TIME,看看执行NOPARALLEL后是否又发生过DDL操作。
论坛徽章:0
肯定是收尾了。
itpub.net All Right Reserved. 北京皓辰网域网络信息技术有限公司版权所有    
 北京市公安局海淀分局网监中心备案编号: 广播电视节目制作经营许可证:编号(京)字第1149号

我要回帖

更多关于 王者荣耀内存怎么清理 的文章

 

随机推荐