锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产成人精品日本亚洲18图,最新亚洲卡一卡二卡三新区,亚洲日本va在线观看http://www.tkk7.com/jinfeng_wang/category/42248.htmlG-G-S,D-D-U!zh-cnMon, 26 Oct 2009 16:27:38 GMTMon, 26 Oct 2009 16:27:38 GMT60sql_trace and tkprofhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/25/299664.htmljinfeng_wangjinfeng_wangSun, 25 Oct 2009 06:29:00 GMThttp://www.tkk7.com/jinfeng_wang/archive/2009/10/25/299664.htmlhttp://www.tkk7.com/jinfeng_wang/comments/299664.htmlhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/25/299664.html#Feedback0http://www.tkk7.com/jinfeng_wang/comments/commentRss/299664.htmlhttp://www.tkk7.com/jinfeng_wang/services/trackbacks/299664.html     1) : alter session set timed_statistics=true;

    2 ) select * from v$session where v$session.USERNAME='SCOTT'; //find the trace session

    3)  exec dbms_system.set_sql_trace_in_session(25,6,true);  //open the sql_trace for the session

session2  (scott)
    4) select * from t;

session 1(sysbda)
    5) exec dbms_system.set_sql_trace_in_session(25,6,false); //close the sql_trace
   
    6) show parameter user_dump;  //get the trace file path

session 3: OS,
    7)  cd /opt/oracle/diag/rdbms/orcl/orcl/trace
    8) ll -t  *.trc   //get the last trc file

    9) /opt/oracle/product/11.1.x/bin/tkprof /opt/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_7688.trc /opt/oracle/diag/rdbms/orcl/orcl/trace/
orcl_ora_7688.trc.txt

   
   


jinfeng_wang 2009-10-25 14:29 鍙戣〃璇勮
]]>
鍒╃敤 SQL Access Advisor 鏀硅繘妯″紡璁捐 zzhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/24/299567.htmljinfeng_wangjinfeng_wangSat, 24 Oct 2009 05:59:00 GMThttp://www.tkk7.com/jinfeng_wang/archive/2009/10/24/299567.htmlhttp://www.tkk7.com/jinfeng_wang/comments/299567.htmlhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/24/299567.html#Feedback0http://www.tkk7.com/jinfeng_wang/comments/commentRss/299567.htmlhttp://www.tkk7.com/jinfeng_wang/services/trackbacks/299567.htmlhttp://www.oracle.com/technology/global/cn/obe/11gr1_db/manage/sqlaccadv/sqlaccadv.htm 

鍒╃敤 SQL Access Advisor 鏀硅繘妯″紡璁捐

鏈暀紼嬪皢鍚戞偍璇存槑濡備綍浣跨敤 SQL Access Advisor 鏀硅繘妯″紡璁捐銆?

澶х害 40 鍒嗛挓

涓婚

鏈暀紼嬪寘鎷笅鍒椾富棰橈細

灝嗛紶鏍囩疆浜庢鍥炬爣涓?/font>鍙互鍔犺澆鍜屾煡鐪嬫湰鏁欑▼鐨勬墍鏈夊睆騫曟埅鍥俱?錛堣鍛婏細鍥犱負姝ゆ搷浣滀細鍚屾椂鍔犺澆鎵鏈夊睆騫曟埅鍥撅紝鎵浠ョ綉閫熻緝鎱㈡椂錛屽搷搴旀椂闂村彲鑳戒細姣旇緝闀褲傦級

娉細姝ゅ錛屾偍榪樺彲浠ュ湪涓嬪垪姝ラ涓皢榧犳爣鏀懼湪姣忎釜鍗曠嫭鐨勫浘鏍囦笂錛屼粠鑰屼粎鍔犺澆鍜屾煡鐪嬩笌璇ユ楠ょ浉鍏崇殑灞忓箷鎴浘銆傚彲浠ラ氳繃鍗曞嚮鍚勪釜灞忓箷鎴浘鏉ュ皢鍏墮殣钘忋?

姒傝堪

瀹氫箟鐩稿簲鐨勮闂粨鏋勪互浼樺寲 SQL 鏌ヨ濮嬬粓鏄?Oracle DBA 瑕佽冭檻鐨勯棶棰樸傚洜姝わ紝涓鴻В鍐寵繖涓闂錛屼漢浠紪鍐欎簡璁稿鎶鏈枃绔犲拰鑴氭湰錛岃繕寮鍙戜簡涓嶅皯楂樼宸ュ叿銆傛澶栵紝闅忕潃鍒嗗尯鍜岀墿鍖栬鍥炬妧鏈殑鍙戝睍錛岀‘瀹氳闂粨鏋勫彉寰楁剤鍔犲鏉傘備負瑙e喅榪欎竴闈炲父閲嶈鐨勯渶姹傦紝Oracle 鏁版嵁搴?10g 鍜?11g 寮曞叆浜?SQL Access Advisor錛屼粠鑰屾敼榪涗簡鍙鐞嗘с?/p>

SQL Access Advisor 閫氳繃寤鴻瑕佸垱寤恒佸垹闄ゆ垨淇濈暀鐨勭儲寮曘佺墿鍖栬鍥俱佺墿鍖栬鍥炬棩蹇楁垨鍒嗗尯鏉ョ‘瀹氬茍甯姪瑙e喅涓?SQL 璇彞鎵ц鐩稿叧鐨勬ц兘闂銆傚畠鍙互閫氳繃 Database Control 榪愯錛屼篃鍙互閫氳繃鍛戒護琛屼嬌鐢?PL/SQL 榪囩▼榪愯銆?/p>

榪斿洖涓婚鍒楄〃

寮濮嬫湰鏁欑▼涔嬪墠錛屾偍搴旇錛?

1.

瀹夎 Oracle 鏁版嵁搴?11g銆?/p>

2.

涓嬭澆 sqlaccadv.zip 鏂囦歡騫跺皢鍏惰В鍘嬬緝鍒版偍鐨勫伐浣滅洰褰曪紙鍗?wkdir錛夛紝鐒跺悗瀵艱埅鍒版偍鐨勫伐浣滅洰褰曘?/p>

榪斿洖涓婚鍒楄〃

