8月11
阻塞和死鎖的區別:死鎖是死循環,阻塞是一個隊列。
撤銷表空間專門放撤銷的數據。撤銷段和每一個事物關聯在一起。
AUM自動撤銷管理,只需指令好表空間,規定好表空間大小,系統會自動管理。
Database: show parameter nls
Client:
.bash_profile
Export NLS_DATE_FORMAT=’yyyy-mm-dd’
SESSION:alter session set nls_date_fomat=’dd-mon yyyy’
Select to_char(sysdate, ‘yyyy, month, dd’)from dual;
影響范圍越小的,優先級別越高。
死鎖:
session1:
SQL> select * from t1;
?
?????????X
----------
?????????1
?????????2
SQL> update t1 set x=11 where x=1;
session2:
SQL> update t1 set x=22 where x=2;
session1:
SQL> update t1 set x=222 where x=2; 阻塞
session2:
SQL> update t1 set x=111 where x=1; 死鎖
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource
$ vi /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
?
鎖和外鍵
select … for update
撤銷管理
什么是撤銷數據:
?
1.交易的回退:沒有提交的交易可以rollback
2.交易的恢復:數據庫崩潰時,將磁盤的不正確數據恢復到交易前
3.讀一致性??:被查詢的記錄有事務占用,轉向回滾段找改前鏡像
4.閃回數據??:從回滾段中構造歷史數據
事務與撤銷數據:
?
redo和undo:
?
AUM:
3個參數,兩個表空間屬性
?
undo_management=AUTO 回滾表空間段的段管理模式,管理員只需要備足夠的表空間容量,oracle會自動管理擴展回滾段的數量。只能使用一個UNDO表空間。保證參數的值一直是auto。
undo_tablespace:只有在自動管理模式下才可以使用。指明使用哪個UNDO表空間。后面跟一個真實存在的表空間的名字。這個表空間的類型是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:
?
轉載于:https://www.cnblogs.com/m4116/p/7347567.html
總結
- 上一篇: node中使用es6/7/8 --- 支
- 下一篇: POJ3272 Cow Traffic