win7下Oracle库imp导入dmp

第一步:创建备份文件存储目录

create or replace directory back_file as 'F:\APP\ADMINISTRATOR\ORADATA\ORCL';

create or replace directory back_file as 'D:\app\yangxf\back_or_memery_file';

create or replace directory 目录名 as 'D:\app\yangxf\back_or_memery_file';

第二步:创建表空间

create tablespace WX_DATA datafile 'F:\APP\ADMINISTRATOR\ORADATA\ORCL\wx.dbf' size 1000M autoextend on next 50m;

create tablespace BASE_DATA datafile 'D:\app\yangxf\oradata\base_tablespace\BASE.dbf' size 100M autoextend on next 50m;

create tablespace 表空间名(与备份文件表空间一致) datafile 'D:\app\yangxf\oradata\base_tablespace\备份文件名.dbf' size 100M autoextend on next 50m;

第三步:创建备份文件用户,指定表空间

 

create user wxsi identified by  wxsi123 default tablespace WX_DATA;

create user BASE identified by BASE default tablespace BASE_DATA;

create user 用户名 identified by 密码 default tablespace 表空间名;

第四步:授权用户读写备份文件目录

grant read, write on directory back_file to wxsi;

grant read, write on directory back_file to BASE;

grant read, write on directory 存储目录名 to 用户名;

第五步:授权用户连接、资源、登录、dba权限

grant connect,resource,dba to wxsi;

grant connect,resource,dba to BASE;

第六步:执行导入语句

这里只能用 wxsi/wxsi@orcl  不能as sysdba

impdp system/root@orcl directory=back_file dumpfile=BASE.DMP full=y;

impdp 用户名/密码@实例名 directory=目录名 dumpfile=到导入的文件名.DMP full=y;

 

备注:

删除用户下所有对象

drop user JCSJ cascade;

drop user 用户名 cascade;

删除表空间

drop tablespace JCSJ_DATA including contents and datafiles;

drop tablespace 表空间名 including contents and datafiles;

超级管理员登录

sqlplus sys/root@orcl as sysdba;

sqlplus 用户名/密码@实例名 as sysdba;

 

以下为我的实例:导入的dmp用户为wxsi ,表空间名为:wx_data,这个用notpad++,和winhex  可查出

第一步:创建备份文件存储目录

create or replace directory back_file as 'F:\APP\ADMINISTRATOR\ORADATA\ORCL';//实际上没用到

第二步:创建表空间

create tablespace WX_DATA datafile 'F:\APP\ADMINISTRATOR\ORADATA\ORCL\wx.dbf' size 1000M autoextend on next 50m;

第三步:创建备份文件用户,指定表空间

create user wxsi identified by  wxsi123 default tablespace WX_DATA;

第四步:授权用户读写备份文件目录

grant read, write on directory back_file to wxsi;

第五步:授权用户连接、资源、登录、dba权限

grant connect,resource,dba to wxsi;

第六步:执行导入语句

我是经过PLSQL Developer  软件中的imp功能转入的

但是这里只能用 wxsi/wxsi@orcl  connect as normal不能sysdba

 

 

 

 

 

posted on 2019-06-02 21:47  为人民服务  阅读(457)  评论(0编辑  收藏  举报