Solved

How can I use Oracle Hints to speed up Inserts?

Posted on 2014-12-27
2
247 Views
Last Modified: 2014-12-28
Dear Experts,

I have a PL/SQL procedure like below. I have implemented some session-wide Parameter Setting and Oracle Hints to speed up the operation. Do you think that I used the correct set of parameters and hints, or could you offer me better?

Notes:
1-TEMP_TABLE is a small table with approximately 100.000 rows compared to main table which has millions of rows.  2-TEMP_TABLE has no indexes while main table has a nonunique index with multiple fields including date field.
3-TEMP_TABLE is an ordinary table while the main table is partitioned daily.

BR  
----------------------------------------------------------------------------------------------------------------------------------------
DECLARE
.......
BEGIN
.......
EXECUTE IMMEDIATE 'ALTER SESSION SET db_file_multiblock_read_count=16';
INSERT /*+ APPEND PARALLEL NOLOGGING */ INTO MAIN_TABLE SELECT * FROM TEMP_TABLE;
COMMIT;
EXECUTE IMMEDIATE 'TRUNCATE TABLE TEMP_TABLE DROP STORAGE';
END;
0
Comment
Question by:GurcanK
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 40519656
if the temp table will have data for a particular day, you could insert directly to the partition that corresponds to that day.  it's not a hint, but could help.

your hints should help.   if you're going to force parallel, you might want to force a particular degree of parallelism otherwise it might vary from run to run.
0
 

Author Comment

by:GurcanK
ID: 40519669
How shall I insert derectly to the current day's partition? (partition creation is automatic in daily basis)
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
Oracle SQL 6 75
PL/SQL Display based on value 4 39
SQL2016 to ORACLE11G linked-server 6 28
add more rows to hierarchy 3 25
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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…
Via a live example, show how to take different types of Oracle backups using RMAN.
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.

830 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