Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Using Oracle Trace Analyzer (trcanlzr.sql)


Using Oracle Trace Analyzer (trcanlzr.sql)
Dave Moore:  Author of Oracle Utilities
Oracle has provided another utility initially designed for performance tuning Oracle Applications.  Trace Analyzer is provided in the form of a PL/SQL package (TRCA$ ).  The Trace Analyzer utility is available via download on the Oracle Metalink web site.
How Oracle trace analyzer Works
Trace Analyzer requires that a one-time configuration be performed.  During this configuration, many objects are installed in the database to serve as a tracing repository. Once downloaded from Metalink and installed, a SQL script can be executed passing in the name of the trace file. 
Executing Oracle Trace Analyzer
First, tracing needs enabled at the appropriate level. For example, to provide maximum trace data, a Level 12 trace can be started for the current session:
SQL> ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 12';
After the session executes for enough time to gain needed data, the trcanlzr SQL script can be executed.  It requires the name of the directory object.  This object points to the physical operating system directory for the user_dump_dest.  The installation of the utility will automatically create the directory object required (named UDUMP).
SQL>@d:\trcanlzr.sql UDUMP asg920xr_ora_13033.trc
Once executed, the output will be displayed on the screen and a spool file is created.
Is Oracle trace Analyzer better than tkprof?
Traditionally, tkprof has been the best tracing diagnostics tool available.  That is, until the introduction of Trace Analyzer which is everything tkprof is and more.   However, as of version 10.2, the Trace Analyzer utility is still not shipped with the Oracle DBMS like tkprof.  
Given access to both utilities, Trace Analyzer has the following advantages:
1.   Trace Analyzer provides the actual values of the bind variables in SQL.  N


Ïà¹ØÎĵµ£º

Oracleѧϰ±Ê¼Ç5 JDBC²Ù×÷Oracle

ÓÃJavaÀ´²Ù×÷Êý¾Ý¿â£¬ÓÐÈçϼ¸ÖÖ·½Ê½£º
1JDBC-ODBCÇÅ£ºODBCÊý¾ÝÔ´ÔÚ²Ù×÷ϵͳ²ãÃæ¸øÓèÁËÖ§³Ö£¬ÎÒÃÇ¿ÉÒÔ²»ÓÃÁ˽âµ×²ãµ½µ×ÊÇ·â×°µÄÄÄÖÖÊý¾ÝÔ´£¬Ò²ÕÕÑù¿ÉÒÔÍê³É¶ÔÊý¾ÝµÄ²Ù×÷¡£µ«ÊÇËüÓÐÆ½Ì¨ÒÀÀµÐÔ£¬²»Ì«ÍƼöʹÓá£
2Javaµ½±¾µØAPI
3Javaµ½ÍøÂçЭÒé
4Javaµ½Êý¾Ý¿âЭÒ飺ËÙ¶È×î¿ì
Á¬½ÓÊý¾Ý¿â¿ÉÒÔ·ÖΪËIJ½£º
A¼ÓÔØÇý¶¯³ÌÐò£¨Ï ......

Oracle±£´æ´ó¶ÔÏóBLOB

×î½üÔÚʹÓÃOracle×öÎļþÉÏ´«£¬ÒªÇó½«ÎļþÊý¾Ý±£´æµ½Êý¾Ý¿âÖС£OracleÌṩÁËBlobÓÃÀ´´æ´¢¶þ½øÖÆ´ó¶ÔÏóÊý¾Ý£¬¿ÉÊÇËüºÍJava.sqlÀïÃæµÄBlob²»¼æÈÝ£¬¾­³£µ¼ÖÂBlob×Ö¶ÎÎÞ·¨Ëø¶¨»òÕß²Ù×÷ʧ°Ü¡£ÓÉÓÚÒÔǰûÓÐ×ö¹ýÕâÑùµÄÀý×Ó£¬ËùÒÔ»¨Á˲»ÉÙʱ¼ä²Å½â¾ö¡£
ÎÒʹÓõÄÊÇstruts2.1.8+spring2.5+hibernate3.2£¬ÏÂÃæÊÇÏà¹Ø´úÂ룺
springÅäÖÃ ......

OracleÊý¾Ý¿âÌá¸ßÃüÖÐÂʼ°Ïà¹ØÓÅ»¯

1)Library CacheµÄÃüÖÐÂÊ:
.¼ÆË㹫ʽ:Library Cache Hit Ratio = sum(pinhits) / sum(pins)
SQL>SELECT SUM(pinhits)/sum(pins)    from V$LIBRARYCACHE; 
ͨ³£ÔÚ98%ÒÔÉÏ£¬·ñÔò£¬ÐèÒªÒª¿¼ÂǼӴó¹²Ïí³Ø£¬°ó¶¨±äÁ¿£¬ÐÞ¸Äcursor_sharingµÈ²ÎÊý¡£
2)¼ÆËã¹²Ïí³ØÄÚ´æÊ¹ÓÃÂÊ:
SQL>SELECT ......

һЩoracleµÄÃüÁî¼°º¯Êý °üÀ¨decodeµÈ


 1¡¢set linesize 100;  ÉèÖó¤¶È   
 2¡¢set pagesize 30;   ÉèÖÃÿҳÏÔʾÊýÄ¿   
 3¡¢em a.sql  ´ò¿ª¼Çʱ¾     
 4¡¢@ a Ö´ÐÐÎļþaÖеĴúÂ룬¿ÉÖ¸¶¨ÎļþµÄ·¾¶ @d:a.txt ......

ά»¤Oracle³£ÓÃSQLÓï¾ä

       ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
¡¡¡¡select * from v$version;
¡¡¡¡²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
¡¡¡¡select sum(bytes)/(1024*1024) as free_space,tablespace_name
¡¡¡¡from dba_free_space
¡¡¡¡group by tablespace_name;
¡¡¡¡SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