浣跨敤 SQL Access Advisor

SQL Access Advisor 灝嗗疄闄呰礋杞戒綔涓鴻緭鍏ワ紝Advisor 涔熷彲浠ラ氳繃妯″紡鑾峰緱鍋囧畾鐨勮礋杞姐傜劧鍚庯紝瀹冧細寤鴻鍙彁渚涙洿蹇墽琛岃礬寰勭殑璁塊棶緇撴瀯銆傚畠鍏鋒湁浠ヤ笅浼樼偣錛?/p>

  • 鏃犻渶鎺屾彙涓撲笟鐭ヨ瘑銆?
  • 鏍規嵁瀹為檯椹葷暀鍦ㄥ熀浜庢垚鏈殑浼樺寲鍣ㄤ腑鐨勮鍒欏仛鍐沖畾銆?
  • 涓庝紭鍖栧櫒鍜?Oracle 鏁版嵁搴撳寮哄悓姝ャ?
  • 鏄竴涓兜鐩?SQL 璁塊棶鏂規硶鍚勪釜鏂歸潰鐨勫崟涓欏鵑棶紼嬪簭銆?
  • 鎻愪緵綆鍗曘佺敤鎴峰弸濂界殑 GUI 鍚戝銆?
  • 鐢熸垚鑴氭湰鏉ュ疄鏂藉緩璁?

涓嬮潰鐨勪緥瀛愯鏄庝簡 SQL Access Advisor 鍙互鎻愪緵鐨勫緩璁殑綾誨瀷銆傝渚嬪瓙榪樹嬌鐢?SQL Performance Analyzer 璇佹槑 SQL Access Advisor 鎻愪緵鐨勫緩璁緢濂姐?/p>

鎵ц浠ヤ笅姝ラ錛屼簡瑙?SQL Access Advisor 鐨勭敤娉曪細

1.

鍦ㄤ互 oracle 鐢ㄦ埛韜喚榪炴帴鐨勭粓绔細璇濅腑錛屾墽琛?sqlaccessadv_setup.sh 鑴氭湰銆傝鑴氭湰灝嗙敓鎴愭湰 OBE 涓嬌鐢ㄧ殑鎵鏈夊繀闇鐨勬暟鎹傚挨鍏舵槸錛屽畠灝嗙敓鎴愮敤浜庤〃紺鴻鍒嗘瀽鐨勮礋杞界殑 SQL 璋冩暣宸ュ叿闆嗐?/p>

./sqlaccessadv_setup.sh

 

2.

浠?sh鐢ㄦ埛韜喚錛堝彛浠?sh錛夎繛鎺ュ埌 Enterprise Manager Database Control銆傝繘鍏?Home 欏甸潰鍚庯紝鍗曞嚮 Related Links 閮ㄥ垎涓殑 Advisor Central 閾炬帴銆?/p>

 

3.

鍦?Advisor Central 欏甸潰涓紝鍗曞嚮 SQL Advisors 閾炬帴銆傜劧鍚庡湪 SQL Advisors 欏甸潰涓紝鍗曞嚮 SQL Access Advisor 閾炬帴銆?/p>

 

4.

鍦?Initial Options 欏甸潰涓紝閫夋嫨 Inherit Options from a previously saved Task or Template錛岀劧鍚庨夋嫨 SQLACCESS_WAREHOUSE 妯℃澘銆傚畬鎴愪互涓婃搷浣滃悗錛屽崟鍑?Continue銆?/p>

 

5.

鍦?Workload Source 欏甸潰涓紝閫夋嫨 Use an existing SQL Tuning Set 騫跺湪 SQL Tuning Set 鍩熶腑杈撳叆 SH.SQLSET_MY_SQLACCESS_WORKLOAD銆傝 SQL 璋冩暣宸ュ叿闆嗘槸浠ュ墠鐢熸垚鐨勩傚畠琛ㄧず鎮ㄨ鍒嗘瀽鐨勪粨搴撹礋杞姐傚畬鎴愪互涓婃搷浣滃悗錛屽崟鍑?Continue銆?/p>

 

6.

鍦?Recommendation Options 欏甸潰涓紝紜繚宸查夋嫨鎵鏈夊彲鑳界殑璁塊棶緇撴瀯騫墮夋嫨浜?Comprehensive銆傚畬鎴愪互涓婃搷浣滃悗錛屽崟鍑?Continue銆?/p>

 

7.

鍦?Schedule 欏甸潰鐨?Task Name 鍩熶腑杈撳叆 MY_SQLACCESS_TASK銆備粠鎻愪緵鐨勫垪琛ㄤ腑閫夋嫨絎竴涓椂鍖猴紙鍗曞嚮鐏偓鍥炬爣錛夈傚畬鎴愪互涓婃搷浣滃悗錛屽崟鍑?Continue銆?/p>

 

8.

鍦?Review 欏甸潰涓紝鍗曞嚮 Submit銆?/p>

 

9.

榪斿洖 Advisor Central 欏甸潰錛屽崟鍑?Refresh銆傚畬鎴愪互涓婃搷浣滃悗錛屽崟鍑?Results 琛ㄤ腑鐨?MY_SQLACCESS_TASK 閾炬帴銆傝浠誨姟搴斿浜?COMPLETED 鐘舵併?/p>

 

10.

榪欏皢杞嚦 Results 欏甸潰銆傞氳繃璇ラ〉闈紝鎮ㄥ彲浠ョ湅鍒伴拡瀵硅璐熻澆瀹炴柦 SQL Access Advisor 寤鴻鐨勬綔鍦ㄥソ澶勩傚崟鍑?Recommendation 瀛愰夐」鍗°?/p>

 

11.

鍦?Recommendations 瀛愰〉闈腑錛屾偍鍙互鏌ョ湅寤鴻鐨勯珮綰ф榪般傚熀鏈笂錛屼細涓鴻璐熻澆鐢熸垚鎵鏈夊彲鑳界殑寤鴻綾誨瀷銆傜‘淇濆凡閫夋嫨鎵鏈夊緩璁紝鍗曞嚮 Recommendation Details 鎸夐挳銆傝繖灝嗚漿鑷?Details 欏甸潰錛屾偍鍙互鍦ㄥ叾涓湅鍒版湁鍏蟲瘡涓緩璁殑鏇村璇︾粏淇℃伅錛屼互鍙婅璐熻澆涓彈榪欎簺寤鴻褰卞搷鐨勭浉搴?SQL 璇彞銆傚崟鍑?OK銆?/p>

 

