今天发现生产的RAC环境expdp计划任务出现报错
之前一度认为是备份目录权限的问题
官方文档:
MOS参考文档:DataPump Export (EXPDP) Fails With Errors ORA-31693 ORA-31617 ORA-19505 ORA-27037 In a RAC Environment (文档 ID 1597395.1)
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 isstarted. Therefore, the directory object can point to local storage for thatinstance.
If the export operation has PARALLEL set to a value greater than 1, then Data Pump processes can resideon instances other than the one where the job was started. Therefore, the directoryobject must point to shared storage that is accessible by all instances of theOracle RAC.
导出文件的目录不是两个节点共享的原因,/bak只在节点1上挂载,并没用共享到节点2。如果/bak在两个节点共享,就不会出现这样的错误。但是现在只能在单实例上操作。查看expdp的help,发现有个参数cluster。这个参数可以控制是否采用多实例导出。设置cluster=no后(有的版本值是N,详见help说明),即:
expdp test/test1 parallel=4 cluster=no directory=BAK1 dumpfile=test20201118.dmp logfile=test20201118.log schemas=test1,test2
再次执行导出后正常。