eygle.com   eygle.com
eygle.com  
 

« 关于临时段(temporary segment)的管理 | Blog首页 | Eygle.com两周年庆 »

Oracle9i中如何重建与切换临时表空间

作者:eygle |【转载时请以超链接形式标明文章和作者信息及本声明
链接:

Oracle9i引入了全局缺省临时表空间,缺省的如果不指定用户临时表空间,Oracle会为用户指定这个缺省临时表空间.

首先查询用户的缺省临时表空间:

[oracle@jumper oracle]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Wed Apr 12 11:11:43 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> select username,temporary_tablespace from dba_users;

USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYS                                 TEMP2
SYSTEM                         TEMP2
OUTLN                           TEMP2
EYGLE                            TEMP2
CSMIG                            TEMP2
TEST                               TEMP2
REPADMIN                    TEMP2
......

13 rows selected.

SQL> select name from v$tempfile;

NAME
---------------------------------------------------------------------
/opt/oracle/oradata/conner/temp02.dbf
/opt/oracle/oradata/conner/temp03.dbf

重建新的临时表空间并进行切换:

SQL> create temporary tablespace temp tempfile '/opt/oracle/oradata/conner/temp1.dbf' size 10M;

Tablespace created.

SQL> alter tablespace temp add tempfile '/opt/oracle/oradata/conner/temp2.dbf' size 20M;

Tablespace altered.

SQL> alter database default temporary tablespace temp;

Database altered.

SQL> select username,temporary_tablespace from dba_users;

USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYS                                 TEMP
SYSTEM                         TEMP
OUTLN                           TEMP
EYGLE                            TEMP
CSMIG                           TEMP
TEST                               TEMP
REPADMIN                    TEMP
.......

13 rows selected.

如果原临时表空间无用户使用,我们可以删除该表空间:

SQL> drop tablespace temp2;

Tablespace dropped.

SQL>
SQL> select name from v$tempfile;

NAME
---------------------------------------------------------------
/opt/oracle/oradata/conner/temp1.dbf
/opt/oracle/oradata/conner/temp2.dbf

SQL> select file_name,tablespace_name,bytes/1024/1024 MB,autoextensible
  2  from dba_temp_files
  3  /

FILE_NAME                              TABLESPACE_NAME              MB AUTOEXTENSIBLE
-------------------------------------- -------------------- ---------- --------------
/opt/oracle/oradata/conner/temp2.dbf   TEMP                         20 NO
/opt/oracle/oradata/conner/temp1.dbf   TEMP                         10 NO

 


历史上的今天...
      >> 2009-04-12文章:
      >> 2008-04-12文章:
             聆听意大利爵士音乐演奏会
      >> 2007-04-12文章:
             《深入浅出Oracle》与10g XE
      >> 2005-04-12文章:
             更新了一下留言板程序
------
这篇 【Oracle9i中如何重建与切换临时表空间】来自 eygle.com | CSDN网摘| del.icio.us|Google订阅 | 鲜果订阅 | 抓虾订阅

By eygle on 2006-04-12 16:52 | Comments (3) | Posted to FAQ | Edit |

相关文章 随机文章
  • 10gR2使用RMAN恢复临时表空间的增强
  • 临时文件file#和db_files的关系
  • v$tempfile与v$sort_usage之关系解析
  • LOB对象与临时段
  • Sparse File And Oracle temporary tablespaces
  • 新生以及将生 等待以及期待
    NetAPP + Linux iSCSI配置step-by-step
    Oracle初学者入门指南-索引是干什么用的?
    谁与争锋-数据库管理工具OEM、I3的取舍
    Oracle9i安装make错误解决一例
    搜索本站:

    留言 (3)

    如何 让v$tempseg_usage和v$sort_usage产生记录,为什么建立索引的时候 会产生记录呢?

    Posted by: wangliang at August 26, 2009 5:27 PM

    使用到临时段(如发生排序操作等)才会在临时表空间分配相应的临时段空间啊。

    Posted by: eygle Author Profile Page at August 26, 2009 5:43 PM

    eygle 老大 ,我的意思是 建立索引的时候 是如何 进行 排序 操作的?

    Posted by: wangliang at August 27, 2009 8:55 AM

    发表留言:



    Remember Me?
    (输入验证码后方可评论,谢谢支持)



    CopyRight © 2004~2010 eygle.com, All rights reserved.