12.

榪斿洖 Recommendations 瀛愰〉闈紝鍗曞嚮 Schedule Implementation 鎸夐挳銆?/p>

 

13.

鍦?Schedule Implementation 欏甸潰涓紝鏄劇ず涓涓鍛婏紝琛ㄦ槑璇ュ悜瀵間笉浼氬皾璇曞疄鏂藉叾寤鴻錛屽洜涓烘煇浜涘緩璁槸闈炲父閲嶈鐨勬洿鏀癸紝搴旂敱綆$悊鍛樿鐪熸煡鐪嬨傚洜姝わ紝鍗曞嚮 Show SQL 鎸夐挳鏌ョ湅鎮ㄥ彲浠ョ敤鏉ュ疄鏂芥墍鏈夊緩璁殑鑴氭湰銆備簨瀹炰笂錛屾偍宸茬粡鍒涘緩浜嗚鑴氭湰騫跺皢鍦ㄦ湰 OBE 鐨勭◢鍚庨儴鍒嗕嬌鐢ㄣ傛煡鐪嬩簡璇ヨ剼鏈箣鍚庯紝鍗曞嚮 Done銆傝繑鍥?Schedule Implementation 欏甸潰錛屽崟鍑?Cancel銆?/p>

 

14.

鍗曞嚮鍙充笂瑙掔殑 Database 閫夐」鍗★紝鐒跺悗鍗曞嚮 Software and Support 閫夐」鍗°傝繘鍏?Software and Support 欏甸潰鍚庯紝鍗曞嚮 SQL Performance Analyzer 閾炬帴銆傛偍鐜板湪甯屾湜璇佹槑瀹炴柦寤鴻鏄湁鐩婂鐨勩?/p>

 

15.

鍦?SQL Performance Analyzer 欏甸潰涓紝鍗曞嚮 Guided Workflow 閾炬帴銆?/p>

 

16.

鍦?Guided Workflow 欏甸潰涓紝鍗曞嚮涓庣 1 姝ュ搴旂殑琛屼笂鐨?Execute 鍥炬爣銆傚湪 Create SQL Performance Analyzer Task 涓紝鍦?SQL Performance Analyzer Task 鐨?Name 鍩熶腑杈撳叆 MY_SPA_TASK銆傜劧鍚庯紝鍦?SQL 璋冩暣宸ュ叿闆嗙殑 Name 鍩熶腑杈撳叆 SH.SQLSET_MY_SQLACCESS_WORKLOAD銆傚畬鎴愪互涓婃搷浣滃悗錛屽崟鍑?Create銆?/p>

 

17.

榪斿洖 Guided Workflow 欏甸潰錛屽崟鍑葷 2 姝ョ殑 Execute 鍥炬爣銆傚湪 Create Replay Trial 欏甸潰鐨?Replay Trial Name 鍩熶腑杈撳叆 MY_SQL_REPLAY_BEFORE錛岀‘淇濋変腑 Trial environment established 澶嶉夋銆傜劧鍚庯紝鍗曞嚮 Submit銆?/p>

 

18.

鍦ㄧ粓绔細璇濅腑錛屽湪 SQL*Plus 涓嬩互 sh鐢ㄦ埛韜喚錛堝彛浠?sh錛夎繛鎺ャ傚湪 SQL*Plus 浼氳瘽涓紝鎵ц implement.sql 鑴氭湰銆傝鑴氭湰鏄笌 SQL Access Advisor 浼氳瘽鍏堝墠鐢熸垚鐨勫緩璁搴旂殑棰勫垱寤鴻剼鏈?/p>

@implement.sql

 

19.

榪斿洖 Guided Workflow Enterprise Manager 欏甸潰錛屽崟鍑諱笌絎?3 姝ョ浉瀵瑰簲鐨?Execute 鍥炬爣銆傚湪 Create Replay Trial 欏甸潰鐨?Replay Trial Name 鍩熶腑杈撳叆 MY_SQL_REPLAY_AFTER銆傜‘淇濆凡閫変腑 Trial environment established 澶嶉夋錛岀劧鍚庡崟鍑?Submit銆?/p>

 

20.

榪斿洖 Guided Workflow Enterprise Manager 欏甸潰錛屽崟鍑諱笌絎?4 姝ュ搴旂殑 Execute 鍥炬爣銆傚湪 Run Replay Trial Comparison 欏甸潰涓紝紜繚鍒涘緩涓涓?MY_SQL_REPLAY_BEFORE 鍜?MY_SQL_REPLAY_AFTER 涔嬮棿鐨勬瘮杈冦傚崟鍑?Submit銆?/p>

 

21.

榪斿洖 Guided Workflow Enterprise Manager 欏甸潰錛屽崟鍑諱笌絎?5 姝ュ搴旂殑 Execute 鍥炬爣銆傚湪 SQL Performance Analyzer Task Result 欏甸潰涓婏紝鎮ㄥ彲浠ユ竻妤氬湴鐪嬪埌絎簩嬈¤瘯鐢ㄨ緝絎竴嬈″揩寰楀銆?/p>

 

榪斿洖涓婚鍒楄〃

鍦ㄦ湰鏁欑▼涓紝鎮ㄥ涔犱簡濡備綍浣跨敤 SQL Access Advisor銆?/p>

]]>
SQL Performance Analyzer in Oracle Database 11g Release 1 zzhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/24/299566.htmljinfeng_wangjinfeng_wangSat, 24 Oct 2009 05:58:00 GMThttp://www.tkk7.com/jinfeng_wang/archive/2009/10/24/299566.htmlhttp://www.tkk7.com/jinfeng_wang/comments/299566.htmlhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/24/299566.html#Feedback0http://www.tkk7.com/jinfeng_wang/comments/commentRss/299566.htmlhttp://www.tkk7.com/jinfeng_wang/services/trackbacks/299566.htmlhttp://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#sql_performance_analyzer_api 

