---
title: "模拟升级中oracle导出没数据的表结构再导入"
author: "fruitking"
date: "2011-11-17T22:31:06Z"
tags: ["Oracle"]
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2011-11-17T22:31:06Z"
id: 1264913
url: "https://fruitking.iteye.com/blog/1264913"
---

创建表空间
create tablespace hemsback_dat DATAFILE 'D:/oracle/oradata/hemsback_dat.dbf' SIZE 300M AUTOEXTEND ON NEXT 10M;
创建用户
create  user hchemsback identified by hchemsback default tablespace hemsback_dat;
grant connect to hchemsback;
grant resource to hchemsback;
revoke unlimited tablespace from hchemsback;
alter user hchemsback quota unlimited on hemsback_dat;//防止用户在其他表空间随意建表 

导出某个用户下所有表（不包含数据）
exp hems/hems file='D:/oracle/oradata/hemsback_20111117.dmp' owner=hems rows=N;

导入原某个用户下所有表
imp hchemsback/hchemsback file=D:/oracle/oradata/hemsback_20111117.dmp full=Y;

删除用户
drop user hchemsback cascade;

删除表空间（完整）
DROP TABLESPACE hemsback_dat INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;