oracle数据库数据迁移

本文介绍了一种使用 Oracle 的 expdp 和 impdp 工具按用户进行数据迁移的方法,包括从生产环境导出数据、在 UAT 环境中删除并重新创建用户,以及将数据导入到新的用户环境中。此外,还提供了创建表空间的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

两种方式:按用户,按表结构。

方式一:按用户

导入当前数据库信息
1、导出数据---生产环境
exp imaging/imaging@10.124.84.25/img owner=imaging file=d:/imaging.dmp
exp sunimage/sunimage@10.124.84.25/img owner=sunimage file=d:/sunimage.dmp
exp sunflow/sunflow@10.124.84.25/img owner=sunflow file=d:/sunflow.dmp
2、删除用户---UAT环境
drop user imaging CASCADE;
drop user sunimage CASCADE;
drop user sunflow CASCADE;
3、创建用户---UAT环境
create user imaging identified by edmuat;
grant dba to imaging with admin option;
create user sunimage identified by edmuat;
grant dba to sunimage with admin option;
create user sunflow identified by sunflow;
grant dba to sunflow with admin option;
4、导入数据---UAT环境
imp imaging/imaging@10.124.84.91/img fromuser=imaging file=d:/imaging.dmp
imp sunimage/sunimage@10.124.84.91/img fromuser=sunimage file=d:/sunimage.dmp
imp sunflow/sunflow@10.124.84.91/img fromuser=sunflow file=d:/sunflow.dmp

补充:创建表空间
CREATE  TABLESPACE imaging LOGGING DATAFILE  'C:\oracle\product\10.2.0\oradata\orcl\imaging_DATA01.DBF'  
   SIZE 500M AUTOEXTEND  ON  NEXT  32M MAXSIZE 5000M EXTENT MANAGEMENT LOCAL;

CREATE   USER  sunflow IDENTIFIED  BY  sunflow DEFAULT  TABLESPACE imaging;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值