//删除表空间
DROP TABLESPACE SP_LUEYANG INCLUDING CONTENTS AND DATAFILES;
//删除用户名
drop user SP_LUEYANG cascade
//1.创建临时表空间
create temporary tablespace LUEYANG_temp
tempfile 'E:\sp_ora_data\LUEYANG_temp.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//2.创建数据表空间
create tablespace LUEYANG
logging
datafile 'E:\sp_ora_data\LUEYANG.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
/3./创建用户并指定表空间
create user SP_LUEYANG identified by SP_LUEYANG
default tablespace LUEYANG
temporary tablespace LUEYANG_temp;
//4.给用户授予权限
grant connect,resource,dba,EXP_FULL_DATABASE,IMP_FULL_DATABASE to SP_LUEYANG;
不同的方式备份的数据库会用不同的恢复方式
alter system set deferred_segment_creation=false
E:\sp_ora_data_bak\lueyang.dmp
imp SP_LUEYANG/SP_LUEYANG@192.168.1.9/orcl ignore=y full=y rows=y feedback=10000 file=E:\sp_ora_data_bak\lueyang.dmp
//在D:\app\Administrator\admin\orcl\dpdump 放入备份文件
impdp SP_LUEYANG/SP_LUEYANG@192.168.1.9/orcl ignore=y full=y rows=y feedback=10000 file=lueyang.dmp