Dear Tamil, While trying example provided in the link given by you I got the following problem
Code:
SQL> SELECT count(*) FROM myobjects;
COUNT(*)
----------
10427392
Elapsed: 00:00:13.06
I'm trying to run Parallel DML on that table, I have following index on that table
Code:
SQL> SELECT index_name, column_name FROM user_ind_columns WHERE table_name = 'MYOBJECTS';
INDEX_NAME COLUMN_NAME
------------------------------ ------------------------------
INDX_MYOB OBJECT_NAME
Elapsed: 00:00:00.01
Here is the code for Parallel DML, I'm running only one session which is current. I dont know how comes I got an error saying "DEADLOCK DETECTED"
Code:
SQL> alter session enable parallel dml;
Session altered.
SQL>
SQL> alter session set db_file_multiblock_read_count=128;
Session altered.
SQL> set timin on
SQL>
SQL>
SQL> UPDATE /*+ full(myobjects) parallel(myobjects, 8)*/ myobjects
2 SET object_name = upper(object_name);
update /*+ full(myobjects) parallel(myobjects, 8)*/
*
ERROR at line 1:
ORA-12801: error signaled in parallel query server P015
ORA-00060: deadlock detected while waiting for resource
PL/SQL Block always runs slower than a single update.
For a simple update, do it in a single statement. If possible, use parallel DML.
Yes Tamil, I do agree with you.
In fact I myself have posted before,
long time ago about using PARALLEL DML
also here in this forum.
PL/SQL Block always runs slower than a single update.-
- yes, it was actually a sort of a test to the poster. Davey, actually posted contesting the use of pl/sql to update before my post.
It'a trick that will work for small table
but not in huge one...heheh..my bad.
There are some occasions you need to update a big table.
For example, a ETL process may need to clean up the source data in a staging table in a DW system before loading into FACT table.
It's nothing wrong using parallel DML as long as you achieve the goal in a shorter time.
If you are not using the feature, then what's the purpose of it?
1) When we talk about danger we mean update with no redo generation
2) There is no danger since that's not possible
3) If you do not generate redo and the database fail and you bring the file from backup, you'll loose your table
Bookmarks