oracle實用sql(4)--undo advisor
點選(此處)摺疊或開啟
-
DECLARE
-
v_tbs_name varchar2(30);
-
v_tbs_size number;
-
v_auto_extend boolean;
-
v_undo_retention number;
-
v_retention_guarantee boolean;
-
-
v_problem varchar2(1000);
-
v_recommendation varchar2(1000);
-
v_rationale varchar2(1000);
-
v_rec_undo_retention number;
-
v_rec_tbs_size number;
-
-
v_autotune_enable boolean;
-
-
v_return_boolean boolean;
-
v_return_number number;
-
v_return_varchar varchar2(1000);
-
BEGIN
-
--undo info
-
v_return_boolean:=dbms_undo_adv.undo_info(table_space_name => v_tbs_name,
-
table_space_size => v_tbs_size,
-
auto_extend => v_auto_extend,
-
undo_retention => v_undo_retention,
-
retention_guarantee => v_retention_guarantee);
-
dbms_output.put_line('table_space_name:'||v_tbs_name);
-
dbms_output.put_line('table_space_size:'||v_tbs_size);
-
dbms_output.put_line('auto_extend:'||case when v_auto_extend then 'YES' else 'NO' end);
-
dbms_output.put_line('undo_retention:'||v_undo_retention);
-
dbms_output.put_line('retention_guarantee:'||case when v_retention_guarantee then 'YES' else 'NO' end);
-
-
--以下函式都可以加上時間範圍,awr快照範圍
-
--required_undo_size
-
v_return_number := dbms_undo_adv.required_undo_size(retention => v_undo_retention);
-
dbms_output.put_line('required_undo_size:'||v_return_number);
-
--undo_health
-
v_return_number := dbms_undo_adv.undo_health(problem => v_problem,
-
recommendation => v_recommendation,
-
rationale => v_rationale,
-
retention => v_rec_undo_retention,
-
utbsize => v_rec_tbs_size);
-
dbms_output.put_line('problem:'||v_problem);
-
dbms_output.put_line('recommendation:'||v_recommendation);
-
dbms_output.put_line('rationale:'||v_rationale);
-
dbms_output.put_line('retention:'||v_rec_undo_retention);
-
dbms_output.put_line('utbsize:'||v_rec_tbs_size);
-
--undo_advisor
-
v_return_varchar := dbms_undo_adv.undo_advisor(instance => 1);
-
dbms_output.put_line('undo_advisor:'||v_return_varchar);
-
--autotune enable
-
v_return_boolean := dbms_undo_adv.undo_autotune(v_autotune_enable);
-
dbms_output.put_line('undo_autotune:'||case when v_autotune_enable then 'YES' else 'NO' end);
-
--longest_query
-
v_return_number := dbms_undo_adv.longest_query;
-
dbms_output.put_line('longest_query:'||v_return_number);
-
--required_retention
-
v_return_number := dbms_undo_adv.required_retention;
-
dbms_output.put_line('required_retention:'||v_return_number);
- END;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-2113778/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle實用sql(2)--segment advisorOracleSQL
- oracle實用sql(3)--sql tuning advisorOracleSQL
- oracle實驗記錄 (dump undo4)Oracle
- Oracle 檢視佔用undo大的sql語句OracleSQL
- Oracle SQL優化之sql tuning advisorOracleSQL優化
- Oracle SQL優化之sql tuning advisor(STA)OracleSQL優化
- SQL Access Advisor 與SQL Tuning AdvisorSQL
- ORACLE SQL TUNING ADVISOR 使用方法OracleSQL
- Oracle 11 sql tuning advisor sql access advisor關閉以及job檢視與停止OracleSQL
- oracle SQL最佳化器SQL Tuning Advisor (STA)OracleSQL
- Oracle SQL最佳化之sql tuning advisor(STA)OracleSQL
- SQL Access Advisor、SQL Tuning Advisor 測試SQL
- sql tuning advisor和sql access advisor區別SQL
- SQL Repair AdvisorSQLAI
- SQL Access Advisor!SQL
- 手工執行sql tuning advisor和sql access advisorSQL
- Oracle優化案例-關閉auto space advisor和sql tuning advisor(十九)Oracle優化SQL
- [原創]ORACLE SQL TUNING ADVISOR 使用方法OracleSQL
- SQL Access Advisor(zt)SQL
- SQL TUNING ADVISORSQL
- SQL Access Advisor 概要SQL
- oracle實驗記錄 (dump undo)Oracle
- Oracle Segment AdvisorOracle
- 使用dbms_advisor來執行sql access advisorSQL
- SQL Access Advisor的 DBMS_ADVISOR.QUICK_TUNE 使用SQLUI
- Oracle Redo and UndoOracle Redo
- Oracle undo 管理Oracle
- Oracle Undo SegmentOracle
- oracle undo管理Oracle
- oracle undo一Oracle
- Oracle Data Recovery AdvisorOracle
- Advisor Webcasts for Oracle DatabaseWebASTOracleDatabase
- oracle實用sql(8)--segment show spaceOracleSQL
- oracle實用sql(6)--tablespace/datafile resizeOracleSQL
- SQL Tuning Advisor簡介SQL
- 使用sql tuning advisor最佳化sqlSQL
- Oracle OCP 1Z0 053 Q258(SQL Repair Advisor)OracleSQLAI
- Oracle OCP IZ0-053 Q232(sql access advisor)OracleSQL