Skip to Main Content

SQL & PL/SQL

how would i compare if two indexes are identical?

Erhan_torontoJul 24 2013 — edited Jul 31 2013

I like to compare if two indexes from both users are identical. Is there any way to to that. I need similer to below query:

select CASE (2*(select count(*) from (select * from XPKTBL_A INTERSECT select * from XPKTBL_A )) - (select count(*) from XPKTBL_A ) - (select count(*) from XPKTBL_A )) WHEN 0 THEN 'Indexes are identical' ELSE 'Indexes are different' END "Result" from  DUAL;

UserA:

create table TBL_A (       FIELD_A1 number not null,

FIELD_A2 varchar2(50),

FIELD_A3 date,

FIELD_A4 number(5,2) default 0,

FIELD_A5 varchar2(10) not null

                                );

                                create unique index XPKTBL_A on TBL_A (FIELD_A1);

UserB:

create table TBL_A (       FIELD_A1 number not null,

FIELD_A2 varchar2(20),

FIELD_A4 number(5,2) not null,

FIELD_A5 varchar2(10),

FIELD_A6 number(2) not null

                                );

                                create unique index XPKTBL_A on TBL_A (FIELD_A1, FIELD_A6);

This post has been answered by Erhan_toronto on Jul 30 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2013
Added on Jul 24 2013
25 comments
1,729 views