The concept of SQL tuning sets, along with the DBMS_SQLTUNE package to manipulate them, was introduced in Oracle 10g as part of the Automatic SQL Tuning functionality. Oracle 11g makes further use of SQL tuning sets with the SQL Performance Analyzer, which compares the performance of the statements in a tuning set before and after a database change. The database change can be as major or minor as you like, such as:
  • Database, operating system, or hardware upgrades.
  • Database, operating system, or hardware configuration changes.
  • Database initialization parameter changes.
  • Schema changes, such as adding indexes or materialized views.
  • Refreshing optimizer statistics.
  • Creating or changing SQL profiles.
Unlike Database Replay, the SQL Performance Analyzer does not try and replicate the workload on the system. It just plugs through each statement gathering performance statistics.

The SQL Performance Analyzer can be run manually using the DBMS_SQLPA package or using Enterprise Manager. This article gives an overview of both methods.

Setting Up the Test

The SQL performance analyzer requires SQL tuning sets, and SQL tuning sets are pointless unless they contain SQL, so the first task should be to issue some SQL statements. We are only trying to demonstrate the technology, so the example can be really simple. The following code creates a test user called SPA_TEST_USER.
CONN sys/password@prod AS SYSDBA
CREATE USER spa_test_user IDENTIFIED BY spa_test_user
QUOTA UNLIMITED ON users;
GRANT CONNECT, CREATE TABLE TO spa_test_user;
Next, connect to the test user and create a test table called MY_OBJECTS using a query from the ALL_OBJECTS view.
CONN spa_test_user/spa_test_user@prod
CREATE TABLE my_objects AS
SELECT * FROM all_objects;
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade => TRUE);
This schema represents our "before" state. Still logged in as the test user, issue the following statements.
SELECT COUNT(*) FROM my_objects WHERE object_id <= 100;
SELECT object_name FROM my_objects WHERE object_id = 100;
SELECT COUNT(*) FROM my_objects WHERE object_id <= 1000;
SELECT object_name FROM my_objects WHERE object_id = 1000;
SELECT COUNT(*) FROM my_objects WHERE object_id BETWEEN 100 AND 1000;
Notice, all statements make reference to the currently unindexed OBJECT_ID column. Later we will be indexing this column to create our changed "after" state.

The select statements are now in the shared pool, so we can start creating an SQL tuning set.

Creating SQL Tuning Sets using the DBMS_SQLTUNE Package

The DBMS_SQLTUNE package contains procedures and functions that allow us to create, manipulate and drop SQL tuning sets. The first step is to create an SQL tuning set called spa_test_sqlset using the CREATE_SQLSET procedure.
CONN sys/password@prod AS SYSDBA
EXEC DBMS_SQLTUNE.create_sqlset(sqlset_name => 'spa_test_sqlset');
Next, the SELECT_CURSOR_CACHE table function is used to retrieve a cursor containing all SQL statements that were parsed by the SPA_TEST_USER schema and contain the word "my_objects". The resulting cursor is loaded into the tuning set using the LOAD_SQLSET procedure.
DECLARE
l_cursor  DBMS_SQLTUNE.sqlset_cursor;
BEGIN
OPEN l_cursor FOR
SELECT VALUE(a)
FROM   TABLE(
DBMS_SQLTUNE.select_cursor_cache(
basic_filter   => 'sql_text LIKE ''%my_objects%'' and parsing_schema_name = ''SPA_TEST_USER''',
attribute_list => 'ALL')
) a;
DBMS_SQLTUNE.load_sqlset(sqlset_name     => 'spa_test_sqlset',
populate_cursor => l_cursor);
END;
/
The DBA_SQLSET_STATEMENTS view allows us to see which statements have been associated with the tuning set.
SELECT sql_text
FROM   dba_sqlset_statements
WHERE  sqlset_name = 'spa_test_sqlset';
SQL_TEXT
--------------------------------------------------------------------------------
SELECT object_name FROM my_objects WHERE object_id = 100
SELECT COUNT(*) FROM my_objects WHERE object_id <= 100
SELECT COUNT(*) FROM my_objects WHERE object_id BETWEEN 100 AND 1000
SELECT COUNT(*) FROM my_objects WHERE object_id <= 1000
SELECT object_name FROM my_objects WHERE object_id = 1000
5 rows selected.
SQL>
Now we have an SQL tuning set, we can start using the SQL performance analyzer.

Running the SQL Performance Analyzer using the DBMS_SQLPA Package

The DBMS_SQLPA package is the PL/SQL API used to manage the SQL performance ananlyzer. The first step is to create an analysis task using the CREATE_ANALYSIS_TASK function, passing in the SQL tuning set name and making a note of the resulting task name.
CONN sys/password@prod AS SYSDBA
VARIABLE v_task VARCHAR2(64);
EXEC :v_task :=  DBMS_SQLPA.create_analysis_task(sqlset_name => 'spa_test_sqlset');
PL/SQL procedure successfully completed.
SQL> PRINT :v_task
V_TASK
--------------------------------------------------------------------------------
TASK_122
SQL>
Next, use the EXECUTE_ANALYSIS_TASK procedure to execute the contents of the SQL tuning set against the current state of the database to gather information about the performance before any modifications are made. This analysis run is named before_change.
BEGIN
DBMS_SQLPA.execute_analysis_task(
task_name       => :v_task,
execution_type  => 'test execute',
execution_name  => 'before_change');
END;
/
Now we have the "before" performance information, we need to make a change so we can test the "after" performance. For this example we will simply add an index to the test table on the OBJECT_ID column. In a new SQL*Plus session create the index using the following statements.
CONN spa_test_user/spa_test_user@prod
CREATE INDEX my_objects_index_01 ON my_objects(object_id);
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade => TRUE);
Now, we can return to our original session and test the performance after the database change. Once again use the EXECUTE_ANALYSIS_TASK procedure, naming the analysis task "after_change".
BEGIN
DBMS_SQLPA.execute_analysis_task(
task_name       => :v_task,
execution_type  => 'test execute',
execution_name  => 'after_change');
END;
/
Once the before and after analysis tasks are complete, we must run a comparison analysis task. The following code explicitly names the analysis tasks to compare using name-value pairs in the EXECUTION_PARAMS parameter. If this is ommited, the latest two analysis runs are compared.
BEGIN
DBMS_SQLPA.execute_analysis_task(
task_name        => :v_task,
execution_type   => 'compare performance',
execution_params => dbms_advisor.arglist(
'execution_name1',
'before_change',
'execution_name2',
'after_change')
);
END;
/
With this final analysis run complete, we can check out the comparison report using the REPORT_ANALYSIS_TASK function. The function returns a CLOB containing the report in text or HTML format. The script below spools the default text format report out to a file.
SET LONG 1000000
SET PAGESIZE 0
SET LINESIZE 200
SET LONGCHUNKSIZE 200
SET TRIMSPOOL ON
SPOOL /tmp/execute_comparison_report.txt
SELECT DBMS_SQLPA.report_analysis_task(:v_task)
FROM   dual;
SPOOL OFF
An example of this file can be seen here.

