Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

parallel

Posted on 2013-11-29
5
Medium Priority
?
437 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
5 Comments
 
LVL 14

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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Suggested Courses

926 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