Oracle临时表空间过大如何解决
发表于:2025-02-04 作者:千家信息网编辑
千家信息网最后更新 2025年02月04日,本篇内容主要讲解"Oracle临时表空间过大如何解决",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Oracle临时表空间过大如何解决"吧!方案一:增加临时
千家信息网最后更新 2025年02月04日Oracle临时表空间过大如何解决
本篇内容主要讲解"Oracle临时表空间过大如何解决",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Oracle临时表空间过大如何解决"吧!
方案一:增加临时表空间的大小
1.临时表空间的使用情况题
SELECT D.tablespace_name,SPACE "SUM_SPACE(M)",blocks "SUM_BLOCKS",used_space "USED_SPACE(M)",Round(Nvl(used_space, 0) / SPACE * 100, 2) "USED_RATE(%)",SPACE - used_space "FREE_SPACE(M)"FROM (SELECT tablespace_name,Round(SUM(bytes) / (1024 * 1024), 2) SPACE,SUM(blocks) BLOCKSFROM dba_temp_filesGROUP BY tablespace_name) D,(SELECT tablespace,Round(SUM(blocks * 8192) / (1024 * 1024), 2) USED_SPACEFROM v$sort_usageGROUP BY tablespace) FWHERE D.tablespace_name = F.tablespace(+)AND D.tablespace_name like 'TEMP%';
查看临时表空间的总大小和最大扩展大小(能看到数据文件)
select file_name,tablespace_name,bytes / 1024 / 1024 MB,autoextensible,maxbytes / 1024 / 1024 MAX_MBfrom dba_temp_files;
增加临时表空间的大小
alter tablespace temp1 add tempfile '/data/prod/proddata/temp013.dbf' size 4G;alter tablespace temp2 add tempfile '/data/prod/proddata/temp024.dbf' size 4G;
方案二:重建临时表空间,解决临时表空间过大的问题。
0.查看目前默认的临时表空间
select *from database_propertieswhere property_name = 'DEFAULT_TEMP_TABLESPACE';
1.创建中转临时表空间
create temporary tablespace temp3 tempfile '/data/prod/proddata/temp31.dbf' size 4G tablespace group temp;create temporary tablespace temp4 tempfile '/data/prod/proddata/temp41.dbf' size 4G tablespace group temp;
2.删除原临时表空间组中的临时表空间
2.1从默认临时表空间组temp中移除temp1和temp2;
ALTER TABLESPACE temp1 TABLESPACE GROUP '';ALTER TABLESPACE temp2 TABLESPACE GROUP '';
2.2删除临时表空间temp1和temp2
drop tablespace temp1 including contents and datafiles;drop tablespace temp2 including contents and datafiles;
2.3如果删除表空间的时候,hang住的话,可以使用下列语句,先把运行在temp临时表空间的sql语句kill掉,这样的sql语句多为排序的语句
Select se.username,se.sid,se.serial#,su.extents,su.blocks * to_number(rtrim(p.value)) as Space,tablespace,segtype,sql_textfrom v$sort_usage su, v$parameter p, v$session se, v$sql swhere p.name = 'db_block_size'and su.session_addr = se.saddrand s.hash_value = su.sqlhashand s.address = su.sqladdrorder by se.username, se.sid;
2.4 kill相关进程
alter system kill session '584,23181';alter system kill session '196,64972';alter system kill session '262,19832';alter system kill session '324,40273';alter system kill session '326,38967';alter system kill session '1266,54596';
or 重启DB 关闭应用>关闭监听>shutdown immediate startup>启动监听>执行以下操作后打开应用
2.5 创建临时表空间,并加入临时表空间组temp
create temporary tablespace temp1 tempfile '/data/prod/proddata/temp11.dbf' size 4G tablespace group temp;create temporary tablespace temp2 tempfile '/data/prod/proddata/temp21.dbf' size 4G tablespace group temp;
2.6 给临时表空间组temp的成员temp1,temp2,temp3,temp4 各增加一个成员。
alter tablespace temp1 add tempfile '/data/prod/proddata/temp12.dbf' size 4G;alter tablespace temp2 add tempfile '/data/prod/proddata/temp22.dbf' size 4G;alter tablespace temp3 add tempfile '/data/prod/proddata/temp32.dbf' size 4G;alter tablespace temp4 add tempfile '/data/prod/proddata/temp42.dbf' size 4G;
查看临时表空间组temp
select * from dba_tablespace_groups;
3 临时表空间组仍然使用99.98%
为每个临时表空间添加4G空间
alter tablespace temp1 add tempfile '/data/prod/proddata/temp13.dbf' size 4G;alter tablespace temp2 add tempfile '/data/prod/proddata/temp23.dbf' size 4G;alter tablespace temp3 add tempfile '/data/prod/proddata/temp33.dbf' size 4G;alter tablespace temp4 add tempfile '/data/prod/proddata/temp43.dbf' size 4G;
到此,相信大家对"Oracle临时表空间过大如何解决"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
空间
大小
语句
内容
成员
方案
学习
应用
监听
实用
更深
最大
兴趣
实用性
实际
情况
操作简单
数据
文件
方法
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
非网站 spu sku 数据库
交通银行软件开发中心社招
t6数据库异常
网络安全保险 限额
软件开发培训机构 找极客邦放心
国家网络安全宣传周亮点已整理
英雄联盟体验服显示服务器
计算机网络技术试卷大专
镇网络安全宣传周小结
开网络软件开发公司
服务器安全保护密码
腾讯云禁止服务器访问网络
地平线4 连接不上服务器
提高手机网络安全性
数据库 时区设置
火了网络安全手势舞高能来袭
登录服务器维护
软件开发如何选择电脑
河北省互联网加科技大赛
软件开发数据链接
软件开发需要掌握得技术
萌新长久服务器
软件开发收费标准国家标准
深圳蓝天互联网科技有限公司
xbox服务器用什么加速器
零信任概念与网络安全
中山一职计算机网络技术分数线
北京中搜云悦网络技术
没有be服务器
艾尔之光与服务器无响应