ORA-25152: TEMPFILE cannot be dropped at this time问题解决
2017-03-12 16:28
666 查看
删除过程:
SQL> alter database tempfile '/u01/app/oracle/oradata/temp2' drop including datafiles; alter database tempfile '/u01/app/oracle/oradata/temp2' drop including datafiles * ERROR at line 1: ORA-25152: TEMPFILE cannot be dropped at this time
通过查看官方针对ORA-25152的描述信息,发现如下:
ORA-25152: TEMPFILE cannot be dropped at this time Cause: An attempt was made to drop a TEMPFILE being used by online users Action: The TEMPFILE has been taken offline. Try again, later
可能是临时表空间被占用,执行以下脚本,查询出占用临时表空间的会话信息,使用alter system kill命令杀掉会话进程,即可解决问题,脚本如下:
SELECT s.sid, s.username, s.status, u.tablespace, u.segfile#, u.contents, u.extents, u.blocks FROM v$session s, v$sort_usage u WHERE s.saddr = u.session_addr ORDER BY u.tablespace, u.segfile#, u.segblk#, u.blocks;
查看具体会话,构造alter system kill语句
select s."SID", s."SADDR", s."SERIAL#" from v$session s where s."SID" = '15'; 杀掉会话进程的语句需要传递参数,会话ID和"SERIAL#"的值 alter system kill session '15,43';
可以正常的执行删除临时表空间文件的命令
或者可以通过如下的脚本,构造批量删除杀掉会话的语句:
select 'alter system kill session ''' || a.sid || ',' || a.serial# || ''' immediate;' from v$session a, v$sort_usage b, v$parameter d where a.saddr = b.session_addr and b.tablespace = 'TEMP' order by b.tablespace, b.segfile#, b.segblk#, b.blocks;
相关文章推荐
- ORA-00376:file x cannot be read at this time
- ORA-00376:file x cannot be read at this time
- ORA-00376: file 202 cannot be read at this time ORA-01110: data file 202故障处理
- ORA-00376:file xx cannot be read at this time
- 解决MySQL导入文件问题(The selected file was generated by mysqldump and cannot be restored by this applicati)
- 解决SHSQ.dll This required file cannot be loaded. Please re-install Microsoft Visual C++ 问题
- 解决java web项目出现的有关问题 -cannot be read or is not a valid ZIP file
- 解决错误 This file requires _WIN32_WINNT to be #defined at least to 0x0403. ..
- 解决使用maven的java web项目导入后出现的有关问题 -cannot be read or is not a valid ZIP file
- Objects in this class cannot be updated outside an edit session问题解决方案(ArcEngine编辑)
- 解决java web项目导入后出现的问题 ---cannot be read or is not a valid ZIP file
- 解决xx is not in the sudoers file. This incident will be reported.问题
- 解决java web项目导入后出现的有关问题 -cannot be read or is not a valid ZIP file
- 解决ORA-02069: global_names parameter must be set to TRUE for this operation 问题
- 解决"the database principal owns a schema in the database and cannot be dropped"问题
- 如何解决打开xcode项目是遇到的“cannot be opened because the project file cannot be parsed.”问题?
- This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0错误解决办法
- 解决VC中编译出现”SHSQ.dll This required file cannot be loaded. Please re-install Microsoft Visual C++“方法之一
- 解决java web项目导入后出现的有关问题 -cannot be read or is not a valid ZIP file
- 解决java web项目导入后出现的问题 ---cannot be read or is not a valid ZIP file