Solved

parallel

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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Join SQL view with APEX item as the join condition 4 49
Convert Oracle data into XML document 2 59
Oracle -- identify blocking session 24 43
PL SQL Search Across Columns 4 22
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 …
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…
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 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.

863 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

23 Experts available now in Live!

Get 1:1 Help Now