我有以下形式的查詢,當我查詢它從任何模式在本地服務器上,其完美的作品一個觀點:ORA-00928從視圖在DB鏈接選擇,但本地工作
WITH dates AS (
SELECT /*+ materialize */ ... FROM (SELECT ... FROM [email protected])
UNION ALL
SELECT * FROM (SELECT /*+ materialize */ FROM [email protected])
)
SELECT ... FROM (
SELECT ... FROM (
SELECT ... FROM (
SELECT ... FROM (
SELECT ... FROM
)
) foo
LEFT OUTER JOIN (
SELECT /*+ USE_MERGE(hle dates) */ ... FROM
) bar ON conditions
)
)
UNION ALL
SELECT ... FROM (
SELECT ... FROM (
SELECT ... FROM (
SELECT ... FROM (
SELECT ... FROM
)
) foo
LEFT OUTER JOIN (
SELECT /*+ USE_MERGE(hle dates) */ ... FROM
) bar ON conditions
)
)
當我從任何其他服務器上的任何遠程數據庫鏈接運行查詢,例如SELECT * from [email protected]_link
,我得到:
ORA-00928: missing SELECT keyword
ORA-02063: preceding line from PLLDB
00928. 00000 - "missing SELECT keyword"
*Cause:
*Action:
Error at Line: 2 Column: 9
甲骨文認爲,2號線是一個問題。這裏是第一個五年實際行:
WITH dates AS (
-- Get days
SELECT /*+ materialize */
row_number() OVER (ORDER BY begin_period DESC) rn,
'D' AS interval_type,
所有其他視圖完美地工作在DB鏈接(編輯一次解決所有相關的Oracle錯誤)。
爲什麼這個視圖在本地完美工作,但不能通過數據庫鏈接?
看起來像oracle9i的BUG(BUG 768478)。請閱讀[這裏](http://www.dbasupport.com/forums/showthread.php?43937-Error-ORA-00928-when-querying-view-through-dblink) –
@OracleUser:看起來你是對的。添加爲答案,我將其標記爲已解決。 –
我做了一些繪畫工作,並粘貼在這裏!謝謝! –