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而报错。
解决方法
cluster=n
和parallel=10
组合,开并行,但是关闭集群导入导出。cluster=y
和parallel=1
,关闭并行,可以打开集群导入导出,但是这是没有意义的,即使打开,也没有起效。cluster=y
和parallel=10
和directory在共享目录上
,可以同时使用集群导入和并行。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现