Oracle Parallel DML

tompson666發表於2024-04-14
1.Parallel DML
1.1 Table parallel dml
alter table emp parallel (degree 4);
select degree from user_tables where table_name = 'EMP';
select count(*) from emp;
alter table emp noparallel; 
1.2 hint parallel dml
SELECT /*+ PARALLEL(emp,4) */ COUNT(*) 
FROM emp; 
1.2 Session parallel dml
alter session enable parallel dml;
insert /*+ parallel (emp_big,4,1) */
  into emp_big select * from emp;
commit;
alter session disable parallel dml;
2.Parallel DDL
CREATE TABLE...AS SELECT
CREATE INDEX
ALTER INDEX...REBUILD 
2.1 Session Parallel DDL(nologging)
alter session enable parallel ddl;
For nonpartitioned tables and indexes, only the following types of DDL statements can be parallelized: 
CREATE TABLE...AS SELECT
CREATE INDEX
ALTER INDEX...REBUILD 
If you're working with partitioned tables and indexes, the scope of Oracle's parallel DDL support broadens. The following statements can be parallelized for partitioned tables and indexes: 
CREATE TABLE...AS SELECT
ALTER TABLE...MOVE PARTITION
ALTER TABLE...SPLIT PARTITION
CREATE INDEX
ALTER INDEX...REBUILD PARTITION
ALTER INDEX...SPLIT PARTITION
create table big_emp parallel (degree 4) nologging
  as select * from emp; 
CREATE INDEX emp_ix ON emp (emp_id)
   TABLESPACE ind
   STORAGE (INITIAL 1M NEXT 1M PCTINCREASE 0 MAXEXTENTS 20)
   PARALLEL (DEGREE 4) nologging;


來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/70038077/viewspace-3012495/,如需轉載,請註明出處,否則將追究法律責任。

相關文章