首先须要知道dmp文件的表空间和用户名。(也能够根据出错提示获得:好比用户名为fitness,表空间为fitness_ts )session
建立Oracle相关信息。spa
create user fitness IDENTIFIED by 12345678 --建立用户code
create tablespace fitness_ts datafile 'd:\data.dbf'SIZE 500M; --须要根据实际的数据大小,或能够设置表空间自增加it
alter user fitness DEFAULT tablespace fitness_ts; --将表空间指定给用户io
grant create session,create table,create sequence,create procedure,create trigger, unlimited tablespace to fitness;table
说明:test
grant create session to test;file
--赋予create session的权限权限
grant create table,create view,create trigger, create sequence,create procedure to test;--分配建立表,视图,触发器,序列,过程 权限im
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;