oracle導入命令impdp中cluster選項的作用


oracle導入命令impdp中cluster選項的作用

發現問題

同事反映在使用oracle的impdp命令導入的時候,報以下錯誤:

最開始以為目錄不正確,在數據庫中使用命令select * from dba_directories查看directory的路徑是正確的,dumpfile文件也確實在正確的目錄下。再排查目錄的權限也是正確的。

找出原因

這時候,另外一個同事也做了同樣的導入動作,但是並沒有報錯。經過對比,發現沒有出現問題的同事加了一個參數cluster=N。那肯定是這個參數的問題,使用命令impdp -help,得到如下解釋:

CLUSTER
Utilize cluster resources and distribute workers across the Oracle RAC [YES].
--通過Oracle RAC來利用集群的資源和分布的工人(工人應該就是指實例,但是極其籠統,反正我是沒看出來啥意思)

雖然沒看明白啥意思,但是可以定位到因為是RAC的原因導致的。繼續找oracle rac cluster相關的關鍵字,找到如下描述:

Using PARALLEL During An Export In An Oracle RAC Environment

In an Oracle Real Application Clusters (Oracle RAC) environment, if an export operation has PARALLEL=1, then all Data Pump processes reside on the instance where the job is started. Therefore, the directory object can point to local storage for that instance.

If the export operation has PARALLEL set to a value greater than 1, then Data Pump processes can reside on instances other than the one where the job was started. Therefore, the directory object must point to shared storage that is accessible by all instances of the Oracle RAC.

cluster=n的時候,多個並行使用的是同一個實例進行導出和導入。但是如果cluster=y的時候,如果沒開並行,使用一個實例,如果開了並行,這時候,會使用多個實例。但是directory並不是在一個共享目錄中,因此另外一個實例會因為找不到directory而報錯。

解決方法

  1. cluster=nparallel=10組合,開並行,但是關閉集群導入導出。
  2. cluster=yparallel=1,關閉並行,可以打開集群導入導出,但是這是沒有意義的,即使打開,也沒有起效。
  3. cluster=yparallel=10directory在共享目錄上,可以同時使用集群導入和並行。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM