cmd-》sqlplus
登陆用户名:conn as sysdba
口令:无
创建临时表空间
create temporary tablespace btc_fuhua_temp
tempfile 'E:\oradata\btc_fuhua_temp.dbf'
size 32m
autoextend on
next 32m
extent management local;
创建表空间
create tablespace btc_fuhua
logging
datafile 'E:\oradata\btc_fuhua.dbf'
size 32m
autoextend on
next 32m
extent management local;
删除表空间
DROP TABLESPACE btc_fuhua INCLUDING CONTENTS AND DATAFILES;
创建用户
create user btc_fuhua identified by "123"
default tablespace btc_fuhua
temporary tablespace btc_fuhua_temp;
删除用户
drop user user_name cascade;
授权
grant connect,resource,dba to btc_fuhua;
exit
创建存储文件夹
create or replace directory DATA_PUMP_DIR as 'D:\dump';
grant read,write on directory DATA_PUMP_DIR to btc_fuhua;
oracel默认的dump目录位置$ORACLE_BAS/admin/$SID/dpdump
不创建存储文件夹时默认在该位置;
备份
expdp btc_fuhua/123@orcl schemas=btc_fuhua
directory=DATA_PUMP_DIR dumpfile=fuhua0221.dmp
还原
impdp btc_fuhua/123 remap_schema=btc_fuhua:btc_fuhua remap_tablespace=btc_fuhua:btc_fuhua directory=DATA_PUMP_DIR dumpfile=btc_fuhua1223_11.dmp
Oracle数据库备份与还原
最新推荐文章于 2024-05-15 20:30:52 发布