Creating SQL Tuning Sets using Enterprise Manager

Click on the "SQL Tuning Sets" link towards the bottom of the "Performance" tab.

SQL Tuning Sets Link

On the "SQL Tuning Sets" screen, click the "Create" button.

SQL Tuning Sets

Enter a name for the SQL tuning set and click the "Next" button.

Options

Select the "Load SQL statements one time only" option, select the "Cursor Cache" as the data source, then click the "Next" button.

Load Methods

Set the appropriate values for the "Parsing Schema Name" and "SQL Text" filter attributes, remove any extra attributes by clicking their remove icons, then click the "Next" button.

Filter Options

Accept the immediate schedule by clicking the "Next" button.

Schedule

Assuming the review information looks correct, click the "Submit" button.

Review

The "SQL Tuning Sets" screen shows the confirmation of the tuning set creation and the scheduled job to populate it.

Confirmation

Once the population job completes, clicking on the SQL tuning set displays its contents.

SQL Tuning Set Contents

Now we have an SQL tuning set, we can start using the SQL performance analyzer.

Running the SQL Performance Analyzer using Enterprise Manager

Click the "SQL Performance Analayzer" link on the "Software and Support" tab.

SQL Performance Analyzer Link

Click the "Guided Workflow" link on the "SQL Performance Analayzer" screen.

Guided Workflow

Click the execute icon on the first step to create the SQL Performance Analyzer task.

Create SPA Task Icon

Enter a name for the SPA task, select the SQL tuning set to associate with it, then click the "Create" button.

Create SPA Task

When the status of the previous step becomes a green tick, click the execute icon on the second step to capture the SQL tuning set performance information of the "before" state.

Replay Before Icon

Enter a "Replay Trial Name" of "before_change", check the "Trial environment established" checkbox, then click the "Submit" button.

Replay Before

When the status of the previous step becomes a green tick, click the execute icon on the third step to capture the SQL tuning set performance information of the "after" state.

Replay After Icon

Alter the state of the database by creating an index on the OBJECT_ID column of the test table.
CONN spa_test_user/spa_test_user@prod
CREATE INDEX my_objects_index_01 ON my_objects(object_id);
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade => TRUE);
Enter a "Replay Trial Name" of "after_change", check the "Trial environment established" checkbox, then click the "Submit" button.

Replay After

When the status of the previous step becomes a green tick, click the execute icon on the forth step to run a comparison analysis task.

Compare Icon

Accept the default "Trial 1 Name" and "Trial 2 Name" settings by clicking the "Submit" button.

Compare

When the status of the previous step becomes a green tick, click the execute icon on the fifth step to view the comparison report.

Report Icon

The resulting page contains the comparison report for the SQL Performance Analyzer task.

Report

Clicking on a specific SQL ID displays the statement specific results, along with the before and after execution plans.

SQL Report

Optimizer Upgrade Simulation

The SQL Performance Analyzer allows you to test the affects of optimizer version changes on SQL tuning sets. Click the "Optimizer Upgrade Simulation" link on the "SQL Performance Analyzer" page.

Optimizer Upgrade Simulation Link

Enter a task name, select the two optimizer versions to compare, then click the "Submit" button.

Optimizer Upgrade Simulation

The task is listed in the "SQL Performance Analyzer Tasks" section. Refresh the page intermittently until the task status becomes a green tick, then click on the task name.

Task List

The resulting screen shows details of the selected task. Click on the "Comparison Report" classes icon allows you to view the comparison report.

Task Details

Parameter Change

The SQL Performance Analyzer provides a shortcut for setting up tests of initialization parameter changes on SQL tuning sets. Click the "Parameter" link on the "SQL Performance Analyzer" page.

Parameter Change Link

Enter a task name and the parameter you wish to test. Enter the base and changed value, then click the "Submit" button.

Parameter Change

The task is listed in the "SQL Performance Analyzer Tasks" section. Refresh the page intermittently until the task status becomes a green tick, then click on the task name.

Task List

The resulting screen shows details of the selected task. Click on the "Comparison Report" classes icon allows you to view the comparison report.

Task Details

Transferring SQL Tuning Sets

In the examples listed above, the tests have been performed on the same system. In reality you are more likely to want to create a tuning set on your production system, then run the SQL Performance Analyzer against it on a test system. Fortunately, the DBMS_SQLTUNE package allows you to transport SQL tuning sets by storing them in a staging table.

First, create the staging table using the CREATE_STGTAB_SQLSET procedure.
CONN sys/password@prod AS SYSDBA
BEGIN
DBMS_SQLTUNE.create_stgtab_sqlset(table_name      => 'SQLSET_TAB',
schema_name     => 'SPA_TEST_USER',
tablespace_name => 'USERS');
END;
/
Next, use the PACK_STGTAB_SQLSET procedure to export SQL tuning set into the staging table.
BEGIN
DBMS_SQLTUNE.pack_stgtab_sqlset(sqlset_name          => 'SPA_TEST_SQLSET',
sqlset_owner         => 'SYS',
staging_table_name   => 'SQLSET_TAB',
staging_schema_owner => 'SPA_TEST_USER');
END;
/
Once the SQL tuning set is packed into the staging table, the table can be transferred to the test system using Datapump, Export/Import or via a database link. Once on the test system, the SQL tuning set can be imported using the UNPACK_STGTAB_SQLSET procedure.
BEGIN
DBMS_SQLTUNE.unpack_stgtab_sqlset(sqlset_name          => '%',
sqlset_owner         => 'SYS',
replace              => TRUE,
staging_table_name   => 'SQLSET_TAB',
staging_schema_owner => 'SPA_TEST_USER');
END;
/
The SQL tuning set can now be used with the SQL Performance Analyzer on the test system.

