Ahh -- yes, well, that second column repeated there is the list of indexed columns that would be used. For example:
ops$tkyte@ORA817DEV.US.ORACLE.COM> create table p ( x int primary key );
Table created.
ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> create table c ( A references p, B int, constraint c_pk primary key (a,b) );
Table created.
ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> column columns format a20 word_wrapped
ops$tkyte@ORA817DEV.US.ORACLE.COM> column table_name format a30 word_wrapped
ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> select decode( b.table_name, NULL, '****', 'ok' ) Status,
2 a.table_name, a.columns, b.columns
3 from
4 ( select substr(a.table_name,1,30) table_name,
5 substr(a.constraint_name,1,30) constraint_name,
6 max(decode(position, 1, substr(column_name,1,30),NULL)) ||
7 max(decode(position, 2,', '||substr(column_name,1,30),NULL)) ||
8 max(decode(position, 3,', '||substr(column_name,1,30),NULL)) ||
9 max(decode(position, 4,', '||substr(column_name,1,30),NULL)) ||
10 max(decode(position, 5,', '||substr(column_name,1,30),NULL)) ||
11 max(decode(position, 6,', '||substr(column_name,1,30),NULL)) ||
12 max(decode(position, 7,', '||substr(column_name,1,30),NULL)) ||
13 max(decode(position, 8,', '||substr(column_name,1,30),NULL)) ||
14 max(decode(position, 9,', '||substr(column_name,1,30),NULL)) ||
15 max(decode(position,10,', '||substr(column_name,1,30),NULL)) ||
16 max(decode(position,11,', '||substr(column_name,1,30),NULL)) ||
17 max(decode(position,12,', '||substr(column_name,1,30),NULL)) ||
18 max(decode(position,13,', '||substr(column_name,1,30),NULL)) ||
19 max(decode(position,14,', '||substr(column_name,1,30),NULL)) ||
20 max(decode(position,15,', '||substr(column_name,1,30),NULL)) ||
21 max(decode(position,16,', '||substr(column_name,1,30),NULL)) columns
22 from user_cons_columns a, user_constraints b
23 where a.constraint_name = b.constraint_name
24 and b.constraint_type = 'R'
25 group by substr(a.table_name,1,30), substr(a.constraint_name,1,30) ) a,
26 ( select substr(table_name,1,30) table_name, substr(index_name,1,30) index_name,
27 max(decode(column_position, 1, substr(column_name,1,30),NULL)) ||
28 max(decode(column_position, 2,', '||substr(column_name,1,30),NULL)) ||
29 max(decode(column_position, 3,', '||substr(column_name,1,30),NULL)) ||
30 max(decode(column_position, 4,', '||substr(column_name,1,30),NULL)) ||
31 max(decode(column_position, 5,', '||substr(column_name,1,30),NULL)) ||
32 max(decode(column_position, 6,', '||substr(column_name,1,30),NULL)) ||
33 max(decode(column_position, 7,', '||substr(column_name,1,30),NULL)) ||
34 max(decode(column_position, 8,', '||substr(column_name,1,30),NULL)) ||
35 max(decode(column_position, 9,', '||substr(column_name,1,30),NULL)) ||
36 max(decode(column_position,10,', '||substr(column_name,1,30),NULL)) ||
37 max(decode(column_position,11,', '||substr(column_name,1,30),NULL)) ||
38 max(decode(column_position,12,', '||substr(column_name,1,30),NULL)) ||
39 max(decode(column_position,13,', '||substr(column_name,1,30),NULL)) ||
40 max(decode(column_position,14,', '||substr(column_name,1,30),NULL)) ||
41 max(decode(column_position,15,', '||substr(column_name,1,30),NULL)) ||
42 max(decode(column_position,16,', '||substr(column_name,1,30),NULL)) columns
43 from user_ind_columns
44 group by substr(table_name,1,30), substr(index_name,1,30) ) b
45 where a.table_name = b.table_name (+)
46 and b.columns (+) like a.columns || '%'
47 /
STAT TABLE_NAME COLUMNS COLUMNS
---- ------------------------------ -------------------- --------------------
ok C A A, B
<b>see -- the fkey is on A, but the index we'll use is the one on A, B. I just wanted to print out both.
BTW: if you have my book -- the script I have in there is "better" -- it is "100%" -- it finds all cases. The above query can have some "false positives"!!
</b>
Loved the comment on "you must have encrypted it". It does surprise me when people just won't "dig a little bit" to try and figure it out.