Hi
I have a procedure that update a record in a table. This table is accessed for many work stations and these stations update this table several times. In average this table is updated 900,000 times a day. My oracle version is 9.02
In this table there are no deletes.
The records that are in this table are inserted by other process that is working ok.
My procedure do this:
Receive some parameters ( param1 , param2, param3)
...
IF condition = true THEN
LOCK TABLE my_table IN EXCLUSIVE MODE;
SELECT my_table_id INTO v_my_table_id FROM my_table WHERE available = 'Y' AND rownum = 1;
Update my_table set SET my_date = sysdate, my_field1 = param1, available = 'N' WHERE my_table_id = v_my_table_id;
COMMIT;
END IF;
The problem here is that some times this process is very slow , and the lock in the table remains for a long time and suddenly the table is released.
I review the CPU of the server whereis the database; and is normal.
This process has been working for 2 years and now is failing.
Could you help me to know if ther is a better way to do this process?
I can't undesrtand why this behaivor, if is a simple transaction.
I really appreciate your help
Lorein
Lorein....
I have a procedure that update a record in a table. This table is accessed for many work stations and these stations update this table several times. In average this table is updated 900,000 times a day. My oracle version is 9.02
In this table there are no deletes.
The records that are in this table are inserted by other process that is working ok.
My procedure do this:
Receive some parameters ( param1 , param2, param3)
...
IF condition = true THEN
LOCK TABLE my_table IN EXCLUSIVE MODE;
SELECT my_table_id INTO v_my_table_id FROM my_table WHERE available = 'Y' AND rownum = 1;
Update my_table set SET my_date = sysdate, my_field1 = param1, available = 'N' WHERE my_table_id = v_my_table_id;
COMMIT;
END IF;
The problem here is that some times this process is very slow , and the lock in the table remains for a long time and suddenly the table is released.
I review the CPU of the server whereis the database; and is normal.
This process has been working for 2 years and now is failing.
Could you help me to know if ther is a better way to do this process?
I can't undesrtand why this behaivor, if is a simple transaction.
I really appreciate your help
Lorein
Lorein....