Oracle重建临时表空间

[oracle@hd58 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 27 11:58:25 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@JOY:~>col PROPERTY_VALUE format a15
SYS@JOY:~>col DESCRIPTION format a37
SYS@JOY:~>select PROPERTY_VALUE,DESCRIPTION from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';

PROPERTY_VALUE  DESCRIPTION
--------------- -------------------------------------
TEMP            Name of default temporary tablespace

SYS@JOY:~>select username,temporary_tablespace from dba_users where rownum < 10;

USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW                      TEMP
SYS                            TEMP
SYSTEM                         TEMP
DBSNMP                         TEMP
SYSMAN                         TEMP
SCOTT                          TEMP
HR                             TEMP
OUTLN                          TEMP
FLOWS_FILES                    TEMP

9 rows selected.

SYS@JOY:~>select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/JOY/temp01.dbf

SYS@JOY:~>


当前默认temp tablespace是temp,对应数据文件是/opt/app/oracle/oradata/JOY/temp01.dbf 
创建新临时表空间并切换

SYS@JOY:~>create temporary tablespace temp02 tempfile '/opt/app/oracle/oradata/JOY/temp02.dbf' size 10m autoextend on next 2m maxsize unlimited;

Tablespace created.

SYS@JOY:~>alter tablespace temp02 add tempfile '/opt/app/oracle/oradata/JOY/temp02_01.dbf' size 10m autoextend on next 2m maxsize unlimited;

Tablespace altered.

SYS@JOY:~>alter database default temporary tablespace temp02;

Database altered.

SYS@JOY:~>select PROPERTY_VALUE,DESCRIPTION from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';

PROPERTY_VALUE  DESCRIPTION
--------------- -------------------------------------
TEMP02          Name of default temporary tablespace

SYS@JOY:~>drop tablespace temp including contents and datafiles;

Tablespace dropped.

SYS@JOY:~>select username,temporary_tablespace from dba_users where rownum < 10;

USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW                      TEMP02
SYS                            TEMP02
SYSTEM                         TEMP02
DBSNMP                         TEMP02
SYSMAN                         TEMP02
SCOTT                          TEMP02
HR                             TEMP02
OUTLN                          TEMP02
FLOWS_FILES                    TEMP02

9 rows selected.

SYS@JOY:~>select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/JOY/temp02.dbf
/opt/app/oracle/oradata/JOY/temp02_01.dbf

SYS@JOY:~>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值