嚣张研究站呀 · 2022年11月30日 0

oracle导入dmp文件

1,创建表空间:

create tablespace  cbm  datafile ‘C:\app\Administrator\admin\orcl\dpdump\cbm.dbf’ size 2G reuse autoextend on next 10m maxsize unlimited extent management local autoallocate permanent online;

2.创建用户

CREATE USER cbm_user

  IDENTIFIED BY password

  DEFAULT TABLESPACE cbm

  TEMPORARY TABLESPACE TEMP

  PROFILE DEFAULT

  ACCOUNT UNLOCK;

3.授权

GRANT UNLIMITED TABLESPACE TO cbm_user;

GRANT DBA TO cbm_user;

ALTER USER cbm_user DEFAULT ROLE ALL;

4.导入dmp文件

impdp cbm_user/password file=C:\app\Administrator\admin\orcl\dpdump\CBM2022.DMP log=impdp11.log full=y ignore=y;

impdp cbm_user/password file=CBM20220104.DMP log=impdp11.log full=y ignore=y;

查询及删除表空间及物理文件

先查询当下有多少表空间

select * from Dba_Tablespaces;

执行删除语句

drop tablespace CBM INCLUDING CONTENTS AND DATAFILES;

查询及删除Oracle 用户

先查询当下有多少用户

select * from dba_users;

执行删除语句

drop user CBM_USER cascade;