Oracle undo表空間切換(ZT)
轉自:
Oracle的AUM(Auto Undo Management)從出生以來就經常出現只擴充套件,不收縮(shrink)的情況(通常我們可以設定足夠的UNDO表空間大小,然後取消其自動擴充套件屬性),在實際的環境中遇到undo表空間為斷上漲,報警簡訊不斷。
1.確認檔案
SQL> select file_name,bytes/1024/1024 from dba_data_files 2 where tablespace_name like 'UNDOTBS1'; FILE_NAME -------------------------------------------------------------------------------- BYTES/1024/1024 --------------- +ORADG/danaly/datafile/undotbs1.265.600173875 27810 |
2.檢查UNDO Segment狀態
SQL> select usn,xacts,rssize/1024/1024/1024,hwmsize/1024/1024/1024,shrinks 2 from v$rollstat order by rssize; USN XACTS RSSIZE/1024/1024/1024 HWMSIZE/1024/1024/1024 SHRINKS ---------- ---------- --------------------- ---------------------- ---------- 0 0 .000358582 .000358582 0 2 0 .071517944 .071517944 0 3 0 .13722229 .13722229 0 9 0 .236984253 .236984253 0 10 0 .625144958 .625144958 0 5 1 1.22946167 1.22946167 0 8 0 1.27175903 1.27175903 0 4 1 1.27895355 1.27895355 0 7 0 1.56770325 1.56770325 0 1 0 2.02474976 2.02474976 0 6 0 2.9671936 2.9671936 0 11 rows selected. |
3.建立新的UNDO表空間
SQL> create undo tablespace undotbs2; Tablespace created. |
4.切換UNDO表空間為新的UNDO表空間
SQL> alter system set undo_tablespace=undotbs2 scope=both; System altered. |
此處使用需要注意,以前曾經記錄過這樣一個案例:
5.等待原UNDO表空間所有UNDO SEGMENT OFFLINE
SQL> select usn,xacts,status,rssize/1024/1024/1024,hwmsize/1024/1024/1024,shrinks 2 from v$rollstat order by rssize; USN XACTS STATUS RSSIZE/1024/1024/1024 HWMSIZE/1024/1024/1024 SHRINKS ---------- ---------- --------------- --------------------- ---------------------- ---------- 14 0 ONLINE .000114441 .000114441 0 19 0 ONLINE .000114441 .000114441 0 11 0 ONLINE .000114441 .000114441 0 12 0 ONLINE .000114441 .000114441 0 13 0 ONLINE .000114441 .000114441 0 20 0 ONLINE .000114441 .000114441 0 15 1 ONLINE .000114441 .000114441 0 16 0 ONLINE .000114441 .000114441 0 17 0 ONLINE .000114441 .000114441 0 18 0 ONLINE .000114441 .000114441 0 0 0 ONLINE .000358582 .000358582 0 USN XACTS STATUS RSSIZE/1024/1024/1024 HWMSIZE/1024/1024/1024 SHRINKS ---------- ---------- --------------- --------------------- ---------------------- ---------- 6 0 PENDING OFFLINE 2.9671936 2.9671936 0 12 rows selected. |
再看:
11:32:11 SQL> / USN XACTS STATUS RSSIZE/1024/1024/1024 HWMSIZE/1024/1024/1024 SHRINKS ---------- ---------- --------------- --------------------- ---------------------- ---------- 15 1 ONLINE .000114441 .000114441 0 11 0 ONLINE .000114441 .000114441 0 12 0 ONLINE .000114441 .000114441 0 13 0 ONLINE .000114441 .000114441 0 14 0 ONLINE .000114441 .000114441 0 20 0 ONLINE .000114441 .000114441 0 16 0 ONLINE .000114441 .000114441 0 17 0 ONLINE .000114441 .000114441 0 18 0 ONLINE .000114441 .000114441 0 19 0 ONLINE .000114441 .000114441 0 0 0 ONLINE .000358582 .000358582 0 11 rows selected. Elapsed: 00:00:00.00 |
6.刪除原UNDO表空間
11:34:00 SQL> drop tablespace undotbs1 including contents; Tablespace dropped. Elapsed: 00:00:03.13 |
以下是自己實際操作;
-- 操作步驟
1.建立undo表空間
create undo tablespace undotbs2 datafile '/dev/vgdata01/rlv_ora_log11';
alter tablespace undotbs2 add datafile '/dev/vgdata01/rlv_ora_log12';
alter tablespace undotbs2 add datafile '/dev/vgdata01/rlv_ora_log13';
2.切換undo表空間
alter system set undo_tablespace=undotbs2 scope=both;
3.刪除原表空間
drop tablespace undotbs1 including contents;
4.原表空間及資料檔案:
/dev/vgdata01/rlv_ora_rbs01 UNDOTBS1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-704474/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE線上切換undo表空間Oracle
- Oracle切換undo表空間操作步驟Oracle
- 自動undo表空間模式下切換新的undo表空間模式
- Oracle Temp 表空間切換Oracle
- oracle undo 表空間Oracle
- Oracle undo 表空間管理Oracle
- oracle重建UNDO表空間Oracle
- oracle undo表空間管理Oracle
- oracle UNDO表空間一個bug——undo表空間快速擴充套件Oracle套件
- oracle回滾段 undo 表空間Oracle
- ORACLE撤銷表空間(Undo Tablespaces)Oracle
- 理解UNDO表空間
- Oracle - 回滾表空間 Undo 的整理Oracle
- Oracle的UNDO表空間管理總結Oracle
- Oracle undo 表空間使用情況分析Oracle
- 【UNDO】使用重建UNDO表空間方法解決UNDO表空間過大問題
- Oracle9i重建和切換臨時表空間Oracle
- Oracle基礎 03 回滾表空間 undoOracle
- Oracle undo表空間爆滿的解決Oracle
- undo表空間總結
- oracle 切換undo tablespace小結Oracle
- oracle 釋放undo空間Oracle
- oracle中undo表空間丟失處理方法Oracle
- Oracle undo表空間爆滿的處理方法Oracle
- 監控和管理Oracle UNDO表空間的使用Oracle
- Oracle 釋放過度使用的Undo表空間Oracle
- MySQL InnoDB Undo表空間配置MySql
- undo表空間故障處理
- Oracle 19c 線上縮減 UNDO 表空間 容量Oracle
- ORACLE 中undo表空間爆滿的解決方法Oracle
- [Oracle 10g] 大檔案表空間(zt)Oracle 10g
- Oracle9i中的臨時表空間的重建和切換Oracle
- UNDO表空間不足解決方法
- Undo表空間與redo日誌
- undo表空間中常用的操作
- 認識 SYSAUX 表空間(zt)UX
- 【UNDO】Oracle undo表空間使用率過高,因為一個查詢Oracle
- undo表空間佔用磁碟空間滿案例處理