Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: October 19, 2020 - 8:27 am UTC

Answered by: Connor McDonald - Last updated: October 21, 2020 - 1:18 am UTC

Category: Database Administration - Version: Oracle 12c 12.2.0.1.0 Standard Edition

Viewed 100+ times

You Asked

The server machine on which the DB resides has 32 CPUs. (2 sockets * 8 cores per socket * 2 threads per core)
I notice many oracle processes (both non-background and background) consuming high (sometimes 100%) of the CPU.
Now, this CPU % is only for 1 CPU out of the total 32 in the server. And once a process hits 100% of CPU consumption, the process cannot take resources from other CPUs. (please correct me if I am wrong)
Right now, THREADED_EXECUTION parameter is set to FALSE.
I was thinking, if we can enable multi threading in the Database, then, may be the process that is hitting 100% and is looking for more CPU can take it from the other CPUs.
Is this a good idea?
If yes, then how should we enable multi threading in the DB and what is the possible impact on the DB?
Please Note: This is a single instance DB (non-RAC)
OS: SUSE Linux Enterprise Server 12

Thanks in Advance,
Abhishek,
Kolkata, India

and we said...

By default, there are a number of processes always running to have your Oracle instance up and running. This is typically anywhere between 30 and 60 processes which are known as "background processes". They normally use a tiny portion of CPU.

However, for every person that connects to the database, they get their own process too. These are "foreground" processes and the CPU they consume depends totally on the work they are trying to do. If you know the OS process ID of the process that is consuming the CPU, you can run this

select s.*
from v$session s, v$process p
where s.PADDR = p.ADDR
and p.SPID = NNN


where 'nnn' is the OS process ID. That will tell you which session is doing the work and you can drill down from there (eg the SQL_ID column shows you what SQL they are running if the STATUS column is "ACTIVE", which you can then use to query V$SQL)

Here's a good intro to the process architecture

https://docs.oracle.com/en/database/oracle/oracle-database/19/cncpt/introduction-to-oracle-database.html#GUID-16C1C948-4B26-4A0E-B94E-01D57859CFCF

and you rated our response

  (1 rating)

Reviews

Parallel DML

October 19, 2020 - 6:50 pm UTC

Reviewer: A reader from Santos, SP - Brazil

I think Abhishek is looking for Parallel DML.

Yes, a process (either background or foreground) can use only one CPU at a time.

If you would like some of your queries to run on multiple CPUs, you need to use parallel dml. Please be advised this may not be suitable for all queries.

For further details, please refer to:

https://docs.oracle.com/en/database/oracle/oracle-database/19/vldbg/parallel-exec-intro.html#GUID-F9A83EDB-42AD-4638-9A2E-F66FE09F2B43
Connor McDonald

Followup  

October 21, 2020 - 1:18 am UTC

nice input

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database