Hi

I have this query to check weather the segments of two database reside in same tablespaces in both databases


select segment_name "trafr_seg", partition_name
from dba_segments a
where segment_name in
(
select segment_name from dba_segments@trafp b
where tablespace_name='IDX_128M_2'
and a.segment_name=b.segment_name
)
and tablespace_name='IDX_128M_2'
/


Now I want to do the other way round so check which segment in first database does not reside in same tablespaces as those in the second tablespace so simply I changed IN to NOT IN but it gives an SQL error

ERROR at line 6:
ORA-00920: invalid relational operator
ORA-02063: preceding line from TRAFP


NOT IN cannot be used in a correlated query?