Create The World With Creativity
 
Welcome, Guest:Log in | Register | Information Center | Languages | Search | Tags | FAQs | Lite
There was a problem with the request. Check your permission or contact with administrator.




Your Ad Here

Grade this thread

Quote Favorites Report
Starter:  Topic: : SQLTXPLAIN - generate complete SQL report
R.Wang 
5 Stars
 

Info: Moderator Offline Male
From: Not Specified 
Posts: 329  
Digest 0  
Credits: 59
Money: 1746 $OraclePoint
Registered on 2007-04-20
ProfileProfile BuddyBuddy PMPM Reply Reply QuotesQuotes   1 F 
SQLTXPLAIN - generate complete SQL report



SQLTXPLAIN is a tool that generates a comprehensive report about a SQL statement which has been provided as input to the tool. The report includes the explain plan for a given SQL statement, cost-based optimizer statistics for the objects accessed by the statement, and details of related objects. The output HTML report produced can be used to analyze and diagnose SQL performance issues (SQL tuning).
[url=http://www.oraclepoint.com]CMEgjwDYAOraclePointW7gpxDpbS[/url]


Unlike SQL statements "Explain Plan" and "Autotrace", SQLTXPLAIN offers complete environment and configuration reports relating the SQL we exmaines. The report is categorized as followings.
[url=http://www.oraclepoint.com]HYpQhl5mCOraclePointaxdZzpeWP[/url]



During the installation of SQLTXPLAIN, the following parameters will be asked for value.
[url=http://www.oraclepoint.com]RaoSwlycYOraclePoint2H1JPOzgw[/url]

  • Specify SQLTXPLAIN password:
  • Enter value for host_string: (For instance, it your db name is prod, then input @prod)
  • Enter value for application_schema: (the schema under which you examine sql statement)
  • Enter value for default_tablespace:
  • Enter value for temporary_tablespace:
The process of installation is quite straightforward. From my understanding, the complicated report offered is very helpful because SQL statements "Explain Plan" and "Autotrace" can only produce the explain plan. Mostly, we have to find other information to figure out performance issue of sql statemetn, such as constraints, column histograms, init parameter and so on.
[url=http://www.oraclepoint.com]aaZd2M8RCOraclePointmwZ3EzhWl[/url]

This tool is available at Metalink Note: 215187.1. Also,  take a look at  attached  doc about SQLTXPLAIN Overview.  

User Guide:
[url=http://www.oraclepoint.com]IKDhCLXMbOraclePointmB9YcZy7Q[/url]

  • XPLAIN Entry point -- @sqltxplain.sql [name of your file with one SQL]
  • XTRACT -- 1. find sql_id or hash_value in V$SQL or v$SQLTEXT (see following post)2. @sqltxtract.sql [hash_value or sql_id for one SQL]
  • XECUTE -- @sqltxecute.sql [name of your script with one SQL]
Also, see attached comprehensive report for XPLAIN entry point running.


[Lasted edited on 2008-07-02 15:34 R.Wang ]



Text attachment: SQLTXPLAIN.pdf (Size:687.6kb, Download times:44)
Attachment: sqlt_s6776_dwhse_xxx_xxx.html (Size:382.13kb, Download times:22)


Tags: utility 

2008-06-03 15:13
  Grade this thread
R.Wang 
5 Stars
 

Info: Moderator Offline Male
From: Not Specified 
Posts: 329  
Digest 0  
Credits: 59
Money: 1746 $OraclePoint
Registered on 2007-04-20
ProfileProfile BuddyBuddy PMPM Reply Reply QuotesQuotes   2 F 
find username of sql statement



When we use XTRACT entry point, we must be executing this script connected as
[url=http://www.oraclepoint.com]4iDgVcYZROraclePoint6v4E77l0I[/url]

the application user that executed original SQL. Therefore, finding owner of examining sql is necessary.

The following sql is good for doing that.
[url=http://www.oraclepoint.com]9LkkNi0q8OraclePointxmOyfx2CI[/url]


select     a.USERNAME, hash_value,    DISK_READS,
    EXECUTIONS,
[url=http://www.oraclepoint.com]TbhlWTeaPOraclePointbCPjAbKlo[/url]

    round(DISK_READS / decode(EXECUTIONS, 0, 1, EXECUTIONS)) "Reads/Execs",
    SQL_TEXT
from     dba_users a, v$session, v$sqlarea
[url=http://www.oraclepoint.com]tkVqY86MdOraclePointtEg2X8Z0U[/url]

where     PARSING_USER_ID=USER_ID
and     ADDRESS=SQL_ADDRESS(+)
and     DISK_READS > 1000
[url=http://www.oraclepoint.com]tdv05xOexOraclePointpoZUX0pEY[/url]

order      by DISK_READS desc, EXECUTIONS desc


[url=http://www.oraclepoint.com]n0kHspnkDOraclePointkAC5tfpsZ[/url]


2008-07-02 15:37
  Grade this thread
lodhi1978 
1 Star
 

Info: Capricorn Chinese Year of Horse (WuMa) Offline Male
From: Not Specified Pakistan
Posts: 2  
Digest 0  
Credits: 0
Money: 104 $OraclePoint
Registered on 2008-07-21
ProfileProfile BuddyBuddy PMPM Send EmailEmail Reply Reply QuotesQuotes   3 F 


The following was originally posted by R.Wang on  2008-07-02 15:37  :
[url=http://www.oraclepoint.com]74Qlhp66pOraclePointl0EO0oWsU[/url]

When we use XTRACT entry point, we must be executing this script connected as
the application user that executed original SQL. Therefore, finding owner of examining sql is necessary.
[url=http://www.oraclepoint.com]0TXkTZfC5OraclePointLuToqN6Sv[/url]

The following sql is good for doing that. .......

Hi all
[url=http://www.oraclepoint.com]lOqQ1qUFqOraclePoint0bYTbrqCB[/url]

I am executing sqltxecute.sql as follows
connect as application user (Schema Owner)
execute command as follows
[url=http://www.oraclepoint.com]GhDAsxUXeOraclePointhSxT4B0K3[/url]


SQL> @sqltxecute.sql
[url=http://www.oraclepoint.com]qe8WeYvy1OraclePointdf3elahmJ[/url]

Value passed to sqltxecute.sql:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SCRIPT_WITH_SQL: script1.txt
[url=http://www.oraclepoint.com]V8gzeynxrOraclePointpx2hdWe12[/url]


Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Producti
on
[url=http://www.oraclepoint.com]4lptELmixOraclePointCGZMbWsR2[/url]

With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
[url=http://www.oraclepoint.com]g5pOjdFH8OraclePointclxTfY0Pd[/url]



[url=http://www.oraclepoint.com]K2C95IXGjOraclePointuz1mWvSkU[/url]

I checked the log file and find following entry

ERROR at line 1:
[url=http://www.oraclepoint.com]vqbsIDgbiOraclePoint6byYlpajk[/url]

ORA-20200: *** SQL with tag /* &&unique_id */ could not be found in memory
ORA-06512: at line 3
[url=http://www.oraclepoint.com]i8rIsg0V3OraclePointundFZJhIR[/url]

would anybody plz help me why I am getting this error



Thanks

Hassan Raza

2008-07-21 02:12
  Grade this thread
lodhi1978 
1 Star
 

Info: Capricorn Chinese Year of Horse (WuMa) Offline Male
From: Not Specified Pakistan
Posts: 2  
Digest 0  
Credits: 0
Money: 104 $OraclePoint
Registered on 2008-07-21
ProfileProfile BuddyBuddy PMPM Send EmailEmail Reply Reply QuotesQuotes   4 F 
Script files which I am using are attached for your help
[url=http://www.oraclepoint.com]otJkK89wnOraclePointZWO9T6HCc[/url]


\
[url=http://www.oraclepoint.com]GXV1By7a8OraclePointdjPEN9OxJ[/url]

 

[url=http://www.oraclepoint.com]Lw6zMRELlOraclePointASocYCyPD[/url]

[Lasted edited on 2008-07-21 02:20 lodhi1978 ]



Text attachment: script1.txt (Size:2.76kb, Download times:7)
Text attachment: sql1.txt (Size:0.4kb, Download times:6)



Thanks

Hassan Raza

2008-07-21 02:16
  Grade this thread
R.Wang 
5 Stars
 

Info: Moderator Offline Male
From: Not Specified 
Posts: 329  
Digest 0  
Credits: 59
Money: 1746 $OraclePoint
Registered on 2007-04-20
ProfileProfile BuddyBuddy PMPM Reply Reply QuotesQuotes   5 F 
several points

The following was originally posted by lodhi1978 on  2008-07-21 02:16  :
[url=http://www.oraclepoint.com]LeloD1sRzOraclePoint7F0I259EM[/url]

Script files which I am using are attached for your help

[url=http://www.oraclepoint.com]CPyDhcf7eOraclePointULi8WCiBG[/url]

.......

Hi Hassan,
[url=http://www.oraclepoint.com]ZuYPrdO1VOraclePointJyZV2pJ5M[/url]

I checked with script1.txt attached and I'd like to suggest you to add semicolon for your sql statement in script1.txt. Without semicolon, the "SQL command not properly ended" will raise.

Please see below code for error you experienced.
[url=http://www.oraclepoint.com]maIHvUpsqOraclePointsRsyrcM7K[/url]


SELECT /* exclude myself */
      hash_value sql_hash_value, address sql_address, child_number sql_child_number,
[url=http://www.oraclepoint.com]qLABUzbqqOraclePointGzlTcCbjx[/url]

      sqltxplain.sqlt$r.session_trace_filename('10046_10053_&&execution_id' ) sql_10046_10053_trace,
      SUBSTR(sql_text, 1, 80) sql_text
 FROM v$sql
[url=http://www.oraclepoint.com]wOgd7xLvfOraclePointo9cyonyq8[/url]

WHERE sql_text LIKE '%&&unique_id%'
  AND sql_text NOT LIKE '%exclude myself%'
  AND ROWNUM = 1;
[url=http://www.oraclepoint.com]oHoUOe7h7OraclePoint90fvvuROr[/url]


If no row is selected by above sql statement, you absolutely experience this error. I doubt that you may have insufficient privilege to access v$sql. Therefore, go double check log file.
[url=http://www.oraclepoint.com]FZdlEcD3GOraclePointqrxoV6SqJ[/url]

I don't have oracle 9i database here and I'm unable to reproduce the problem you experienced. If you need more help, why don't you publish the log file here for my information.

[url=http://www.oraclepoint.com]wmqtkpPWbOraclePoint0oprtEKUJ[/url]

[Lasted edited on 2008-07-22 12:06 R.Wang ]


2008-07-22 12:04
  Grade this thread



Similar Threads Forum Author Replies Views Last Post
Compact DBA tool - Odat
Oracle Tools, Utilities & Scripts myDBA 1 1101  2010-04-12 11:15
Oracle's Block Browser and Editor tool
Oracle Tools, Utilities & Scripts outility 0 911  2009-10-09 12:45
Google Has Open Sourced Page Speed for Web Development
Enterprise Computing and Architecture R.Wang 0 1449  2009-06-10 15:06
The Top 75 Open Source Security Apps
Oracle Database Security R.Wang 0 1154  2009-04-01 16:36
DBMoto for Database Data Replication
Oracle Tools, Utilities & Scripts R.Wang 0 1127  2009-03-23 15:11

  Quick Response
Title:
Content:




Upload: Disable
Username:
Password:
  



Recommend to a friend Print Article Mode





 


Powered by BMForum Powered by BMForum 2007 5.6 RSS Feed  
Processed in 0.13081789 second(s),20 queries  
Top