For more information see:


]]>
oracle11g install dbcontrolhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/20/299111.htmljinfeng_wangjinfeng_wangTue, 20 Oct 2009 14:10:00 GMThttp://www.tkk7.com/jinfeng_wang/archive/2009/10/20/299111.htmlhttp://www.tkk7.com/jinfeng_wang/comments/299111.htmlhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/20/299111.html#Feedback0http://www.tkk7.com/jinfeng_wang/comments/commentRss/299111.htmlhttp://www.tkk7.com/jinfeng_wang/services/trackbacks/299111.html1)  Command:  emca -deconfig dbcontrol db -repos drop

2)

drop user SYSMAN cascade;
drop user MGMT_VIEW cascade;
drop role MGMT_USER;
drop public synonym MGMT_TARGET_BLACKOUTS;
drop public synonym SETEMVIEWUSERCONTEXT;

drop user sysman cascade;
drop public synonym MGMT_ADMIN;
drop public synonym MGMT_AS_ECM_UTIL;
drop public synonym MGMT_AVAILABILITY;
drop public synonym MGMT_COLLECTION_PROPERTIES;
drop public synonym MGMT_CREDENTIAL;
drop public synonym MGMT_CURRENT_AVAILABILITY;
drop public synonym MGMT_CURRENT_METRICS;
drop public synonym MGMT_CURRENT_METRIC_ERRORS;
drop public synonym MGMT_CURRENT_SEVERITY;
drop public synonym MGMT_DELTA;
drop public synonym MGMT_DELTA_ENTRY;
drop public synonym MGMT_DELTA_ENTRY_VALUES;
drop public synonym MGMT_DELTA_IDS;
drop public synonym MGMT_DELTA_ID_VALUES;
drop public synonym MGMT_DELTA_VALUE;
drop public synonym MGMT_DELTA_VALUES;
drop public synonym MGMT_GLOBAL;
drop public synonym MGMT_GUID_ARRAY;
drop public synonym MGMT_GUID_OBJ;
drop public synonym MGMT_IP_TGT_GUID_ARRAY;
drop public synonym MGMT_JOB;
drop public synonym MGMT_JOBS;
drop public synonym MGMT_JOB_EXECPLAN;
drop public synonym MGMT_JOB_EXECUTION;
drop public synonym MGMT_JOB_EXEC_SUMMARY;
drop public synonym MGMT_JOB_OUTPUT;
drop public synonym MGMT_JOB_PARAMETER;
drop public synonym MGMT_JOB_SCHEDULE;
drop public synonym MGMT_JOB_TARGET;
drop public synonym MGMT_LOG;
drop public synonym MGMT_LONG_TEXT;
drop public synonym MGMT_MESSAGES;
drop public synonym MGMT_METRICS;drop public synonym MGMT_METRICS_1DAY;
drop public synonym MGMT_METRICS_1HOUR;
drop public synonym MGMT_METRICS_COMPOSITE_KEYS;
drop public synonym MGMT_METRICS_RAW;
drop public synonym MGMT_METRIC_COLLECTIONS;
drop public synonym MGMT_METRIC_ERRORS;
drop public synonym MGMT_METRIC_THRESHOLDS;
drop public synonym MGMT_NAME_VALUE;
drop public synonym MGMT_NAME_VALUES;
drop public synonym MGMT_PREFERENCES;
drop public synonym MGMT_SEVERITY;
drop public synonym MGMT_SEVERITY_ARRAY;
drop public synonym MGMT_SEVERITY_OBJ;
drop public synonym MGMT_STRING_METRIC_HISTORY;
drop public synonym MGMT_TARGET;
drop public synonym MGMT_TARGETS;
drop public synonym MGMT_TARGET_BLACKOUTS;
drop public synonym MGMT_TARGET_MEMBERSHIPS;
drop public synonym MGMT_TARGET_PROPERTIES;
drop public synonym MGMT_TYPE_PROPERTIES;
drop public synonym MGMT_USER;
drop public synonym MGMT_VIEW_UTIL;
drop public synonym MGMT$DELTA_ORACLE_HOME;
drop public synonym MGMT$DELTA_OS_COMPONENTS;
drop public synonym MGMT$DELTA_OS_COMP_DETAILS;
drop public synonym MGMT$DELTA_OS_KERNEL_PARAMS;
drop public synonym MGMT$DELTA_PATCHSETS;
drop public synonym MGMT$DELTA_PATCHSET_DETAILS;
drop public synonym MGMT$DELTA_TABLESPACES;
drop public synonym MGMT$DELTA_VENDOR_SW;
drop public synonym MGMT$DELTA_VIEW;
drop public synonym MGMT$DELTA_VIEW_DETAILS;
drop public synonym MGMT$ECM_CURRENT_SNAPSHOTS;
drop public synonym MGMT$ECM_VISIBLE_SNAPSHOTS;
drop public synonym MGMT$GROUP_DERIVED_MEMBERSHIPS;
drop public synonym MGMT$GROUP_FLAT_MEMBERSHIPS;
drop public synonym MGMT$GROUP_MEMBERS;
drop public synonym MGMT$HA_BACKUP;
drop public synonym MGMT$HA_FILES;
drop public synonym MGMT$HA_INFO;
drop public synonym MGMT$HA_INIT_PARAMS;
drop public synonym MGMT$HA_MTTR;
drop public synonym MGMT$HA_RMAN_CONFIG;
drop public synonym MGMT$HW_NIC;
drop public synonym MGMT$METRIC_COLLECTION;
drop public synonym MGMT$METRIC_CURRENT;
drop public synonym MGMT$METRIC_DAILY;
drop public synonym MGMT$METRIC_DETAILS;
drop public synonym MGMT$METRIC_HOURLY;
drop public synonym MGMT$MISSING_TARGETS;
drop public synonym MGMT$MISSING_TARGETS_IN_GROUPS;
drop public synonym MGMT$OS_COMPONENTS;
drop public synonym MGMT$OS_FS_MOUNT;
drop public synonym MGMT$OS_HW_SUMMARY;
drop public synonym MGMT$OS_KERNEL_PARAMS;
drop public synonym MGMT$OS_PATCHES;
drop public synonym MGMT$OS_SUMMARY;
drop public synonym MGMT$SOFTWARE_COMPONENTS;
drop public synonym MGMT$SOFTWARE_COMPONENT_ONEOFF;
drop public synonym MGMT$SOFTWARE_COMP_PATCHSET;
drop public synonym MGMT$SOFTWARE_DEPENDENCIES;
drop public synonym MGMT$SOFTWARE_HOMES;
drop public synonym MGMT$SOFTWARE_ONEOFF_PATCHES;
drop public synonym MGMT$SOFTWARE_OTHERS;
drop public synonym MGMT$SOFTWARE_PATCHES_IN_HOMES;
drop public synonym MGMT$SOFTWARE_PATCHSETS;
drop public synonym MGMT$TARGET;
drop public synonym MGMT$TARGET_COMPONENTS;
drop public synonym MGMT$TARGET_COMPOSITE;
drop public synonym MGMT$TARGET_PROPERTIES;
drop public synonym MGMT$TARGET_TYPE;
drop PUBLIC SYNONYM SMP_EMD_AVAIL_OBJ;
drop public synonym EMD_MNTR;
drop public synonym SMP_EMD_AVAIL_OBJ;
drop public synonym SMP_EMD_DELETE_REC_ARRAY;
drop public synonym SMP_EMD_INTEGER_ARRAY;
drop public synonym SMP_EMD_INTEGER_ARRAY_ARRAY;
drop public synonym SMP_EMD_NVPAIR;
drop public synonym SMP_EMD_NVPAIR_ARRAY;
drop public synonym SMP_EMD_STRING_ARRAY;
drop public synonym SMP_EMD_STRING_ARRAY_ARRAY;
drop public synonym SMP_EMD_TARGET_OBJ;
drop public synonym SMP_EMD_TARGET_OBJ_ARRAY;
drop public synonym ECM_UTIL;
drop role mgmt_user;


