Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I use Oracle Hints to speed up Inserts?

Posted on 2014-12-27
2
Medium Priority
?
263 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
[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
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
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 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 setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

664 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