[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Oracle Unique Index without matching Primary Key or Unique Key

Posted on 2011-03-25
6
Medium Priority
?
638 Views
Last Modified: 2012-05-11
When a Oracle Unique Index is defined for a table, and no Primary Key or Unique Key is defined for the table (Or a Primary Key or Unique Key is defined that has less columns than the Unique Index) Is the unique index enforced for table updates and inserts for Oracle 11 and/or previous releases?
0
Comment
Question by:pendlewe
[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
  • 2
  • 2
6 Comments
 
LVL 77

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 252 total points
ID: 35218667
Not sure about the rest of the question but...

>>Is the unique index enforced for table updates and inserts for Oracle 11 and/or previous releases?

Yes.  That's sort of by definition of an RDBMS.


0
 

Author Comment

by:pendlewe
ID: 35218854
In older Oracle, a Unique Index was created (*I think*) whenever a Primary Key was created. I think this is no longer true. My objective is to automate insert, update, and deletes in ~1000 oracle tables based on uniqueness, using dynamic SQL.

Thanks,
Bill
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 248 total points
ID: 35219131
if an index (unique or non-unique) is already available that Oracle thinks will be efficiently usable to enforce the PK constraint,  then it won't create a new index.  
If there is no such index in place then creating the constraint will create the index.  This is still true all the way up to 11gR2.




0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 248 total points
ID: 35219139
so, obvious question is: Why would an index NOT be usable?

If it's for different columns than the PK enforces
or if it has insufficient columns

0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 252 total points
ID: 35219172
>>In older Oracle, a Unique Index was created (*I think*) whenever a Primary Key was created.

I forget a lot about the very early versions of Oracle but there is a difference between a PK and Unique index.

A PK will NOT allow a null where a Unique index will.
0
 

Author Closing Comment

by:pendlewe
ID: 35232751
Thank you.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

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…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

649 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