Oracle基礎 03 回滾表空間 undo

j04212發表於2014-02-12


--查詢預設的undo表空間

select name,value from v$parameter
where name like '%undo%';


--建立 undotbs2 表空間

create undo tablespace undotbs2
datafile '/u01/app/oracle/oradata/test10g/undotbs02.dbf' size 50m  autoextend on next 10m maxsize 100m;


--將undotbs2 設為預設undo表空間

alter system set undo_tablespace=undotbs2 scope=both;


--如果在建立一個新資料庫時想選用AUM,則需要配置下列3個初始化引數:
undo_management:
    undo_management=auto
undo_tablespace:
    alter system set undo_tablespace=undotbs_02;
undo_retention:
    alter system set undo_retention=7200 (兩個小時)

撤銷表空間必須能容納撤銷保留時間段內的任何增加,如果撤銷表空間不能儲存所需要時間的記錄,就會出現查詢的快照太舊錯誤。
不存在完美的 undo_retention 時間設定。保留時間間隔取決於估計最長的事務可能執行的時間長度。根據資料庫中最長事務長度的資訊,可以給 undo_retention 分配一個大致的時間。
select max(maxquerylen) from v$undostat;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27633655/viewspace-1080307/,如需轉載,請註明出處,否則將追究法律責任。

相關文章