2017-07-27 106 views
0

db1上有兩個db,表test_table,上下文索引按字段a。查詢:Oracle上下文索引:無法通過dblink工作

select * 
    from test_table t 
where contains(t.a, 'str') > 0 

它在db1上正常工作。但是,當我嘗試從其他數據庫,通過DBLINK執行相同的查詢:

select * 
    from [email protected] t 
where contains(t.a, 'str') > 0 

我得到這個錯誤:

ORA-20000:Oracle Text的錯誤: DRG-10599:列沒有被索引

+0

你有沒有考慮在DB1創建查詢的視圖(謂語),然後查詢使用DB2數據庫鏈接的看法? –

回答

0

您必須添加dblink才能運行。 https://docs.oracle.com/cd/E11882_01/text.112/e24436/csql.htm#CCREF0104

The CONTAINS operator also supports database links. You can identify a remote table or materialized view by appending @dblink to the end of its name. The dblink must be a complete or partial name for a database link to the database containing the remote table or materialized view. (Querying of remote views is not supported.)

select * 
    from [email protected] t 
where contains(t.a, 'str')@db1 > 0. 
+0

謝謝,它的工作,唯一的澄清 - 正確的版本看起來像這樣: select * from test_table @ db1 t 其中包含@ db1(t.a,'str')> 0。 –