`
落地窗
  • 浏览: 429336 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

oracle 并行度--转载

阅读更多
从巴乔博客中看到:
‘并行度为DEFAULT的表进行PDML时有可能导致RAC中的节点重启’‘并行度设置为default时可能会导致PDML ora-12805错误’并行度设置为DEFAULT的表如果进行PDML时,会导致相应的节点重启,DEFAULT在并行度默认是 按cpu_count*parallel_threads_per_cpu来跑的,但是引起节点重启也是比较怪异的。解决办法便是将表的并行度设置为一个 具体的数值。

在建表的时候可以设置表的并行度:
SQL> create table test parallel 10 as select * from emp;
如果建表的时候没有明确指定并行度,那么oracle会自动的根据需要设定并行度。

通过以下语句可以查询一个表的并行度:
SQL> select table_name,degree from user_tables;

使用alter语句可以更改表的并行度:
SQL> alter table bank parallel(degree default);

在执行语句的时候可以查询当前语句的并行度:
SQL> select * from v$px_session;

关于并行度的知识 还得继续看:
http://industry.ccidnet.com/art/321/20061229/991103_1.html

以下内容由eygle网站转帖:

在DBA_TABLES字典表中有一个degree字段,这个字段代表并行查询在数据表上的并行度,在RAC环境中,这个参数还和实例有关。
文档中对于 DEGREE 和 INSTANCES 参数的说明:

DEGREE VARCHAR2(10) Number of threads per instance for scanning the table
INSTANCES VARCHAR2(10) Number of instances across which the table is to be scanned

但是注意,当你使用类似如下查询时,你可能无法获得返回值:

SQL> select table_name from dba_tables where degree='1' or degree='DEFAULT';

no rows selected


我们看一下Degree以及instances的记录方式:

SQL> select degree,length(degree) from dba_tables
2 group by degree;
DEGREE LENGTH(DEGREE)
-------------------- --------------
DEFAULT 10
1 10

SQL>select instances,length(instances) from dba_tables
2 group by instances;
INSTANCES LENGTH(INSTANCES)
-------------------- -----------------
DEFAULT 10
1 10
0 10

Degree和Instances实际上记录了10个字符,左端用空格补齐。
在 dba_tables 的创建语句中,我们可以找到根本原因,以下是这两个字段的定义来源:

lpad(decode(t.degree, 32767, 'DEFAULT', nvl(t.degree,1)),10),
lpad(decode(t.instances, 32767, 'DEFAULT', nvl(t.instances,1)),10),


以上信息来自Oracle10gR2数据库:

SQL> select table_name,owner from dba_tables where degree=' DEFAULT' or instances=' DEFAULT';

TABLE_NAME OWNER
------------------------------ ------------------------------
TEST_EXT2 SYS
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics