The Jeff Plumb Blog

Wednesday, March 08, 2006

Select allows locks

I was reading the March/April edition of Oracle magazine and found Tom Kyte's article on how select allows locks very interesting. Although Tom points out some reasons for allowing this, I would prefer that you could not lock tables with only the select privilege.

One reason given was that if you had to delete from table P and P is the parent of C. And you have read/write access to P and only read access to C. When you attempt to delete from P, Oracle will try and lock a bit of C (if indexes foreign keys exist) or all of C (if there is no index).

In this scenario, I would prefer the delete to fail unless you had read/write access to both P and C rather than allowing anybody with select access to be able to lock the entire table.

However this is how Oracle works and it is definately worth knowing.

0 Comments:

Post a Comment

<< Home