Solved

parallel

Posted on 2013-11-29
5
417 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 37

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to recover a database from a user managed backup

752 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