Skip to Main Content
  • Questions
  • Oracle Database - Grant/Revoke High Concurrency

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Mateo.

Asked: May 22, 2018 - 2:19 pm UTC

Last updated: May 28, 2018 - 1:47 am UTC

Version: 10g release 2

Viewed 1000+ times

You Asked

We have an Oracle 10g release 2 database running on a production environment. It's experiencing a lot of concurrency, as Sql Developer 17.4 "Waits for past 1 hour" graph shows.

When the database is behaving slow, we take a look at that graph, and it shows a very high concurrency. We noticed that when this occurs, almost always a GRANT/REVOKE is executing, so we suspect that could be the cause but we don't know for certain.

Are DDL's like GRANTS/REVOKES capable of generating this high concurrency ?

Could you guys point us on the right direction ?

and Connor said...

Do you have an AWR report or similar you can provide? We don't have a lot of detail here.

"a lot of concurrency" is a good thing if you take the true meaning of the term - do you mean LACK of concurrency?

The other question I'd have is: Why are you doing lots of grants and revokes? That should be rare.

But we need more details.

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Response

Mateo, May 24, 2018 - 2:20 pm UTC

I mean low performance because of high concurrency.

Is there a way to prevent DDL of locking the table ? Because we need to do DDL's on operational time, so is it posible that DML (select, insert, update, etc) are not locked during DDL(grant, revoke, synoymo) on same table ?

parse hell

Racer I., May 25, 2018 - 11:13 am UTC

Hi,

Assuming your concurrency wait events are things like
cursor: pin S wait on X
library cache lock

you might hit a problem we also have intermittedly. Namely massive parsing by extensive changes to the dictionary and/or statistics.

One scenario was analyzing many tables (with stale statistics). In production this happens at night or weekends but in the testsystem it ran (unintentionally) during the tests and slowed everything down. It used NO_INVALIDATE=false so many statements had to be reparsed (sometimes again and again if they used many tables). We are considering Publish=FALSE + PUBLISH_PENDING_STATISTICS to reduce the impact.

Another was ALTER INDEX xxx MONITORING USAGE. We do it if the index is used but the monitoring startet more than a week ago to get fresh infos. Apparently this also triggers reparsing. Probably any ALTER statement will or it is specific because at least in 12.1 index usage comes from parsing not from runtime so if statements aren't reparsed we would see indexes unused that are still used. We hope for the new 12.2 technique when we upgrade.

Apart from moving/spreading the reasons around in time there were also a few specific statements whose complexity could be sensibly reduced to reduce the impact.

Still there remains Connors query : why do you need to do the grants/revokes at all (let alone during uptime)?

regards,

Mateo, May 25, 2018 - 6:19 pm UTC

When an user is created in our system it triggers 50 grants more or less. We need to give him access to different tables (select, update, delete). The thing is that users are created all the time, cause it's a distributed administration.

Do DDL's always generate locks ? Can those locks be disabled ?

Is it better for performance to use roles instead ?
Connor McDonald
May 28, 2018 - 1:47 am UTC

OK - lets tackle that first.

Rather than running 50 grants, why not create a role which contains those 50 privileges. Then you only need to run *1* grant.

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.