ORA-01652: 无法通过 128 (在表空间 LTE_PM_TEMP 中) 扩展 temp 段

1、报错信息

ORA-01652: 无法通过 128 (在表空间 LTE_PM_TEMP 中) 扩展 temp 段
01652. 00000 - “unable to extend temp segment by %s in tablespace %s”
*Cause: Failed to allocate an extent of the required number of blocks for
a temporary segment in the tablespace indicated.
*Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more
files to the tablespace indicated.

2、原因

临时表空间满了

3、解决办法

3.1 添加临时表空间的数据文件

alter tablespace LTE_PM_TEMP add tempfile '+DATA/wxwy/tempfile/lte_pm_temp_20220315'  size 500m;

注意:临时表空间的数据文件用tempfile ,而不是datafile
3.2 重启数据库释放表空间

登录oracle用户,依次执行以下命令

sqlplus '/as sysdba'
shutdown immediate;
startup;
select 1 from dual;

4、拓展-与临时表空间相关的语句

--查询用户所使用的临时表空间:
select username,default_tablespace,temporary_tablespace from dba_users;

 
  --查询临时表空间大小以及使用率:
  select tablespace_name, bytes, user_bytes, user_bytes/bytes,file_name from dba_temp_files;
 
  --查询临时文件是否在线:
  select name,status from v$tempfile;
 
  --修改临时文件在线(离线)状态:
  alter database tempfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP02.DBF' online(offline);
 
  --增加临时文件大小(增加原文件):
  alter database tempfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF' resize 100m;
 
  --通过增加新的临时文件,来扩大临时表空间:
  alter tablespace temp add tempfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP02.DBF' size 4000m;
 
  --删除临时文件:
  alter database tempfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP02.DBF' drop;
 
  --将临时文件设置为自动扩展:
  alter database tempfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF' autoextend on next 5m maxsize unlimited;
 
  --关闭(启动)临时文件的自动增长:
   alter database tempfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF' autoextend off(on);
  • 0
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值