DROP USER sysman CASCADE;
DROP USER mgmt_view CASCADE;
DROP ROLE MGMT_USER;
ALTER USER dbsnmp ACCOUNT UNLOCK;
ALTER USER dbsnmp identified by dbsnmp;
DROP PUBLIC SYNONYM SETEMVIEWUSERCONTEXT;
DROP PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
DROP PUBLIC SYNONYM MGMT_AVAILABILITY;
DROP PUBLIC SYNONYM MGMT_CURRENT_AVAILABILITY;
DROP PUBLIC SYNONYM MGMT_SEVERITY_OBJ;
DROP PUBLIC SYNONYM MGMT_SEVERITY_ARRAY;
DROP PUBLIC SYNONYM MGMT_GUID_OBJ;
DROP PUBLIC SYNONYM MGMT_GUID_ARRAY;
DROP PUBLIC SYNONYM SMP_EMD_AVAIL_OBJ;
DROP PUBLIC SYNONYM SMP_EMD_TARGET_OBJ;
DROP PUBLIC SYNONYM SMP_EMD_TARGET_OBJ_ARRAY;
DROP PUBLIC SYNONYM SMP_EMD_DELETE_REC_ARRAY;
DROP PUBLIC SYNONYM MGMT_METRICS;
DROP PUBLIC SYNONYM MGMT_TARGETS;
DROP PUBLIC SYNONYM MGMT_TYPE_PROPERTIES;
DROP PUBLIC SYNONYM MGMT_TARGET_PROPERTIES;
DROP PUBLIC SYNONYM MGMT_METRICS_RAW;
DROP PUBLIC SYNONYM MGMT_CURRENT_METRICS;
DROP PUBLIC SYNONYM MGMT_STRING_METRIC_HISTORY;
DROP PUBLIC SYNONYM MGMT_LONG_TEXT;
DROP PUBLIC SYNONYM MGMT_METRICS_COMPOSITE_KEYS;
DROP PUBLIC SYNONYM MGMT_METRICS_1HOUR;
DROP PUBLIC SYNONYM MGMT_METRICS_1DAY;
DROP PUBLIC SYNONYM MGMT_METRIC_ERRORS;
DROP PUBLIC SYNONYM MGMT_CURRENT_METRIC_ERRORS;
DROP PUBLIC SYNONYM EMD_MNTR;
DROP PUBLIC SYNONYM MGMT_METRIC_COLLECTIONS;
DROP PUBLIC SYNONYM MGMT_COLLECTION_PROPERTIES ;
DROP PUBLIC SYNONYM MGMT_METRIC_THRESHOLDS;
DROP PUBLIC SYNONYM SMP_EMD_NVPAIR;
DROP PUBLIC SYNONYM SMP_EMD_NVPAIR_ARRAY;
DROP PUBLIC SYNONYM SMP_EMD_STRING_ARRAY;
DROP PUBLIC SYNONYM SMP_EMD_STRING_ARRAY_ARRAY;
DROP PUBLIC SYNONYM SMP_EMD_INTEGER_ARRAY;
DROP PUBLIC SYNONYM SMP_EMD_INTEGER_ARRAY_ARRAY;
DROP PUBLIC SYNONYM MGMT_DELTA_IDS;
DROP PUBLIC SYNONYM MGMT_DELTA_ID_VALUES;
DROP PUBLIC SYNONYM MGMT_DELTA_ENTRY;
DROP PUBLIC SYNONYM MGMT_DELTA_ENTRY_VALUES;
DROP PUBLIC SYNONYM MGMT_DELTA_VALUE;
DROP PUBLIC SYNONYM MGMT_DELTA_VALUES;
DROP PUBLIC SYNONYM MGMT_NAME_VALUE;
DROP PUBLIC SYNONYM MGMT_NAME_VALUES;
DROP PUBLIC SYNONYM ECM_UTIL;

