重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2328|回复: 0
打印 上一主题 下一主题

[Oracle] 使用数据泵导入覆盖原数据需要删除用户

[复制链接]
跳转到指定楼层
楼主
发表于 2021-1-8 18:21:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在向已经存在数据的库中导入新的数据
impdp \' / as sysdba \' directory=imp_dir dumpfile=full.dmp full=y log=full.log
导入后存在大量非跳过报错,数据也存在差异,说明数据导入失败
正确步骤应该是在导入之前先删除用户,只保留系统本身的用户
在删除用户时一定要排开系统本身的用户


这是我所使用的语句:
SQL> select 'drop user'||' '||username||' cascade;' from dba_users where user_id<>73 and user_id<>0 and user_id<>5 and user_id<>30 and user_id<>71 and user_id<>9 and user_id<>74 and user_id<>57 and user_id<>53 and user_id<>42 and user_id<>32 and user_id<>31 and user_id<>77 and user_id<>79 and user_id<>54 and user_id<>43 and user_id<>46 and user_id<>45 and user_id<>55 and user_id<>78 and user_id<>56 and user_id<>60 and user_id<>83 and user_id<>21 and user_id<>2147483638 and user_id<>89 and user_id<>88 and user_id<>64 and user_id<>14 and user_id<>75 and user_id<>69 and user_id<>66;
自带用户参考数据库版本


在删除用户后重新导入,经过验证数据导入成功
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-20 15:13 , Processed in 0.077113 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表