---
title: "表空间管理"
author: "elihe2011"
date: "2013-02-26T10:33:08Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2013-02-26T10:33:08Z"
id: 1815094
url: "https://elihe2011.iteye.com/blog/1815094"
---

```
--create tablespace
create tablespace test_db datafile '/oracle/ora11/oradata/db/test_db.dbf' size 500m;

--resize tablespace
alter database datafile '/oracle/ora11/oradata/db/test_db.dbf' resize 100m;

--modify auto-extend size of tablespace 
alter database datafile '/oracle/ora11/oradata/db/test_db.dbf' autoextend on next 20m;

--display tablespace info
select tablespace_name, file_name, sum(bytes)/1024/1024 table_size from dba_data_files group by tablespace_name, file_name;

--delete tablespace
drop tablespace test_db including contents and datafiles;
```