Solved

parallel

Posted on 2013-11-29
5
400 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 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 36

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now