Solved

How to create a Oracle Index without locking the column.

Posted on 2011-02-23
5
676 Views
Last Modified: 2012-08-13
Hi ,

How can I create Oracle index without locking the column?
Currently total rows on the targeted table is 50 million of rows and data being updated
every hour.

regards,
titanium0203
0
Comment
Question by:titanium0203
  • 3
5 Comments
 
LVL 7

Expert Comment

by:MrNed
ID: 34966617
If you use the ONLINE keyword it will only take a very brief lock (10g and 11g vary slightly).

http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/indexes003.htm#insertedID6

CREATE INDEX emp_name ON emp (mgr, emp1, emp2, emp3) ONLINE;
0
 
LVL 7

Expert Comment

by:MrNed
ID: 34966640
0
 

Author Comment

by:titanium0203
ID: 34966812
Hi MrNed,

FYI, Our Oracle is in 10G.
0
 
LVL 7

Accepted Solution

by:
MrNed earned 63 total points
ID: 34966846
I believe you can do it in 10g as long as there are no uncomitted transactions on the table. Besides, if it is only updated hourly you should be able to get it created in that time unless you're on old hardware. You could use parallel index create with no logging to really make it fly.
0
 
LVL 5

Assisted Solution

by:jaiminpsoni
jaiminpsoni earned 62 total points
ID: 34968660
alternatively, You should parallel DML and create online index.

This will allow you to create index without locking the table...

http://www.orafaq.com/wiki/Parallel_Query_FAQ

ALTER TABLE table_name NOPARALLEL;

Check this as well...

http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5010.htm

Hope this helps....





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
select query - oracle 16 92
Oracle RAC 12c 8 55
Error executing command from server 6 41
Oracle 12c database link between pdb not working 20 42
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

912 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