Home > Database > Mysql Tutorial > body text

删除临时表空间ORA-25152错误

WBOY
Release: 2016-06-07 16:43:25
Original
1433 people have browsed it

删除Oracle临时表空间,或者收缩临时表空间经常会出现表空间占用等情况。 下面我们就对这种情况进行处理, 首先查找被锁的sid:

删除Oracle临时表空间,或者收缩临时表空间经常会出现表空间占用等情况。
 
下面我们就对这种情况进行处理,
 
首先查找被锁的sid:
 
SELECT a.INST_ID,b.TABLESPACE
 , b.segfile#
 , b.segblk#
 , ROUND ( ( ( b.blocks * p.VALUE ) / 1024 / 1024 ), 2 ) size_mb
 , a.SID
 , a.serial#
 , a.username
 , a.oSUSEr
 , a.program
 , a.status
 FROM gv$session a
 , gv$sort_usage b
 , gv$process c
 , gv$parameter p
 WHERE p.NAME = 'db_block_size'
 AND a.saddr = b.session_addr
 AND a.paddr = c.addr
 ORDER BY b.TABLESPACE
 , b.segfile#
 , b.segblk#
 , b.blocks;

通过查找就可以找到相关临时表空间的sid,,和serial#

然后同过ALTER system kill session ‘sid,serial#'删除。

下面就可以删除临时表空间或者收缩临时表空间。

下面介绍一种更为方便的方法

select 'alter system kill session '''||a.sid||','||a.serial#||''' immediate;'
 from
    v$session    a,
    v$sort_usage b,
    v$process    c,
    v$parameter  d
 where
    d.name = 'db_block_size'
 and
    a.saddr = b.session_addr
 and
    a.paddr = c.addr
 and
    b.tablespace='TEMP' -- 需要收缩或者删除的临时表空间名称
 order by
    b.tablespace,
    b.segfile#,
    b.segblk#,
    b.blocks;

可以批量的结束临时表空间的占用。

Oracle 11g 在RedHat Linux 5.8_x64平台的安装手册

Linux-6-64下安装Oracle 12C笔记

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

本文永久更新链接地址:

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!