教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> Oracle >> 性能优化 >> Oracle 9i新特性研究系列之一 -- 数据库默认临时表空间 RSS订阅
Oracle 9i新特性研究系列之一 -- 数据库默认临时表空间
教程(视频,书籍)下载:  ASP.NET AutoCAD 数据库 C# ASP java photoshop 网页设计 delphi 3dmax Flash C++ VB 张孝祥 实例   更多请进入BIBIDU搜索
IT搜索引擎   

   在9i之前,如果一个数据库用户没有被指定默认临时表空间,那么oracle就会使用system表空间作为该用户的临时表空间,这是很危险的。在9i里面,database可以被指定一个默认临时表空间。这样如果数据库用户没有被明确指定临时表空间,oracle 9i就会自动指定database的默认临时表空间作为该用户的临时表空间。
  
   我们可以通过下面的语句来查询数据库的默认临时表空间:
  
  SQL> select * from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
   
   默认临时表空间的限制:
  
  1. 默认临时表空间必须是TEMPORARY的:
  
  SQL> alter database default temporary tablespace tools;
  
  alter database default temporary tablespace tools
  
  *
  
  ERROR at line 1:
  
  ORA-12902: default temporary tablespace must be SYSTEM or of TEMPORARY type
  
   2. 默认临时表空间一旦被指定,将无法在改成PERMANET:
  
  SQL> alter tablespace temp2 permanent;
  
  alter tablespace temp2 permanent
  
  *
  
  ERROR at line 1:
  
  ORA-12904: default temporary tablespace cannot be altered to PERMANENT type
  
  3. 在删除默认临时表空间必须先重新指定默认临时表空间:
  
  SQL> drop tablespace temp including contents and datafiles;
  
  drop tablespace temp including contents and datafiles
  
  *
  
  ERROR at line 1:
  
  ORA-12906: cannot drop default temporary tablespace
  
  SQL> create tablespace TEMP2
  
   2 datafile '/data1/ora9data/temp2_01.dbf' 
  
   3 size 100k TEMPORARY;
  
  Tablespace created.
  
  SQL> alter database default temporary tablespace TEMP2;
  
  Database altered.
  
  SQL> drop tablespace temp including contents and datafiles;
  
  Tablespace dropped.
  
   4. 默认临时表空间无法OFFLINE:
  
  SQL> alter tablespace temp offline;
  
  alter tablespace temp offline
  
  *
  
  ERROR at line 1:
  
  ORA-12905: default temporary tablespace cannot be brought OFFLINE
  
   5. 用户的临时表空间必须是TEMPORARY的(在9i之前没有这个限制,可以是PERMANENT): 
  
  SQL> alter user scott temporary tablespace TOOLS;
  
  alter user scott temporary tablespace TOOLS
  
  *
  
  ERROR at line 1:
  
  ORA-12911: permanent tablespace cannot be temporary tablespace
  
  SQL> create tablespace temp2 
  
   2 datafile '/data1/ora9data/temp2_01.dbf' 
  
   3 size 100k temporary;
  
  Tablespace created.
  
  SQL> alter user scott temporary tablespace temp2;
  
  User altered.
  
   6. 如果删除了用户的临时表空间,而这个临时表空间又不是数据库的默认临时表空间(如果是数据库的默认临时表空间是删不掉的),用户的临时表空间不会自动转换到数据库的默认临时表空间上:
  
  SQL> select tablespace_name, contents from dba_tablespaces where tablespace_name like 'TEMP%';
  
  
  
  SQL> drop tablespace TEMP2 including contents and datafiles;
  
  Tablespace dropped.
  
  SQL> select TEMPORARY_TABLESPACE from dba_users where username='SCOTT';
  
  TEMPORARY_TABLESPACE
  
  ------------------------------
  
  TEMP2
  

来源:upschool.com.cn
作者:
关键字:Oracle
发表日期:2007-1-6 0:54:01

网页显示有限 阅读全文请下载本文完整版WORD文档

上一篇:DBMS_SQL包和游标计算用户下所有表的行   下一篇:Oracle 9i新特性研究系列之二 -- 轻松取得建表和索引的DDL语句


2008-12-4 8:29:26
本文的相类似文章
  • Oracle字符转换访问服务器漏洞
  • Oracle和mysql 的一些简单命令对比参照
  • oracle 的共享连接和专用连接方式之初探
  • Oracle的X$表系列介绍之-X$KSLLCLASS
  • Oracle数据导入导出imp/exp命令
  • 利用 Oracle 10g 技能学习 DB2 9.1
  • Oracle10g对回滚操作时间的准确评估
  • Oracle字符集子集与超级的对应关系
  • Oracle数据库密码破解易如反掌?
  • 针对Oracle数据库的优化器详细介绍
  • 在学习中进步 在进步中成长 教程中国相随您的成长之路
    华腾联合科技股份有限公司版权所有
    广告联系:Rosibo@163.com