Solved

parallel

Posted on 2013-11-29
5
424 Views
Last Modified: 2013-12-13
CREATE TABLE table_name PARALLEL COMPRESS AS SELECT * FROM source_table;
table_name is the name of the table we are creating ,  but what is this source_table
0
Comment
Question by:dev_dba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 39684853
CREATE TABLE table_name PARALLEL COMPRESS AS SELECT * FROM source_table;

Open in new window


This actually "clones" source_table into table_name...

What exactly is your problem?!
0
 

Author Comment

by:dev_dba
ID: 39684857
noproblem..

so source_table is the compressed form right..
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 39684877
the source_table is not necessarily compressed

but the table_name will have basic compression for sure with this script

The actions this script does:
Recreate "source_table" with the same structure and give it the name "table_name"
> set the compression to "basic" for the new table
> set the parallel option active for this table
(http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_7002.htm#SQLRF54604)
Copy all the data from the "source_table" to the new "table_name"

You will have a copy of source_table with the name "table_name" and it's contents will be compressed and it will allow parallel inserts based on the number of processors in the oracle host server.
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 39684886
When you specify the AS SELECT clause to create a table and populate it with data from another table, you can utilize parallel execution. The CREATE TABLE...AS SELECT statement contains two parts: a CREATE part (DDL) and a SELECT part (query). Oracle Database can parallelize both parts of the statement. The CREATE part is parallelized if one of the following is true:

•A PARALLEL clause is included in the CREATE TABLE...AS SELECT statement

•An ALTER SESSION FORCE PARALLEL DDL statement is specified

The query part is parallelized if all of the following are true:

•The query includes a parallel hint specification (PARALLEL or PARALLEL_INDEX) or the CREATE part includes the PARALLEL clause or the schema objects referred to in the query have a PARALLEL declaration associated with them.

•At least one of the tables specified in the query requires either a full table scan or an index range scan spanning multiple partitions.

If you parallelize the creation of a table, that table then has a parallel declaration (the PARALLEL clause) associated with it. Any subsequent DML or queries on the table, for which parallelization is possible, will attempt to use parallel execution.

The following simple statement parallelizes the creation of a table and stores the result in a compressed format, using table compression:

CREATE TABLE hr.admin_emp_dept
     PARALLEL COMPRESS
     AS SELECT * FROM hr.employees
     WHERE department_id =10;
In this case, the PARALLEL clause tells the database to select an optimum number of parallel execution servers when creating the table.


Refer this for more details
http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables003.htm#i1009052
0
 

Author Closing Comment

by:dev_dba
ID: 39717647
Thanks
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question