- 最后登录
- 2017-10-17
- 在线时间
- 93 小时
- 威望
- 157
- 金钱
- 2803
- 注册时间
- 2012-5-18
- 阅读权限
- 50
- 帖子
- 98
- 精华
- 3
- 积分
- 157
- UID
- 437
|
1#
发表于 2012-8-10 08:54:03
|
查看: 4165 |
回复: 1
本帖最后由 clevernby 于 2012-12-27 15:57 编辑
数据库版本11.2.0.3.1 Linux x86-64 2节点集群
首先创建任务并分配chunk,这个过程正常- DECLARE
- l_varTaskName VARCHAR2(64) := 'correctdata';
- l_nBlockNumber NUMBER := 585534;
- BEGIN
- dbms_parallel_execute.create_task(l_varTaskName);
- dbms_parallel_execute.create_chunks_by_rowid(task_name => l_varTaskName
- ,table_owner => 'USER'
- ,table_name => 'TABLE1'
- ,by_row => FALSE
- ,chunk_size => CEIL(l_nBlockNumber / 100));
- END;
复制代码 执行后查看dba_parallel_execute_tasks发现status为chunked
然后执行任务,该过程不正常- DECLARE
- l_nParallelDegree NUMBER := 8;
- l_varTaskName VARCHAR2(64) := 'correctdata';
- l_varSQL VARCHAR2(4000) := 'update /*+ ROWID(dda) */ USER.TABLE1 SET COL2=COL1 WHERE COL2 IS NULL and rowid between :start_id and :end_id';
- BEGIN
- dbms_parallel_execute.run_task(task_name => l_varTaskName
- ,sql_stmt => l_varSQL
- ,language_flag => DBMS_SQL.native
- ,parallel_level => l_nParallelDegree);
- END;
复制代码 只花了3秒就结束了,《PL/SQL REF》文档中提到“This procedure returns only when all the chunks are processed”,显然时间不正常。
查看dba_parallel_execute_tasks发现status还是chunked.- TASK_OWNER TASK_NAME CHUNK_TYPE STATUS TABLE_OWNER TABLE_NAME NUMBER_COLUMN TASK_COMMENT JOB_PREFIX SQL_STMT LANGUAGE_FLAG EDITION APPLY_CROSSEDITION_TRIGGER FIRE_APPLY_TRIGGER PARALLEL_LEVEL JOB_CLASS
- ----------- ------------ ------------ -------- ------------ ----------- --------------- --------------- -------------- ---------------------------------------------------- ------------- ---------- ------------------------------ ------------------ -------------- -----------------
- SYSTEM correctdata ROWID_RANGE CHUNKED USER TABLE1 TASK$_8 update /*+ ROWID(dda) */ USER.TABLE1 SET COL2=COL1 1 ORA$BASE TRUE 8 DEFAULT_JOB_CLASS
复制代码 而视图dba_parallel_execute_chunks中显示所有chunked的status均为UNASSIGNED
该数据库job_queue_processes=1000
[ 本帖最后由 clevernby 于 2012-8-10 08:58 编辑 ] |
|