How to enable parallel mode in Oracle?
To enable parallel mode in the Oracle database, you need to follow these steps:
- Make sure that the database parameter “parallel_max_servers” is correctly configured. You can check the value of this parameter by querying the V$PARAMETER view.
- Set the “PARALLEL” parameter to “TRUE” in the user session to enable parallel execution. For example:
ALTER SESSION ENABLE PARALLEL DML;
- Enable parallel mode when creating a table using the “PARALLEL” keyword. For example:
CREATE TABLE table_name
(
column1 datatype,
column2 datatype,
...
)
PARALLEL;
- Use the “PARALLEL” keyword to change the parallelism of an existing table. For example:
ALTER TABLE table_name PARALLEL;
- Enable parallel execution in the query by using the “PARALLEL” hint. For example:
SELECT /*+ PARALLEL(table_name, degree) */ column1, column2
FROM table_name;
Please note, parallel execution will increase the consumption of system resources, so make sure your system has enough resources to support parallel execution before enabling parallel mode.