DROP PUBLIC SYNONYM MGMT_DELTA;
DROP PUBLIC SYNONYM MGMT_TARGET_MEMBERSHIPS;
DROP PUBLIC SYNONYM MGMT_JOB;
DROP PUBLIC SYNONYM MGMT_JOB_PARAMETER;
DROP PUBLIC SYNONYM MGMT_JOB_TARGET;
DROP PUBLIC SYNONYM MGMT_JOB_SCHEDULE;
DROP PUBLIC SYNONYM MGMT_JOB_EXECPLAN;
DROP PUBLIC SYNONYM MGMT_JOB_EXEC_SUMMARY;
DROP PUBLIC SYNONYM MGMT_JOB_OUTPUT;
DROP PUBLIC SYNONYM MGMT_JOB_EXECUTION;
DROP PUBLIC SYNONYM MGMT_LOG;
DROP PUBLIC SYNONYM MGMT_ADMIN;
DROP PUBLIC SYNONYM MGMT_GLOBAL;
DROP PUBLIC SYNONYM MGMT_TARGET;
DROP PUBLIC SYNONYM MGMT_CREDENTIAL;
DROP PUBLIC SYNONYM MGMT_JOBS;
DROP PUBLIC SYNONYM MGMT_PREFERENCES;
DROP PUBLIC SYNONYM MGMT_USER;
DROP PUBLIC SYNONYM MGMT_SEVERITY;
DROP PUBLIC SYNONYM MGMT_CURRENT_SEVERITY;
DROP PUBLIC SYNONYM MGMT_PAF_PROCS_LATEST;
DROP PUBLIC SYNONYM MGMT_PAF_JOBS;
DROP PUBLIC SYNONYM MGMT_PAF$PROCEDURES;
DROP PUBLIC SYNONYM MGMT_PAF$INSTANCES;
DROP PUBLIC SYNONYM MGMT_PAF$STATES;
DROP PUBLIC SYNONYM MGMT_PAF$APPLICATIONS;
DROP PUBLIC SYNONYM MGMT_VIEW_UTIL;
DROP PUBLIC SYNONYM MGMT_MESSAGES;

3)create:
Command: emca -config dbcontrol db -repos create


]]>
鍚姩Oraclehttp://www.tkk7.com/jinfeng_wang/archive/2009/10/19/298889.htmljinfeng_wangjinfeng_wangMon, 19 Oct 2009 12:33:00 GMThttp://www.tkk7.com/jinfeng_wang/archive/2009/10/19/298889.htmlhttp://www.tkk7.com/jinfeng_wang/comments/298889.htmlhttp://www.tkk7.com/jinfeng_wang/archive/2009/10/19/298889.html#Feedback0http://www.tkk7.com/jinfeng_wang/comments/commentRss/298889.htmlhttp://www.tkk7.com/jinfeng_wang/services/trackbacks/298889.html
鍚姩瀹炰緥涓嶈杞芥暟鎹簱錛歋TARTUP NOMOUNT
鍦ㄤ笅闈㈢殑浠誨姟涓繀欏昏杞芥暟鎹簱鑰屼笉鐢ㄦ墦寮鏁版嵁搴?br /> 魛伜魛?閲嶅懡鍚嶆暟鎹枃浠?br /> 魛伜魛?娣誨姞鍙栨秷鎴栭噸鍛藉悕閲嶅仛鏃ュ織鏂囦歡
魛伜魛?鍏佽鍜岀姝㈤噸鍋氭棩蹇楀瓨妗i夐」
魛伜魛?鎵ц瀹屾暣鐨勬暟鎹簱鎭㈠鎿嶄綔



鍚姩瀹炰緥騫惰杞芥暟鎹簱錛歋TARTUP MOUNT
褰撻渶瑕佸畬鎴愪互涓嬩竴縐嶄換鍔℃椂浣跨敤榪欑鏁版嵁搴撳惎鍔ㄦā寮忥細
魛伜魛?鎵ц鏁版嵁搴撴暟鎹殑瀵煎嚭鎴栧鍏ユ搷浣?br /> 魛伜魛?鎵ц鏁版嵁瑁呰澆鎿嶄綔鐢⊿QL*Loader
魛伜魛?鏆傛椂闃繪涓鑸殑鐢ㄦ埛浣跨敤鏁版嵁
魛伜魛?鍦ㄦ煇涓Щ妞嶈繃紼嬪拰鍗囩駭鎿嶄綔榪囩▼涓?br />


涓哄疄渚嬭杞芥暟鎹簱錛欰LTER DATABASE MOUNT

鎵撳紑涓涓叧闂殑鏁版嵁搴擄細ALTER DATABASE OPEN

浠ュ彧璇繪ā寮忔墦寮鏁版嵁搴擄細ALTER DATABASE OPEN READ ONLY;

]]>
主站蜘蛛池模板: aa在线免费观看| 久久精品免费一区二区三区| 国产精品色拉拉免费看| 亚洲AV综合色区无码一区爱AV | 97在线观免费视频观看| 亚洲一区二区三区高清| 99在线观看视频免费| 亚洲黄色在线播放| 91成人免费观看网站| 亚洲精品国产精品国自产网站| 国产精品免费网站| 亚洲中文字幕AV每天更新| 日韩视频免费一区二区三区| 国产成人人综合亚洲欧美丁香花| 国产高清视频在线免费观看| 精品亚洲福利一区二区| 亚洲人午夜射精精品日韩| 两个人看的www免费| 色噜噜综合亚洲av中文无码| 美女网站免费福利视频| 亚洲日韩av无码中文| 免费v片在线观看品善网| 中文字幕a∨在线乱码免费看| 亚洲AV无码一区二区三区系列 | 免费观看无遮挡www的小视频| 亚洲国产成人久久| 日韩免费视频一区| 国产99视频精品免费视频76| 亚洲电影中文字幕| 四虎成人免费网站在线| 一级毛片高清免费播放| 夜夜亚洲天天久久| 免费看无码自慰一区二区| 一级一片免费视频播放| 久久久亚洲AV波多野结衣 | 亚洲国产高清在线一区二区三区| 国产精品无码永久免费888| 亚洲第一页在线观看| 国产免费131美女视频| 国产一精品一av一免费爽爽| 亚洲精品天堂在线观看|