oracle数据库使用数据泵导入导出

主要使用expdp,impdp两个命令

 

--导出数据

1.创建目录

create directory yzdump as 'd:/dump';

 

2.给用户授权目录(sys用户)

grant read,write on directory yzdump to yuzheng;

 

3.在命令行cmd窗口导出数据

expdp yuzheng/[email protected] directory=yzdump dumpfile=yuzheng20150310.dmp logfile=yuzheng20150310.log

 

--导入数据

1.给用户授权目录

grant read,write on directory yzdump to yz_mtcps;

 

2.在命令行cmd窗口导入数据

impdp yz_mtcps/[email protected] directory=yzdump dumpfile=yuzheng20150310.dmp logfile=yuzheng20150310_2.log remap_schema=yuzheng:yz_mtcps

 

 

导入数据脚本:

1.管理员账号sys登陆创建目录

create directory mtcpsdump as 'd:/dump';

 

2.给用户授权目录(我的用户是u_mtcps)

grant read,write on directory mtcpsdump to u_mtcps;

 

3.在命令行cmd窗口导入数据

impdp u_mtcps/[email protected] directory=mtcpsdump dumpfile=mtcps20150520.dmp logfile=mtcps20150520.log

 

11G往10G导入,导出

impdp u_mtcps/[email protected] directory=mtcpsdump dumpfile=mtcps10g20150520.dmp logfile=mtcps10g20150520.log version=10.2.0.1.0

 

expdp u_mtcps/[email protected] directory=mtcpsdump dumpfile=mtcps10g20150520.dmp logfile=mtcps10g20150520.log version=10.2.0.1.0

猜你喜欢

转载自yuwenlin.iteye.com/blog/2213736