临时表空间临时文件损坏的处理方法

临时表空间的临时文件损害,解决办法就是,增加一个新的临时文件,把老的给删除了就行。

ocp 053

699. Your database is using a default temporary tablespace that contains the temp01.tmp temporary file.

All the users on the database use the default temporary tablspace. A user issues a query on the ORDERS

table and receives the following error:

What would be the most efficient way to rectify this error?

A.Add a new tempfile to the user’s temporary tablespace and drop the tempfile  that produced the error.

B.Shut down the database instance, restore the temp01.tmp file from the backup, and then restart the database.

C.Allow the database to continue runn ing, drop the temp01.tmp temporary file, and then re-create it with new tempfiles.

D.Take the temporary tablespace offline, recover the missing tempfile by applying redo logs, and then bring the temporary tablespace online.

Answer: D

答案解析:

临时文件在删除后,数据库再次启动时会自动创建。

并且在数据库运行的过程中,使用rm删除,并不影响排序的查询。

我不会模拟出临时文件损坏的情况,但是,在临时文件损坏的情况下,可以增加一个临时文件,然后drop那个损坏的,就可以了。

另外A和C的区别就是先删除还是先增加?通过以下可知,当只有一个临时文件的时候,是不允许删除的。

故选A,此题答案有误。

[email protected]> ALTER TABLESPACE TEMP DROP TEMPFILE ‘/u01/app/oracle/oradata/test1107/temp01.dbf‘;

ALTER TABLESPACE TEMP DROP TEMPFILE ‘/u01/app/oracle/oradata/test1107/temp01.dbf‘

*

ERROR at line 1:

ORA-03261: the tablespace TEMP has only one file

临时表空间临时文件损坏的处理方法,布布扣,bubuko.com

时间: 2024-08-01 16:12:03

临时表空间临时文件损坏的处理方法的相关文章

临时表空间过大解决方法

解决临时表空间过大有两种方法,方法一增加临时表空间的大小,方法二重建临时表空间,解决临时表空间过大的问题. 方案一:增加临时表空间的大小--1.临时表空间的使用情况SELECT D.tablespace_name,        SPACE "SUM_SPACE(M)",              blocks "SUM_BLOCKS",             used_space "USED_SPACE(M)",              R

ORACLE临时表空间总结

临时表空间概念 临时表空间用来管理数据库排序操作以及用于存储临时表.中间排序结果等临时对象,当ORACLE里需要用到SORT的时候,并且当PGA中sort_area_size大小不够时,将会把数据放入临时表空间里进行排序.像数据库中一些操作: CREATE INDEX. ANALYZE.SELECT DISTINCT.ORDER BY.GROUP BY. UNION ALL. INTERSECT.MINUS.SORT-MERGE JOINS.HASH JOIN等都可能会用到临时表空间.当操作完成

oracle临时表空间

临时表空间概念临时表空间用来管理数据库排序操作以及用于存储临时表.中间排序结果等临时对象,当ORACLE里需要用到SORT的时候,并且当PGA中sort_area_size大小不够时,将会把数据放入临时表空间里进行排序.像数据库中一些操作: CREATE INDEX. ANALYZE.SELECT DISTINCT.ORDER BY.GROUP BY. UNION ALL. INTERSECT.MINUS.SORT-MERGE JOINS.HASH JOIN等都可能会用到临时表空间.当操作完成后

MySQL Innodb--共享临时表空间和临时文件

在MySQL 5.7版本中引入Online DDL特性和共享临时表空间特性,临时数据主要存放形式为: 1.DML命令执行过程中文件排序(file sore)操作生成的临时文件,存储目录由参数tmpdir控制,以MY开头2.超大事务提交生成binary log过程中用于数据缓存的临时文件,存储目录由参数tmpdir控制,以ML开头3.使用ROW_FORMAT=COMPRESSED创建的压缩InnoDB临时表,存储目录由参数tmpdir控制,以frm和idb结尾4.没用ROW_FORMAT=COMP

临时表空间

1.查看临时表空间 (dba_temp_files视图)(v_$tempfile视图) select tablespace_name,file_name,bytes/1024/1024 file_size,autoextensible from dba_temp_files; select status,enabled, name, bytes/1024/1024 file_size from v_$tempfile;--sys用户查看   2.缩小临时表空间大小 alter database

临时表空间作用

临时表空间主要用途是在数据库进行排序运算[如创建索引.order by及group by.distinct.union/intersect/minus/.sort-merge及join.analyze命令].管理索引[如创建索 引.IMP进行数据导入].访问视图等操作时提供临时的运算空间,当运算完成之后系统会自动清理. 当临时表空间不足时,表现为运算速度异常的慢,并且临时表空间迅速增长到最大空间(扩展的极限),并且一般不会自动清理了. 如果临时表空间没有设置为自动扩展,则临时表空间不够时事务执行

临时表空间的增删改查

1.查看临时表空间 (dba_temp_files视图)(v_$tempfile视图)select tablespace_name,file_name,bytes/1024/1024 file_size,autoextensible from dba_temp_files;select status,enabled, name, bytes/1024/1024 file_size from v_$tempfile;--sys用户查看 2.缩小临时表空间大小alter database tempf

oracle临时表空间 ORA-01652:无法通过16(在表空间XXX中)扩展 temp 字段

今天在查数据的时候报错  ORA-01652:无法通过16(在表空间temp1中)扩展 temp 字段 查看表空间使用明细 SELECT b.tablespace, b.segfile#, b.segblk#, b.blocks, b.blocks * 32 / 1024 / 1024, a.sid, a.serial#, a.username, a.osuser, a.status, c.sql_text, b.contents FROM v$session a, v$sort_usage b

【oracle11g,14】表空间管理3:临时表空间,表空间的脱机和只读,数据文件迁移,更改表空间数据文件的大小,表空间数据文件的迁移,使用非标准块的表空间,bigfile 表空间

一.临时表空间: 如果临时表空间不足会报ora-1652错误. 二.什么时候使用临时表空间: 排序和分组 索引create或rebuild order by 或group by distinct 操作 union或intersect或minus sort-merge joins analyze 用于排序.分组.索引等操作,在pga中的sort_area中排序,会将排序的中间结果存放到临时表空间中,如果想提高排序的效率可以提高sort_area_size参数值. 临时表空间不能存放持久化对象,推荐