`
wangpengfei360
  • 浏览: 1059254 次
文章分类
社区版块
存档分类
最新评论

The primary key can work with the index well

 
阅读更多

continuted:

The primary key can work with the index well even with the non unique key.

But the non unique key have to be converted to unique key index by the primary key creating command.

See following example:

SQL> create table t2 as select rownum rno from user_objects where rownum<=10;

Table created.

SQL> create index t2_idx on t2(rno);

Index created.

SQL> select * From t2;

RNO
----------
1
2
3
4
5
6
7
8
9
10

10 rows selected.

SQL> alter table t2 add constraint t2_pk primary key(rno);

Table altered.

SQL> insert into t2 values(1);
insert into t2 values(1)
*
ERROR at line 1:
ORA-00001: unique constraint (SYS.T2_PK) violated


SQL> select index_name,uniqueness from user_indexes where table_name='T2';

INDEX_NAME UNIQUENES
------------------------------ ---------
T2_IDX NONUNIQUE

分享到:
评论

相关推荐

    微软内部资料-SQL性能优化5

    Keeping your clustered key value small increases the number of index rows that can be placed on an index page and decreases the number of levels that must be traversed. This minimizes I/O. As we’ll ...

    a project model for the FreeBSD Project.7z

    The vision is “To produce the best UNIX-like operating system package possible, with due respect to the original software tools ideology as well as usability, performance and stability.” The ...

    S7A驱动720版本

    - The driver can now be registered as a service with the local system account as the log-on account. For more information see the document "S7A_as_Service.PDF" on the installation CD . - The ...

    NewSID(光学习一下代码就可以了,没看清楚介绍别运行)

    including files and Registry keys, that one user has access to, the other will as well.Another instance where duplicate SIDs can cause problems is where there is removable media formated with NTFS, ...

    二级减速器课程设计说明书reducer design specification.doc

    In addition to the pure material transport, it can also cooperate with the requirements of the technological process in the production process of various industrial enterprises to form a rhythmic ...

    微软内部资料-SQL性能优化3

    To make use of either more or less strict isolation levels in applications, locking can be customized for an entire session by setting the isolation level of the session with the SET TRANSACTION ...

    微软内部资料-SQL性能优化2

     Identify at least five counters for each subsystem that are key to understanding the performance of that subsystem.  Identify three common myths associated with the memory, I/O, or CPU subsystems...

    Computer Organization and Design

    You may find the content does not display well if your display is not set to at least 1024x768 pixel resolution., , PDF Viewer, The CD material includes PDF documents that you can read with a PDF ...

    UE(官方下载)

    Did you know that you can not only change what is on UltraEdit's toolbars, you can also change the icon used, as well as create your own custom toolbars and tools? File tabs Understand how file tabs ...

    Automated Fingerprint Identification Systems

    Key terms and issues are included, and well as suggestions for improving the overall number of identifications. The book will go beyond process and also discuss issues such as interoperability, ...

    netWindows_0.3.0_pre2

    both inthe Original Work itself and in any documentation and/or other materialsprovided with the distribution of the Original Work in executable form.Exclusions from License Grant. Neither the names ...

    C++程序设计语言(特别版) 英文原版

    The primary aim of this book is to help the reader understand how the facilities offered by C++ support key programming techniques.The aim is to take the reader far beyond the point where he or she ...

    Tomcat 5 Unleashed

    With the tools supplied by a solid enterprise, an organization can do its work more effectively and efficiently. And that is what I hope you get from this book: how to use Tomcat to realize the goals...

    Professional.Git.epub

    the ability to work effectively with Git is rapidly approaching must-have status, and Professional Git is the comprehensive guide you need to get up to speed quickly. Table of Contents PART I: ...

    Professional Git [2017]

    Professional Git ... the ability to work effectively with Git is rapidly approaching must–have status, and Professional Git is the comprehensive guide you need to get up to speed quickly.

    BURNINTEST--硬件检测工具

    - Added a hot Key, F4, to set the auto run flag and run the tests (i.e. set "-r" and then run the tests). - Other minor changes. Release 5.3 build 1018 WIN32 release 16 April 2008 - Added an ...

    LINQ中文学习资料和LINQ 随身参考手册

    All the examples in the LINQ Pocket Reference are preloaded into LINQPad, the highly praised utility that lets you work with LINQ interactively. Created by the authors and free to download, LINQPad ...

    Android.Studio.New.Media.Fundamentals.148421640

    and gets more advanced as chapters progress, covering what new media assets are best for use with Android Studio as well as key factors regarding the data footprint optimization work process and why ...

    Python安装包version 3.1.5

    Python 3.x is a new version of the language, which is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries ...

Global site tag (gtag.js) - Google Analytics