Oracle10g New Feature -- 7. Rollback Monitoring
在oracle10g中,如果某個回滾程式所用時間超過6秒,就能在v$session_longops中被捕捉到。這個看似微不足道的功能其實還挺有用的呢,至少對我來說是這樣。
以前做上海移動的專案時,一張表動仄上千萬,開發和測試人員經常在一句SQL執行了半個小時或者更久後發現錯誤又急忙停止,等著回滾結束後再次執行。可惜回滾結束這個時間太難估計了,當DBA的就經常被他們追著問。有了上面這個功能後至少可以給他們一個大概的估計時間了,並且是有根據的哦。要是估計錯了那也是oracle自己估計錯了 :)
至於另外一個parallel instance recovery功能,目前似乎並沒有體會到多少用處。能提高多少恢復速度呢?真正碰到問題時會想到這個功能嗎?
[@more@]1. Rollback Monitoring1. DML RollbackIn Oracle 10g, If a rollback process takes more than six seconds, the record appears in v$SESSION_LONGOPS.
SQL>select sid,opname,target,sofar,totalwork,time_remaining from v$session_longops where sofar!=totalwork
SID OPNAME TARGET SOFAR TOTALWORK TIME_REMAINING
---------- -------------------------------------- ------------------------ -------------------- ------------------------
133 Transaction Rollback 887 8415 59
SQL> select sql_text from v$sql where sql_id in (select sql_id from v$session_longops where sid=133);
SQL_TEXT
--------------------------------------------------------------------------------
rollback
insert into emp select * from emp
rollback
2. Parallel Instance Recovery
Suppose that during a large insert, the instance shuts down abnormally. When the instance comes up, the failed transaction is rolled back. If the value of the initialization parameter for parallel recovery is enabled, the rollback occurs in parallel instead of serially, as it occurs in regular transaction rollback.
Session a is running insert DML
SQL>insert into emp select * from emp;
Session b shuts down the instance in abort mode
SQL> connect sys/oracle as sysdba
Connected.
SQL> shutdown abort
ORACLE instance shut down.
Session a shows
SQL> insert into emp select * from emp;
insert into emp select * from emp
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Session b restart the instance
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145750508 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
During instance start up, check the rcvservers in view v$fast_start_transactions
SQL> select rcvservers from v$fast_start_transactions;
RCVSERVERS
----------
1
Change the initial parameter fast_start_parallel_rollback
SQL> alter system set fast_start_parallel_rollback=high;
System altered.
Check the rcvservers again
SQL> select rcvservers from v$fast_start_transactions;
RCVSERVERS
----------
4
In Oracle 10g, If a rollback process takes more than six seconds, the record appears in v$SESSION_LONGOPS.
SQL>select sid,opname,target,sofar,totalwork,time_remaining from v$session_longops where sofar!=totalwork
SID OPNAME TARGET SOFAR TOTALWORK TIME_REMAINING
---------- -------------------------------------- ------------------------ -------------------- ------------------------
133 Transaction Rollback 887 8415 59
SQL> select sql_text from v$sql where sql_id in (select sql_id from v$session_longops where sid=133);
SQL_TEXT
--------------------------------------------------------------------------------
rollback
insert into emp select * from emp
rollback
2. Parallel Instance Recovery
Suppose that during a large insert, the instance shuts down abnormally. When the instance comes up, the failed transaction is rolled back. If the value of the initialization parameter for parallel recovery is enabled, the rollback occurs in parallel instead of serially, as it occurs in regular transaction rollback.
Session a is running insert DML
SQL>insert into emp select * from emp;
Session b shuts down the instance in abort mode
SQL> connect sys/oracle as sysdba
Connected.
SQL> shutdown abort
ORACLE instance shut down.
Session a shows
SQL> insert into emp select * from emp;
insert into emp select * from emp
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Session b restart the instance
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145750508 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
During instance start up, check the rcvservers in view v$fast_start_transactions
SQL> select rcvservers from v$fast_start_transactions;
RCVSERVERS
----------
1
Change the initial parameter fast_start_parallel_rollback
SQL> alter system set fast_start_parallel_rollback=high;
System altered.
Check the rcvservers again
SQL> select rcvservers from v$fast_start_transactions;
RCVSERVERS
----------
4
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/207/viewspace-778763/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle10g New Feature -- 8. Tablespace ManagementOracle
- Oracle10g New Feature -- 4. Flashback DatabaseOracleDatabase
- Oracle10g New Feature -- 3.Flashback TableOracle
- Oracle10g New Feature -- 2.Flashback RecordsOracle
- Oracle10g New Feature -- 11. Wait InterfaceOracleAI
- Oracle10g New Feature -- 6. Oracle Data PumpOracle
- Oracle10g New Feature -- 5.Temporary Tablespace GroupOracle
- oracle10g new feature -- 1. SqlplusOracleSQL
- Oracle10g New Feature:CRS(Cluster Ready Services) (zt)Oracle
- Oracle10g New Feature -- 9. ASM (Automatic Storage Management)OracleASM
- java new featureJava
- Oracle10g New Feature -- 14. OEM ( Oracle Enterprise Manager)Oracle
- Oracle10g New Feature -- 13. Automatic Shared Memory ManagementOracle
- Oracle10g New Feature --12. ASSM ( Automatic Segment Space Management )OracleSSM
- Oracle10g New Feature -- 10. AWR (Automatic Workload Repository)Oracle
- oracle10g new feature:對expdp並行方式的幾個測試Oracle並行
- 12c new feature
- 版本新特性(new feature)
- new feature ——>mysql to oracle MigrationMySqlOracle
- Oracle Database 12C New FeatureOracleDatabase
- 11g New Feature: Health monitor
- Oracle 12c Recover Table New FeatureOracle
- oracle 12c new feature 列不可見Oracle
- j2ee1.4 new feature請教banq
- Oracle10g New Features(1)Oracle
- 11g New Feature: Health monitor (Doc ID 466920.1)
- oracle 11g ocp new feature 1z0-050Oracle
- Test Negtive Role Set in a stream environmnet- 10g_new_feature
- oracle 12cR2 new feature dbca 命令可以建立standby 庫Oracle
- Does Goldengate Support The New Oracle 10g Flashback Feature? [ID 966212.1]GoOracle 10g
- New redo log sizing advisor in Oracle10gOracle
- fast_start_parallel_rollback和並行rollbackASTParallel並行
- STREAMS MONITORING
- Column Monitoring
- 7.介面
- zt_楊老師yangtingkun_11g new feature新特性系列文章
- oracle 12c R2 new feature 支援執行過的歷史命令Oracle
- oracle 12c new feature crsctl 停止資源時提供預覽確認功能Oracle