expdp/impdp使用及问题记录

expdp/impdp使用及问题记录

sys用户
创建虚拟目录:create directory xxx as ‘/xxx’;
查询目录:select * from dba_directories;
授权:grant read,write on directory xxx to 用户;
给用户授予导入权限:grant imp_full_database to 用户;

数据库服务器:
创建目录/xxx
授权:chown oracle /xxx;
su - oracle
按用户导出数据库:expdp 用户名/密码@链接 schemas=用户 directroy=xxx dumpfile=xxx.dmp
按用户导入数据库:impdp 用户名/密码@链接 directory=xxx dumpfile=xxx.dmp schemas=用户(导出数据库用户)
导入新用户:加参数remap_schema=原用户:新用户
只导出表结构:加参数content=metadata_only

报错:
Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file “/NOAH/noah.dmp” for read
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9

解决:
授权:chmod -R 755 xxx目录

报错:
ORA-39112

解决:
添加参数
impdp xxx/xxx@172.0.0.1:1521/orcl directory=xxx dumpfile=ces.dmp remap_tablespace=tablespacename:tablespace_name schemas=cs transform=segment_attributes:n;

remap_tablespace=tablespacename:tablespace_new–原来的表空间:现在的表空间
transform=segment_attributes:n;–导入默认表空间

报错:
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name cs_1 is invalid
原因:没有为新用户赋予读写权限

解决:grant read,write on directory xxx to 用户

报错
ORA-31655: no data or metadata objects selected for job
ORA-39154: Objects from foreign schemas have been removed from import
原因:没有为新用户赋予导入数据权限
解决:grant imp_full_database to 用户

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值