UNDOTBS表空间如何清理

blueant85 2009-12-22 04:12:43
oracel表空间undotabs表空间25000M被占用满了.
想对这个表空间做清理,请问怎么清理这个表空间.
...全文
1440 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
inthirties 2009-12-24
  • 打赏
  • 举报
回复
重做undo就可以。 可以在http://blog.csdn.net/inthirties找找。

不过最好是留意一下数据库,undo忽然的扩张,不是好现象
yuzhenhuan01 2009-12-23
  • 打赏
  • 举报
回复
自动的,等等就清了
wh62592855 2009-12-23
  • 打赏
  • 举报
回复
不需要清理

加大些
ruihuahan 2009-12-23
  • 打赏
  • 举报
回复
还是由系统来管理吧,太小会出快照过旧错误。
Dave 2009-12-23
  • 打赏
  • 举报
回复

参考我的blog:
Oracle undo 回滚段管理
http://blog.csdn.net/tianlesoftware/archive/2009/11/30/4901666.aspx




------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
网上资源: http://tianlesoftware.download.csdn.net
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
Q Q 群:62697716
hushboy 2009-12-23
  • 打赏
  • 举报
回复
这个东东会越用越大,服务一直在用,你就需要清理的。我处理过9i和10G的过程如下(也是参看了网友的贴子):建议做之前做好所有备份。
1)登陆到数据库

oracle@suse:~> sqlplus '/as sysdba'

SQL*Plus: Release 9.2.0.4.0 - Production on 星期五 9月 26 17:24:26 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

2)创建一个新的回滚段表空间

SQL> create undo tablespace undotbs2 datafile '/home/oracle/oradata/zxin/undotbs02.dbf' size 500M;

Tablespace created.

3)将回滚段指向新的表空间

SQL> alter system set undo_tablespace=undotbs2 scope=spfile;

System altered.

4)重新启动数据库

SQL> startup force
ORACLE instance started.

Total System Global Area 688985728 bytes
Fixed Size 452224 bytes
Variable Size 671088640 bytes
Database Buffers 16777216 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

5)因为oracle9i默认是自动管理回滚段,为了防止其像原来那样的无限制的增长,可以将其设置为人工管理:
SQL> alter system set undo_management =MANUAL scope=spfile;

System altered.

6)重新启动数据库:

SQL> startup force
ORACLE instance started.

Total System Global Area 688985728 bytes
Fixed Size 452224 bytes
Variable Size 671088640 bytes
Database Buffers 16777216 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

6)删除原来的回滚段:
SQL> drop tablespace undotbs1 including contents and datafiles;

Tablespace dropped.

7)退出

SQL> quit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production。
************************
select segment_name,bytes from user_segments where tablespace_name='COLLEGE_DATA' order by byte
truncate table
**************************

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