Chinaunix首页 | 论坛 | 博客
  • 博客访问: 238019
  • 博文数量: 59
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 592
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-01 12:51
个人简介

你们都是我的客户,所以,我对你们是透明的

文章分类

全部博文(59)

文章存档

2016年(29)

2015年(30)

分类: Oracle

2016-01-13 16:54:24

查看原来表空间

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME

------------------------------

SYSTEM

SYSAUX

USERS

ANTY

EPICARD

TEMP

UNDO

7 rows selected.

 

SQL>

 

 

查看临时表空间大小

SQL> select file_name,tablespace_name,bytes/1024/1024,autoextensible from dba_temp_files;

FILE_NAME                                TABLESPACE_NAME                BYTES/1024/1024 AUT

---------------------------------------- ------------------------------ --------------- ---

/oracle/oradata/orcl/temp01.dbf          TEMP                                        20 YES

 

 

新建一个临时表空间

SQL> create temporary tablespace temp2 tempfile '/oracle/oradata/orcl/temp2.dbf' size 20m autoextend on;

Tablespace created.

 

修改默认临时表空间

SQL> alter database default temporary tablespace temp2;

Database altered.

 

删除原来临时表空间

SQL> drop tablespace temp including contents and datafiles;

Tablespace dropped.

 

再次查看临时表空间

SQL> select file_name,tablespace_name,bytes/1024/1024,autoextensible from dba_temp_files;

FILE_NAME                                TABLESPACE_NAME                BYTES/1024/1024 AUT

---------------------------------------- ------------------------------ --------------- ---

/oracle/oradata/orcl/temp2.dbf           TEMP2                                       20 YES

SQL>

 

 

 

查看undo表空间大小

SQL> select file_name,tablespace_name,bytes/1024/1024,autoextensible from dba_datA_files where tablespace_name='UNDOTBS1';

FILE_NAME                                TABLESPACE_NAME                BYTES/1024/1024 AUT

---------------------------------------- ------------------------------ --------------- ---

/oracle/oradata/orcl/undotbs01.dbf       UNDOTBS1                                   170 YES

 

新建undo表空间

SQL> create undo tablespace undo2 datafile '/oracle/oradata/orcl/undo2.dbf' size 20m autoextend on;

Tablespace created.

 

修改undo表空间

SQL> alter system set undo_tablespace=undo2;

System altered.

 

删除原来undo表空间

SQL> drop  tablespace undotbs1 including contents;

Tablespace dropped.

 

 

查看一下

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME

------------------------------

SYSTEM

SYSAUX

USERS

ANTY

EPICARD

TEMP2

UNDO2

7 rows selected.

SQL>

阅读(1124) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~