改變資料庫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表空間容量
- Innodb:Undo 表空間巨大
- 更改undo表空間大小
- UNDO表空間空間回收及切換
- PostgreSQL:表空間-->資料庫-->表SQL資料庫
- MySQL InnoDB Undo表空間配置MySql
- 2.5.5 使用自動Undo管理: 建立 Undo 表空間
- ORACLE線上切換undo表空間Oracle
- Oracle undo 表空間資料檔案丟失強制啟動資料庫(沒有未提交的事務)Oracle資料庫
- Oracle切換undo表空間操作步驟Oracle
- MySQL UNDO表空間獨立和截斷MySql
- [20210527]rman與undo表空間備份.txt
- DB2建立資料庫,建立表空間DB2資料庫
- 檢查及設定合理的undo表空間
- undo表空間使用率過高解決
- oracle中undo表空間丟失處理方法Oracle
- 達夢資料庫表空間等空間大小查詢方法總結資料庫
- 【UNDO】Oracle undo表空間使用率過高,因為一個查詢Oracle
- undo表空間使用率100%的原因檢視
- [轉帖]達夢資料庫-統計資料表資料量及空間表大小資料庫
- 2.5.9 在資料庫建立期間支援大檔案表空間資料庫
- GBase8s 檢視資料庫表空間資訊資料庫
- 清理oracle資料庫空間Oracle資料庫
- OracleDatabase——資料庫表空間dmp匯出與匯入OracleDatabase資料庫
- 乾貨分享|優炫資料庫管理之表空間資料庫
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- MySQL 5.7新特性之線上收縮undo表空間MySql
- Oracle 19c 線上縮減 UNDO 表空間 容量Oracle
- Oracle案例11——Oracle表空間資料庫檔案收縮Oracle資料庫
- PostgreSQL-表空間、資料庫、使用者之間的關係(七)SQL資料庫
- 刪除UNDO表空間並處理ORA-01548問題
- 18_深入解析Oracle undo原理(2)_undo表空間使用率100%問題處理Oracle
- 達夢資料庫系統表空間資料檔案遷移過程資料庫
- 3.2 改變資料庫可用性資料庫
- [20201112]nid改變資料庫名字.txt資料庫
- (Les16 執行資料庫恢復)-表空間恢復資料庫
- 達夢資料庫表空間管理方法及實戰演示資料庫
- 如何獲取 PostgreSQL 資料庫中的表大小、資料庫大小、索引大小、模式大小、表空間大小、列大小SQL資料庫索引模式
- Oracle臨時表空間檢視、新增臨時表空間資料檔案、修改預設臨時表空間 方法!Oracle