网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.学在oracle数据库中插入特殊符号.
.Oracle基本数据类型存储格式浅析.
.自动备份Oracle数据库.
.ORACLE FOR SUN SOLARIS 维护手册.
.数据文件internal的内部结构分析.
.在RedHat 7.x 上实现reiserfs & .
.两个有用的oracle数据库运算:in.
.基于 Linux 和 MiniGUI 的嵌入式.
.讲解linux环境下Oracle的自动启动.
.深入讲解调整Oracle SGA大小的解.
.利用errorstack event解决问题.
.Oracle9i 数据库的设计指引全集(.
.Oracle服务器参数文件spfile的使.
.Oracle冷备份的不完全恢复(二).
.Oracle 9i新特性研究一(数据库默.
.如何在Windows 2000环境中Kill掉.
.Oracle性能究极优化 中.
.oracle中实现主键的自动增加.
.ext3格式下的quota的实现.
.随身携带的数据库.

Oracle 9i新特性研究系列之一 -- 数据库默认临时表空间

发表日期:2008-2-9



   在9i之前,假如一个数据库用户没有被指定默认临时表空间,那么Oracle就会使用system表空间作为该用户的临时表空间,这是很危险的。在9i里面,database可以被指定一个默认临时表空间。这样假如数据库用户没有被明确指定临时表空间,oracle 9i就会自动指定database的默认临时表空间作为该用户的临时表空间。
  
   我们可以通过下面的语句来查询数据库的默认临时表空间:
  
  SQL> select * from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
   Oracle 9i新特性研究系列之一 -- 数据库默认临时表空间(图一)
   默认临时表空间的限制:
  
  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%';
  Oracle 9i新特性研究系列之一 -- 数据库默认临时表空间(图二)
  
  
  SQL> drop tablespace TEMP2 including contents and datafiles;

  
  Tablespace dropped.
  
  SQL> select TEMPORARY_TABLESPACE from dba_users where username='SCOTT';
  
  TEMPORARY_TABLESPACE
  
  ------------------------------
  
  TEMP2
上一篇:监控数据库性能的常用的SQL 人气:482
下一篇:用Oracle9i保护你的电子商务 人气:526
浏览全部Oracle教程的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