如何处理undo tablespace 表空间太大的问题


如何处理undo tablespace 表空间太大的问题
  (1)-- 创建一个新的小空间的undo tablespace
  create undo tablespace undotBS4 datafile 'C:\Oracle\oradata\dzq\eoffice\UNDOTBS4.DBF' size 500m;
  (2)-- 设置新的表空间为系统undo_tablespace
  alter system set undo_tablespace=undotBS4;
  (3)-- Drop 旧的表空间
  drop tablespace undotbs3 including contents;
 ==================================================================
 
-查看表空间明称
 
select name from v$tablespace;
 
- 检查数据库UNDO表空间占用空间情况以及数据文件存放位置
 
select file_name,bytes/1024/1024 from dba_data_files  where tablespace_name like 'UNDOTBS2';
 
-查看回滚段的使用情况,哪个用户正在使用回滚段的资源,如果有用户最好更换时间(特别是生产环境)
 
select s.username, u.name from v$transaction t,v$rollstat r, v$rollname u,v$session s where s.taddr=t.addr and t.xidusn=r.usn and r.usn=u.usn order by s.username;
 
-创建新的UNDO表空间,并设置自动扩展参数
 
create undo tablespace undotbs1 datafile '/oradata/oradata/ddptest/UNDOTBS1.dbf' size 1000m reuse autoextend on next 800m maxsize unlimited;
 
-查看每十分钟记录一次这段时间内使用的undo block数量
 select begin_time,end_time, undoblks from v$undosta
  • 1
  • 2
  • 3
  • 下一页

相关内容