Solved

How to disable indexes while inserting data?

Posted on 2011-09-30
7
558 Views
Last Modified: 2012-05-12
I am loading 300million records into a table. It has been taking long time to insert.
I want to disable Indexes on that table to make it faster. Can i disable them with out stopping the load process?
0
Comment
Question by:ajaybelde
7 Comments
 
LVL 5

Expert Comment

by:MrNetic
Comment Utility
Have you ever considering drop index and create in the end.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
I don't believe you can 'disable' an index.  I think you will need to drop it.
0
 

Author Comment

by:ajaybelde
Comment Utility
To drop indexes the load process should be terminated otherwise it will give "RESOURCE BUSY" error. Isn't it?
So, I just wanna make those indexes unusable.
0
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.

 
LVL 34

Accepted Solution

by:
johnsone earned 333 total points
Comment Utility
You can make the index unusable with this command:

ALTER INDEX <indx> UNUSABLE;


However, in order to make it usable again, it must be either rebuilt or dropped and recreated.
0
 

Author Comment

by:ajaybelde
Comment Utility
I can drop and recreate after load is done.
I wanna make sure whether i can make them unusable on the fly or not?
0
 
LVL 34

Assisted Solution

by:johnsone
johnsone earned 333 total points
Comment Utility
I would drop them before the load, then recreate them after the load.

My guess is that making it unusable will require the same lock as dropping the index.
0
 
LVL 34

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 167 total points
Comment Utility
No, you cannot make an Oracle index unusable "on-the-fly" while a data load process is already running to add records to the table.  You need to drop the index(es) before the load, then re-create the index(es) after the load.
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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

771 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

9 Experts available now in Live!

Get 1:1 Help Now