ORA-12751: CPU time or run time policy violation

This error indicate that the server doesnot have sufficient CPU resources to handle the workload or in contrary, we can say workload is higher than the CPU capacity in your system.

This message may lead to very serious performance issues on a production database. An application batch job or any job run for a long time than usual duration.

kish@exdbx<>!oerr ora 12751
12751, 00000, "cpu time or run time policy violation"
// *Document: NO
// *Cause: A piece of code ran longer than it is supposed to
// *Action: If this error persists, contact Oracle Support Services.

First thing to notice is the vmstat column ‘r’ output which is the CPU run queue. This value should not be more than the CPU capacity.

Eg: if CPU has 4 cores, then there will be 8 threads total on the server. If the run queue is more than 8 for long time, then you get this error with performance degradation



[oracle@exdbadm01 ~]$ vmstat 5 10
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
19  0      0 1370648  38384 1932252    0    0   386   116  483 1479  7  7 80  4  3
38  0      0 1354784  38408 1939472    0    0     2    66 1363 1468 35 62  3  0  0
33  0      0 1338144  38432 1945248    0    0     2    66 1298 1372 30 70  0  0  0
43  0      0 1313560  38456 1947764    0    0     2    52 1589 1300 25 75  0  0  0
21  0      0 1301236  38480 1950140    0    0     2    66 1132 1178 28 72  0  0  0
14  0      0 1296888  38496 1953904    0    0     2    67  934 1317 32 68  0  0  0
11  0      0 1291784  38520 1959876    0    0     2    87 1189 1400 39 61  0  0  0
29  0      0 1290676  38536 1961076    0    0     2    82 1367 1368 16 82  2  0  0
18  0      0 1285328  38552 1961964    0    0     2    34 1699 1370 14 86  0  0  0
30  0      0 1282732  38576 1966356    0    0     2    97 1206 1452 31 69  0  0  0

If you look at %id on top command output, it should be consistent at 0.0% for more than an hour without any fluctuation

Workaround:

  • Reduce the workload by distribution of non critical jobs evenly across a day
  • Tune the resource intensive SQL queries to eat less CPU
  • Last option will be to add more CPU on the server. But scale up of CPU will not help to fix the issue in longer run because application workload keep increase day by day but not reduce.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s