Site icon IT Tutorial

Parallel Hint in Oracle

I will explain Parallel Hint in Oracle in this post.

 

Parallel Hint

If you execute any SQL which is accessing large data sets, then you may use Parallel hint to perform it in parallel.

When you use parallel hint, you should check operating system CPU counts and cores to specify how many parallel will you use it.

 

 

 

 

If lots of people use parallel hint everytime, operating system and database can  slow down or power off because of CPU bootleneck.

 

 

 

Parallel hint for Oracle large data access

 

Parallel hint syntax is as follows.

/*+ PARALLEL (table_name[, degree[, instances]]) */

 

You can use the Parallel hint to force parallel running the SQL Statement

SELECT /*+ PARALLEL(employees 8) */ e.last_name
FROM   employees e
WHERE  department_id=63;



SELECT /*+ PARALLEL(96) */ COUNT(*) 
FROM TABLE_NAME;


 

You can alter degree of table with parallel or noparallel as follows.

ALTER TABLE TABLE_NAME PARALLEL 64;
ALTER TABLE TABLE_NAME NOPARALLEL;

 

 

 

You can run the following script to parallelize the session using the following script.

ALTER SESSION ENABLE PARALLEL DML;
ALTER SESSION FORCE PARALLEL;
alter session force parallel query parallel 32;
ALTER SESSION FORCE PARALLEL DML parallel 32;

 

 

You can review the following post to learn more details about Oracle Hint usage.

What is the Optimizer Hints and How to Use Hints in Oracle | Oracle Database Performance Tuning Tutorial -16

 

 

 

 

 

Do you want to learn Oracle Database Performance Tuning detailed, then read the following articles.

Performance Tuning and SQL Tuning Tutorial in the Oracle Database

 

Exit mobile version