改變資料庫undo表空間
Information in this document applies to any platform.
***Checked for relevance on 26-Feb-2009***
GOAL
This goal walks you through changing the default undo tablespace from UNDOTBS1 to another undo tablespace. At the end of the exercise, you will drop the existing undo tablespace and datafiles and be left with a new undo tablespace in place. This procedure requires shutting down the database.
This note was written because of a reoccurring problem with a fractured block (reported in v$backup_corruption) during RMAN backups.
FIX
Before doing any action, please perform. a Backup of the database, just in case something doesn't works we will have a point to go back.
1. Determine the size of the datafile(s) for your current undo tablespace "UNDOTBS1":
SQL> select bytes, name from v$datafile where name like '%UNDO%';
BYTES NAME
-------------- ----------------------------------------------------
314572800 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL2\UNDOTBS01.DBF
2. Create a new undo tablespace of the same size (larger or smaller) depending on your database requirements.
SQL> create undo tablespace UNDOTBS2 datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL2\UNDOTBS02.DBF' size 500M;
Tablespace created.
3. Edit your init.ora file and change the parameter "undo_tablespace=" so it points to the newly created tablespace. You may need to create a pfile first:
SQL> create pfile='d:\oracle\product\10.2.0\db_1\dbs\pfileorcl2.ora' from spfile='D:\ORACLE\PRODUCT\10.2.0\DB_1\DBS\SPFILEORCL2.ORA';
File created.
Change undo_tablespace=UNDOTBS2
Change undo_management=MANUAL
Setting undo_management now ensures the old rollback segments can be taken offline and avoids editing the pfile and restarting the instance again in Step 7.
4. Arrange a time when the database can be shutdown cleanly and perform. a shutdown immediate.
5. Startup the database (specify the pfile if you created one in step 3.)
SQL> startup pfile='d:\oracle\product\10.2.0\db_1\dbs\pfileorcl2.ora'
6. Confirm the new tablespace is in use:
SQL> show parameter undo_tablespace
NAME TYPE VALUE
------------- -------------- -----------------
undo_tablespace string UNDOTBS2
7. Check the status of the undo segments and determine if all the segments in the old undo tablespace are offline. The segments in the new tablespace may also show offline.
SQL>select owner, segment_name, tablespace_name, status from dba_rollback_segs order by 3;
OWNER SEGMENT_NAME TABLESPACE_NAME STATUS
------ --------------------------- ------------------------------ -----------
PUBLIC _SYSSMU3$ UNDOTBS1 OFFLINE
PUBLIC _SYSSMU2$ UNDOTBS1 OFFLINE
PUBLIC _SYSSMU19$ UNDOTBS2 OFFLINE
....etc.
If the old segments are online, then they must be taken offline:
SQL>alter rollback segment "_SYSSMU3$" offline;
SQL>alter rollback segment "_SYSSMU2$" offline;
This should be executed for all online rollback segments in the old tablespace.
8. Provided all the segments in the old undo tablespace are offline, you can now drop the old undo tablespace:
SQL>drop tablespace UNDOTBS1 including contents and datafiles;
Tablespace dropped.
9. Recreate your spfile with the new undo_tablespace value and change undo_management to AUTO:
undo_management='AUTO'
undo_tablespace='UNDOTBS2'
SQL> create spfile='d:\oracle\product\10.2.0\db_1\dbs\spfileorcl2.ora' from pfile='D:\ORACLE\PRODUCT\10.2.0\DB_1\DBS\PFILEORCL2.ORA';
File created.
10. Shutdown the database (shutdown immediate) and restart it with the spfile.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-768311/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- UNDO表空間損壞導致資料庫無法OPEN資料庫
- oracle undo 表空間Oracle
- 理解UNDO表空間
- 【UNDO】使用重建UNDO表空間方法解決UNDO表空間過大問題
- PostgreSQL:表空間-->資料庫-->表SQL資料庫
- oracle UNDO表空間一個bug——undo表空間快速擴充套件Oracle套件
- 自動undo表空間模式下切換新的undo表空間模式
- Oracle undo 表空間管理Oracle
- oracle重建UNDO表空間Oracle
- oracle undo表空間管理Oracle
- undo表空間總結
- UNDO表空間資料檔案丟失處理(二)正常關閉資料庫資料庫
- 使用中undo表空間資料檔案被誤刪
- 記一次undo表空間資料塊恢復
- 檢視資料庫表空間資料庫
- oracle清除資料庫表空間Oracle資料庫
- 刪除資料庫表空間資料庫
- MySQL InnoDB Undo表空間配置MySql
- undo表空間故障處理
- [oracle]undo表空間出錯,導致資料庫例項無法開啟Oracle資料庫
- 資料庫和表空間資料移動資料庫
- 資料庫物件遷移表空間資料庫物件
- undo表空間出現壞塊導致資料庫重啟問題解決資料庫
- 在資料庫之間移動表空間資料庫
- ORACLE線上切換undo表空間Oracle
- UNDO表空間不足解決方法
- Oracle undo表空間切換(ZT)Oracle
- Undo表空間與redo日誌
- oracle回滾段 undo 表空間Oracle
- ORACLE撤銷表空間(Undo Tablespaces)Oracle
- undo表空間中常用的操作
- 增加自動擴充套件臨時表空間及改變預設表空間套件
- [20170520]利用undo表空間保護資料.txt
- undo表空間佔用磁碟空間滿案例處理
- 檢視Oracle資料庫表空間大小,是否需要增加表空間的資料檔案Oracle資料庫
- undo表空間資源緊張的解決方案
- Oracle - 回滾表空間 Undo 的整理Oracle
- Oracle的UNDO表空間管理總結Oracle