2015-04-07 37 views
2

每一次,當我執行以下語句,同時:跳過不可用索引導致DBLINK錯誤

alter session set skip_unusable_indexes=true; 

,我發現了以下錯誤:

ORA-03135: connection lost contact 
ORA-02063: preceding line from my_dblink 

  • 跳過索引與我的dblink有什麼關係?
  • 如何檢測有問題的索引?
  • 如何限制上述聲明的範圍僅限於本地索引?

回答

0

1)跳過索引與我的dblink有什麼關係?

It has no relation. Please elaborate how you are getting the issue. Is that you are login to sqlplus and as soon as you alter session, your DB link disconnects?

2)如何檢測有問題的索引?

select STATUS,index_name,table_name from user_indexes where status='UNUSABLE'; 

select STATUS,index_name,table_name from user_indexes where status!='VALID' and status!='N/A'; 

3)如何限制上述語句的範圍僅限於本地索引?

I believe you meant to say the indexes on connected database and not on the DB link database. You can not do this. This is session or system setting.

0

我懷疑這是一個錯誤,或者至少是一個未實現的功能。

當您將會話設置爲跳過不可用的索引時,您正在修改查詢優化程序/分析程序行爲,並且我懷疑此修改無法「推送」到您已建立連接的遠程實例。

我還懷疑,避免這個問題的關鍵(如果可以避免的話)是在引用任何數據庫鏈接之前改變會話,但即使如此,如果遠程數據庫沒有實現修改,我也不會感到驚訝,因爲它實際上是一個不同的會議。

相關問題