oracle 导入导出

新建表空间
create tablespace whfxt datafile 'D:\whfxt.ora' size 500m;

create user whfxt identified by whfxt default tablespace whfxt quota 200m on users;

grant all privileges to whfxt;


imp username/password@SID file=XXX.dmp full=y


grant dba to cms ;

 

 

创建表空间
create tablespace std
datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf'
size 1500M
autoextend on next 50M maxsize 3000M;


create user demo identified by demo default tablespace std;

grant all privileges to whfxt;
grant dba to cms ;


删除用户和表空间
drop user ×× cascade

DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES;

 

导出表

EXP SONIC/SONIC BUFFER=64000 FILE=C:\SONIC.DMP OWNER=SONIC

导出空表需要加一步
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0


导入表


imp username/password@SID file=XXX.dmp ignore=y statistics=none buffer=1000000000 fromuser=导出用户 touser=导入用户

posted @ 2017-07-28 09:24  11cnblogs  阅读(118)  评论(0编辑  收藏  举报