首页 技术 正文
技术 2022年11月20日
0 收藏 503 点赞 5,068 浏览 1413 个字

Oracle 11g以后,临时表空间文件是可以在重启数据库以后自动生成的(当然也可以在相同目录再建一个临时表空间文件),模拟实验如下:
1)删除临时表空间数据文件

SYS@ENMOEDU> select file_name from dba_temp_files;FILE_NAME
------------------------------------------------------
/u01/app/oracle/oradata/ENMOEDU/temp01.dbfSYS@ENMOEDU> !rm /u01/app/oracle/oradata/ENMOEDU/temp01.dbfSYS@ENMOEDU> !ls /u01/app/oracle/oradata/ENMOEDU/temp01.dbf
ls: /u01/app/oracle/oradata/ENMOEDU/temp01.dbf: No such file or directory

2)创建大表,并进行排序
由于PGA空间有限,所以使用临时表空间进行排序,由于缺少临时表空间文件,故会报错:

SYS@ENMOEDU> create table bigtab as select * from dba_objects;Table created.SYS@ENMOEDU> insert into bigtab select * from bigtab;87213 rows created.SYS@ENMOEDU> /
174426 rows created.SYS@ENMOEDU> /348852 rows created.SYS@ENMOEDU> commit;Commit complete.SYS@ENMOEDU> select * from bigtab order by 1,2,3,4,5,6,7,8,9,10;
select * from bigtab order by 1,2,3,4,5,6,7,8,9,10
*
ERROR at line 1:
ORA-01116: error in opening database file 201
ORA-01110: data file 201: '/u01/app/oracle/oradata/ENMOEDU/temp01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

3)重启数据库,数据库会自动重建临时数据文件

SYS@ENMOEDU> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@ENMOEDU> startup
ORACLE instance started.Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 507513936 bytes
Database Buffers 318767104 bytes
Redo Buffers 6565888 bytes
Database mounted.
Database opened.
SYS@ENMOEDU> !ls/u01/app/oracle/oradata/ENMOEDU/temp01.dbf
/u01/app/oracle/oradata/ENMOEDU/temp01.dbf
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,084
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,559
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,408
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,181
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,818
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,901