oracle数据dmp文件导入

  1. 首先需要知道dmp文件的表空间和用户名。(也可以根据出错提示得到:比如用户名为fitness,表空间为fitness_ts 

  2. 创建Oracle相关信息。

create user fitness IDENTIFIED by 12345678 --创建用户

create tablespace fitness_ts datafile 'd:\data.dbf'SIZE 500M;  --需要根据实际的数据大小,或可以设置表空间自增长

alter user fitness DEFAULT tablespace fitness_ts; --将表空间指定给用户

grant create session,create table,create sequence,create procedure,create trigger, unlimited tablespace to fitness;

说明:

grant create session to test;

--赋予create session的权限

grant create table,create view,create trigger, create sequence,create procedure to test;--分配创建表,视图,触发器,序列,过程 权限

grant unlimited tablespace to test; --授权使用表空间

    3.导入dmp数据到用户(full为导入整个文件,ignore为忽略创建错误

imp userid=fitness/12345678@orcl file='/home/smjq_lysj2/lysj.dmp' full=y ignore=y

注意:中间可能会报这个用户没有导入权限。需要添加以下语句

GRANT IMP_FULL_DATABASE to fitness;



猜你喜欢

转载自my.oschina.net/u/2330859/blog/655928