Oracle导入导出——windows命令行形式

一、从开发环境导出到本地D盘

运行windows命令行窗口然后输入一下代码。file是文件绝对路径,扩展名为.DMP

exp [数据库账号]\[数据库密码]@[ip]/[数据库名] file="[文件路径]\文件名.DMP" 

exp xmglxt_x3/xmglxt_x3@172.16.8.139:1521/orcl file="d:20171102xmglxt_backup.DMP"

二、创建表空间

导入到本地数据库之前需要先创建跟开发环境一样名称的表空间,用哪个用户导入就用哪个用户创建表空间

create tablespace stbss 
datafile 'F:\app\xmglxt_JXD7_PM_FILE.dbf' 
size 100m 
autoextend on next 32m maxsize 2048m

三、从D盘导入到本地数据库

imp [数据库账号]\[数据库密码]@[ip]/[数据库名] file="[文件路径]\文件名.DMP" fromuser=[开发环境的数据库用户名]  touser=[本地的数据库用户名] commit=yes ignore=yes

imp XMGLXT_X3/xmglxt_x3@localhost/orcl file="d:20171102xmglxt_backup.DMP" fromuser=xmglxt_x3 touser=XMGLXT_X3 commit=yes ignore=yes

 四、其他(创建表空间和用户并分配权限)

           表空间名字           表空间文件路径
create
tablespace news_tablespace datafile 'D:\oracle\product\10.2.0\oradata\test\xmglxt_x3.dbf' size 2048M
       用户名            密码
create user xmglxt_x3 identified by xmglxt_x3 default tablespace news_tablespace
                用户名
grant connect,resource to xmglxt_x3
        用户名
grant dba to xmglxt_x3

 

posted @ 2017-11-02 20:49  迷神图卷  阅读(1023)  评论(0编辑  收藏  举报