【转】Undo Tablespace 切换注意事项
来源:互联网 发布:淘宝老司机搜索关键词 编辑:程序博客网 时间:2024/05/06 03:51
转来的,原贴地址: http://blog.csdn.net/lwei_998/article/details/6537066#
oracle中经常遇到undo表空间不释放,如果设置了unod表空间自动扩展AUTOEXTEND ON则还有可能把磁盘撑爆。当undo被撑满了,经常会选择重建undo表空间,进行切换。虽然切换undo比较容易,但如果要在生产切换undo还是考虑的周到一些比较好。
注意事项:
1. 检查系统使用的参数文件是pfile还是spfile。
如果用pfile记得修改pfile中的undo_tablespace参数。否则容易导致下次重启数据库时找不到历史的undo表空间而启动失败。
select name , value from v$parameter where name='spfile';
2. 切换undo时检查是否还有事务存在。如果有事务,在删除旧undo时可能会遇到ORA-30013的错误。
select count(*) from v$transaction;
3. 检查undo对应的数据文件是否被真正删除。
摘自:How to Shrink the datafile of Undo Tablespace [ID 268870.1]
NOTE: Dropping the old tablespace may give ORA-30013 : undo tablespace '%s' is currently in use. This error indicates you must wait for the undo tablespace to become unavailable. In other words, you must wait for existing transaction to commit or rollback. Also be aware that on some platforms, disk space is not freed to the OS until the database is restarted. The disk space will remain "allocated" from the OS perspective until the database restart.
4. 虽然可以在线切换undo,但切换后如果能重启一下最好。以免留下后患。或者选择在可以重启的时候去切换undo。
切换undo的步骤:
一、检查undo设置
SQL> show parameter undo
二、查看undo表空间的大小
SELECT D.TABLESPACE_NAME,D.FILE_NAME, SUM(D.BYTES) / 1024 / 1024 MB
FROM DBA_DATA_FILES D
WHERE D.TABLESPACE_NAME LIKE 'UNDO%'
GROUP BY D.TABLESPACE_NAME,D.FILE_NAME;
三、检查参数文件类型
select name , value from v$parameter where name='spfile';
四、创建undo表空间
SQL> create undo tablespace UNDOTBS2 datafile 'D:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL2/UNDOTBS02.DBF' size 500M;
五、等待原undo表空间UNDO SEGMENT OFFLINE后可以切换undo
SQL> SELECT USN,
2 XACTS,
3 STATUS,
4 RSSIZE / 1024 / 1024 / 1024 RSSIZE,
5 HWMSIZE / 1024 / 1024 / 1024 HWMSIZE,
6 SHRINKS
7 FROM V$ROLLSTAT
8 ORDER BY RSSIZE;
六、切换UNDO表空间
SQL>alter system set undo_tablespace=undotbs2 scope=both;
七、删除UNDO表空间及数据文件
SQL>drop tablespace UNDOTBS1 including contents and datafiles;
Metalink中记录了一种切换undo比较稳妥的方法,可以参考一下:
How to Change the Existing Undo Tablespace to a New Undo Tablespace [ID 431652.1]
- 【转】Undo Tablespace 切换注意事项
- Undo Tablespace 切换注意事项
- 转一篇关于undo tablespace切换的文章
- UNDO Tablespace
- undo tablespace
- UNDO TABLESPACE
- Sizing an UNDO tablespace
- undo tablespace介绍
- undo tablespace介绍
- Managing the Undo Tablespace
- Tuning Undo Tablespace
- 管理undo tablespace
- undo tablespace management
- UNDO TABLESPACE 大小设置
- Oracle UNDO tablespace
- UNDO TABLESPACE切换后,旧的长时间没有完全OFFLINE,案列:
- Undo TableSpace ②.回滚段研究
- Undo TableSpace ①.管理方法
- spring mail中附件名乱码问题
- C应用程序增加调试便利的方法,程序运行过程中输出运行的源文件名称 函数名称和当前行号
- VS2008中项目连接字符串问题_C#
- DIV 滚动条
- 入门视频采集与处理(BT656简介)
- 【转】Undo Tablespace 切换注意事项
- WPF鼠标事件简介
- NEON编码 - 第4部分: 左右移位
- PHP 守护进程类
- 入门视频采集与处理(学会分析YUV数据)
- ArcGIS For JavaScript API Locate points of interest(找到景点)————(十九)
- JVM基础知识
- 在 Linux 系统中安装Load Generator ,并在windows 调用
- 入门视频采集与处理(显示YUV数据)