Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: problem with gather_schema_stats after updating a BLOB column
slim wrote:
> Hi,
> -- this is a sample code, where the exception occurs when calculating
> -- statistics
> -- ORA-04020: deadlock detected while trying to lock object
> USER1.tab_pictures
> -- thanks for help
>
> DECLARE
> blob_gra BLOB;
> BEGIN
> SELECT pic_graphic
> INTO blob_gra
> FROM tab_pictures
> WHERE pic_id = 100 AND
> pic_type = 'GIF'
> FOR UPDATE;
> DBMS_LOB.OPEN( blob_gra, DBMS_LOB.LOB_READWRITE );
> DBMS_LOB.CLOSE( blob_gra);
>
> dbms_stats.gather_schema_stats(ownname => 'USER1',
> cascade => TRUE);
> EXCEPTION
> WHEN OTHERS THEN
> RAISE;
> END;
Lets see ... you lock a record by doing a SELECT FOR UPDATE. And you don't
release the lock ... I wonder what could be the problem? Hmmmm. <g>
Daniel Morgan Received on Thu Jun 06 2002 - 10:25:50 CDT