標籤:redo declare when ace eric value ota processes acl
撤銷管理
什麼是撤銷資料:
1.交易的回退:沒有提交的交易可以rollback
2.交易的恢複:資料庫崩潰時,將磁碟的不正確資料恢複到交易前
3.讀一致性 :被查詢的記錄有事務佔用,轉向復原段找改前鏡像
4.閃回資料 :從復原段中構造曆史資料
事務與撤銷資料:
redo和undo:
AUM:
3個參數,兩個資料表空間屬性
undo_management=AUTO 復原資料表空間段的段管理員模式,管理員只需要備足夠的資料表空間容量,oracle會自動管理擴充復原段的數量。只能使用一個UNDO資料表空間。
undo_tablespace:只有在自動管理員模式下才可以使用。指明使用哪個UNDO資料表空間
undo_retention=900 :單位是:秒
提交之後舊的鏡像保持在復原段中的時間。提交之後額外保留的時間
非強制的回退保持時間.(復原空間不足老的鏡像就會被覆蓋)
autoextend:資料表空間自動擴充
強制保持:但是對空間要求較大,要慎用。(10g開始支援)
alter tablespace UNDOTABS1 RETENTION GUARANTEE;
select tablespace_name,RETENTION from dba_tablespaces;
UNDO_RETENTION specifies (in seconds) how long already committed undo information is to be retained. The only time you must set this parameter is when:
?The undo tablespace has the AUTOEXTEND option enabled
?You want to set undo retention for LOBs
?You want to guarantee retention
undo advisor:
調度作業
$ ps -ef | grep cjq
SQL> show parameter job_queue_processes
後台預先設定的自動化管理作業:
自訂作業:
SQL> create table session_history(snap_time timestamp with local time zone, num_session number);
em中建立作業:
使用plsql塊:
declare
session_count number;
begin
select count(*) into session_count from v$session;
insert into session_history values (systimestamp, session_count);
commit;
end;
全球化支援
$ vi .bash_profile
#export NLS_LANG=american_america.AL32UTF8
#export NLS_DATE_FORMAT=‘yyyy-mm-dd hh24:mi:ss‘
$ unset NLS_LANG
$ unset NLS_DATE_FORMAT
SQL> select sysdate from dual;
《oracle管理7》