---
title: "Oracle新建表空间及用户命令"
author: "ssqmeng"
date: "2009-01-21T15:39:00Z"
tags: []
slug: "oracle"
draft: false
lastmod: "2009-01-21T15:39:00Z"
id: 319699
url: "https://ssqmeng.iteye.com/blog/319699"
---

我们部署一个项目的开发环境的时候，往往要为该项目建一个数据库。

一般在oracle是分配用户及表空间，可以用下面语句快速的创建用户及表空间

```
sqlplus /nolog
connect system/admin@ORCL as sysdba;
drop tablespace cls including contents;
create tablespace cls datafile 'D:\oracle\product\10.2.0\oradata\ORCL\cls.ora' size 100m reuse
       autoextend on maxsize unlimited
       default storage(initial 320k
               next 320k
               minextents 1
               maxextents unlimited
               pctincrease 0);              
create user cls identified by clsdba
 default tablespace cls
 temporary tablespace temp;
grant dba to cls;
```

 

其中cls为新建表空间

D:\\oracle\\product\\10.2.0\\oradata\\ORCL\\cls.ora为你安装的路径

用户名cls/clsdba