Top SQL: Application
Hi,
on 10g R2, in OEM (DB control) For Top SQL: Application I have :
Data for the chosen interval is not available.
Why ? Should I enable something or set a parameter ?
I have this setting :
SQL> show parameter STATISTICS_LEVEL
NAME TYPE VALUE
statistics_level string TYPICALThank you.
What database version are you using, what interval you asked the sql's for ?
Oded
[www.dbsnaps.com]
[www.orbiumsoftware.com]
Similar Messages
-
Top sql in java enterprise manager 10G
i,
in the java enterprise manager 9i, I could use 'top sql', 'top sessions' from the java applications.
I recently installed 10G enterprise manager client, and I now miss the top sql and top sessions apps.
I know that they are available in the web interface for enterprise manager 10G, but I can't use the webinterface right now. I would like to use the standalone java enterprise manager. How can I get the top sql in there?
Greetings,
Ivoanybody?
-
Dear DBAs
Application team has asked me to provide TOP Sql statements in testing database which can help them to improve code. Developer gave OEM top sql example from his last job.
Currently I do not have OEM installed. I am on 10.2.0.1.0 . I was thinking
to create a job to run sql and email everyday.
What sql can I use to generate that report ? What does OEM reports on when it show TOP Sql ?
ThanksOEM will show you TOP sql by different catogories (each of which can be sorted) such as:
Disk Reads Per Execution
Buffer Gets Per Execution
Executions
Disk Reads
Buffer Gets
Buffer Gets Per Row
Buffer Cache Hit Ration
Sorts
Shareable memory
Rows Processed
CPU Time
Elapsed Time
Now having said that....just because the TOP sql statement is the TOP sql statement does not mean that anything needs tuned. Your developers should be examining their SQL using insite gained from reading articles and documentation.
Tuning use explain plan:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:231814117467
SQL Tuning
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_1016.htm#sthref1061
Automatic SQL Tuning
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_tune.htm#g42443
In particular:
12.2.4 Using SQL Tuning Advisor with Oracle Enterprise Manager
These links should point you in the right direction:
Of course there are books and Oracle classes that concentrate on these issues as well.
Regards
Tim Boles -
ADDM Findings Top SQL Statements
Hi,
I have run addmrpt.sql for 1 month of time using snapshots and every ADDM report says that sql statement having id **** listed under top sql statements findings and recommendation is to tune using sql tunning advisor. It has 2-4 seconds elapsed time.But when i go through AWR report instance efficiency report and all are normal.
Can anyone please confirm whether I should recommend to tune this SQL statement to my vendor ?
Thanks,
TKbelow is the sql I found in ADDM. As I understood it is an intername SQL not an application SQL. When i searched it in internet found that it is related with check_oracle_health plugin. can you please help me to understand this nagios concept and the relationship it has with oracle software. And also how should I identify which methods we are using to monitor database internally?
SELECT
a.tablespace_name "Tablespace",
b.status "Status",
b.contents "Type",
b.extent_management "Extent Mgmt",
a.bytes bytes,
a.maxbytes bytes_max,
c.bytes_free + NVL(d.bytes_expired,0) bytes_free
FROM
-- belegter und maximal verfuegbarer platz pro datafile
-- nach tablespacenamen zusammengefasst
-- => bytes
-- => maxbytes
SELECT
a.tablespace_name,
SUM(a.bytes) bytes,
SUM(DECODE(a.autoextensible, 'YES', a.maxbytes, 'NO', a.bytes))
maxbytes
FROM
dba_data_files a
GROUP BY
tablespace_name
) a,
sys.dba_tablespaces b,
-- freier platz pro tablespace
-- => bytes_free
SELECT
a.tablespace_name,
SUM(a.bytes) bytes_free
FROM
dba_free_space a
GROUP BY
tablespace_name
) c,
-- freier platz durch expired extents
-- speziell fuer undo tablespaces
-- => bytes_expired
SELECT
a.tablespace_name,
SUM(a.bytes) bytes_expired
FROM
dba_undo_extents a
WHERE
status = 'EXPIRED'
GROUP BY
tablespace_name
) d
WHERE
a.tablespace_name = c.tablespace_name
AND a.tablespace_name = b.tablespace_name@@@@@@@@
AND a.tablespace_name = d.tablespace_name
UNION ALL
SELECT
d.tablespace_name "Tablespace",
b.status "Status",
b.contents "Type",
b.extent_management "Extent Mgmt",
sum(a.bytes_free + a.bytes_used) bytes, -- allocated
SUM(DECODE(d.autoextensible, 'YES', d.maxbytes, 'NO', d.bytes))
bytes_max,
SUM(a.bytes_free + a.bytes_used - NVL(c.bytes_used, 0)) bytes_free
FROM
sys.v_$TEMP_SPACE_HEADER a,
sys.dba_tablespaces b,
sys.v_$Temp_extent_pool c,
dba_temp_files d
WHERE
c.file_id(+) = a.file_id
and c.tablespace_name(+) = a.tablespace_name
and d.file_id = a.file_id
and d.tablespace_name = a.tablespace_name
and b.tablespace_name = a.tablespace_name
GROUP BY
b.status,
b.contents,
b.extent_management,
d.tablespace_name
ORDER BY
1 -
Designer6i: About Page template filename Web PL/SQL Applications
how can change the About Page template filename Web PL/SQL Applications
Thank!!!
my e-mail is: [email protected]Hi,
Have you upgraded Apex?
I assume you use XE EPG.
Have you grant execute privilege on procedure to DAD user ANONYMOUS?
GRANT EXECUTE ON WOLF_22.HELLO_WORLD TO ANONYMOUS;Have you changed wwv_flow_epg_include_mod_local that it allow execute WOLF_22.HELLO_WORLD?
And write schema.procedure at upper case to function.
If you have not upgraded Apex, run as SYS or SYSTEM
CREATE OR REPLACE function FLOWS_020100.wwv_flow_epg_include_mod_local(
procedure_name in varchar2)
return boolean
is
begin
-- Administrator note: the procedure_name input parameter may be in the format:
-- procedure
-- schema.procedure
-- package.procedure
-- schema.package.procedure
-- If the expected input parameter is a procedure name only, the IN list code shown below
-- can be modified to itemize the expected procedure names. Otherwise you must parse the
-- procedure_name parameter and replace the simple code below with code that will evaluate
-- all of the cases listed above.
if upper(procedure_name) in (
'WOLF_22.HELLO_WORLD'
) then
return TRUE;
else
return FALSE;
end if;
end wwv_flow_epg_include_mod_local;
/Regards,
Jari -
Top SQL by DB user in Oracle 10g DB Console
Is there a way to filter Top SQLs on 10g DB Console by a specific DB User? I know you can get all the SQLs by a specific user from Search Sessions, but it doesn't rank them by CPU usage. Any help is greatly appreciated.
nice idea, because SQL itself doesn't contain info about session executing it.
See Top SQL/Consumers
in OEM 10: goto Perfomance - Top Activity - here you can see Top SQLs (left side) and Top Sessions (right side) and ! if click on SQL ID from Top SQL you can see sessions executing it on Activity page. -
Prob in sql application forgotten paword
I dont have much idea how to set the sql.
i forgotten my password how i will set the pasword fro the sql application please tell me.got it prob is there only i am having only application acces not db.thats why cant login as sqlplus "/as sysdba"
-
Bug running Report 'Top SQL by Waits'
When I open Report 'Top SQL by Waits' in 'All Reports', 'Database Administration', 'Top SQL' I get an error message:
*'No query found for version of the selected database'*
After clicking OK and entering e.g. '30' for the bind variable 'minutes' I get
'ORA-00904': "SQL_ID": invalid identifier ....
It seems that there is no such report defined for Oracle 9.
I tried to start the report using versions 1.5.5 and 2.1.0.63 getting the same error message
Versions:
SQL Developer: Version 2.1.1.64
Build MAIN-64.39
I am on WIN XP SP3
Database is:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
"CORE 9.2.0.8.0 Production"
TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - ProductionWhen I open Report 'Top SQL by Waits' in 'All Reports', 'Database Administration', 'Top SQL' I get an error message:
*'No query found for version of the selected database'*
After clicking OK and entering e.g. '30' for the bind variable 'minutes' I get
'ORA-00904': "SQL_ID": invalid identifier ....
It seems that there is no such report defined for Oracle 9.
I tried to start the report using versions 1.5.5 and 2.1.0.63 getting the same error message
Versions:
SQL Developer: Version 2.1.1.64
Build MAIN-64.39
I am on WIN XP SP3
Database is:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
"CORE 9.2.0.8.0 Production"
TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production -
Blog: Image Caching in PL/SQL Applications
Blog: Image Caching in PL/SQL Applications
http://tylermuth.wordpress.com/2008/02/04/image-caching-in-plsql-applications/
Enjoy,
TylerAnyone? Or is it the wrong forum?
Alessandro -
Charting within Web-PL/SQL Application - advice required please
Currently trying to enhance our Designer generated Web-PL/SQL application by including charting.
There is no provision to do this within Designer so are exploring other solutions, specifically using a server side servlet to render a chart as a gif, returning this to the client HTML page.
Has anyone got any recommendations on what to use to do this?
We've tried with limited success calling the Portal servlet (called chart) due to lack of documentation and relience on certain Portal procedures. We're currently experimenting with Oracle Chartbuilder, which looks promising, but would really like to know what the recommended or favorite solution is!
Any feedback appreciated!
Anthonyuser645399 wrote:
Right now, I am displaying a table in the web by selecting all the records from a particular table.
This is how I do it.Not a great way to display a report. This is not re-usable code. Difficult to maintain. Difficult to add or change the presentation of data.
The proper way to do it, will be to use a DBMS_SQL cursor. After the cursor is opened, you use the describe function on the cursor that returns the number of columns in the cursor, the names of the columns, and their data types.
This data is then used to fetch a column value from the cursor, and render it (as per its data type). This can easily be extended to make use of reporting templates and defaults and even style sheets to make rendering easy and flexible.
DBMS_SQL is detailed in the [Oracle® Database PL/SQL Packages and Types Reference|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sql.htm#BABEDAHF] guide.
Should I include a search engine? or how should I go about it? Is there a way to break the table into smaller parts using the dealer id?Why not use APEX? The above method that I've described is what is employed by APEX. So instead of writing that yourself, having to deal with dynamic variable binding, pagination, web state and security and so on.. APEX does all of this, and more, for you. -
Emailing Top SQL report metrics
I have performance monitoring configured on a database using 10g Em grid control. Is there a mechanism through which I could email the 'Top SQL' page that we get to see using EM? Ideally I would like to come up with the sql that EM uses to get the top SQL for a particular 24 hour period. Based on what I found, most of the information is in perfstat.stats$sql_summary. Has anyone done this before, and if so, could you share the sql script.?
Thanks,
Sunil.Hello Alan,
Thank you very much for your answer. I implemented you solution as follows: I programmed a job exactly as you said and then I created a custom report which diplayed the 'output' column from mgmt$job_step_history. Unfortunately, although the 'output' column is CLOB and displays very nicely in any sql developing tool, when included in a report it seems that Information Publisher takes all the end-of-line out of it and thus it is displayed horribly, with no "enters"... Maybe if i used some pl/sql i would somehow manage to trick Information Publisher into displaying end-of-line characters...
In the end, i will use one of the two workarounds:
- program a job just like you said and set Grid control to notify me by email when succeded; this also includes the job's output, and so I can get the Top SQL reports via email. If more than one people would have to be notified by this, an email group would have to be set up by the email administrators in the company, and also a new user in grid control (a simple administrator with view privileges on the target, no super-user is necesary) with a notification rule that would send emails on succeed for the programmed job(s).
- send the output of the ADDM report per email from the target db - the grid control is no longer involved; the steps are:
select task_name tname from dba_advisor_tasks where created = (select max(created) from dba_advisor_tasks);
SELECT dbms_advisor.get_task_report('&addm_task_name', 'TEXT', 'TYPICAL') FROM dual;
Send the result by email. See Note 730746.1.
Thanks a lot,
Ana. -
Top sql elasped time, how true is that
hi guys,
i am viewing an addm report and is concern about a top sql activity.
i have an sql having top elasped time.
<i>
2,372 2,275 128,690,535 0.00 4.28 fphtjnquzzpud [email protected] (TNS V1-V3) SELECT USER_ID FROM SUBSCRIBER...
</i>
q1) what is the meaning of elasped time ?
the time taken per execution of an sql statement ?
q2) is the elasped time in the report shown above = sum of all the the elapsed time per execution of the sql ?
if that the case, the most/frequently i run a SQL statement, the higher the elasped time it will be and thus higher db time.
but how can we say that it is an inefficient sql since it has the most elasped time just because it is run way too frequently then other sqls ?
Please advise
Regards,
NoobHi,
It is
in the below addmrpt.sql the time which show 20393 is the elapsed time of the sql..
SQL statements consuming significant database time were found.
RECOMMENDATION 1: SQL Tuning, 24% benefit (20393 seconds)
ACTION: Run SQL Tuning Advisor on the SQL statement with SQL_ID
"9tkc7559d5drs".
RELEVANT OBJECT: SQL statement with SQL_ID 9tkc7559d5drs and
PLAN_HASH 1303522576But in awrrrpt.sql the elapsed time showing is for the total number of times the sql is executed in the DB.
^LSQL ordered by Elapsed Time DB/Inst: STEELP/STEELP1 Snaps: 13011-13012
-> Resources reported for PL/SQL code includes the resources used by all SQL
statements called by the code.
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Elapsed CPU Elap per % Total
Time (s) Time (s) Executions Exec (s) DB Time SQL Id
6,761 1,869 1 6761.3 11.2 4hsz1t5dsmhy4
Module: XXLOTDETSo check the addmrpt report.
thanks.
baskar.l -
Hi All,
I need to get TOP sql query in 11g Database.
I dont know about PT.
User will carry on some testing activity on the Database, i need to get the top sql from the database.
There is no access to AWR, ADDM and Entriprise console.
I need to get the output of the queries by executing some sql.
Can some body help me in this regards.
Thanking You
Pramodh>
Whether it is possible to get the full set of sql, i tried executing this it is gives the report part by part.
>
I am not sure what the problem is.
You get the top 5 SQL statements because of the "<6" part of the code. Would be top 10 if "<11" and so on.
Maybe you have got to format the output a little in SQL*Plus to get it better readable - I leave that up to you :-)
Kind regards
Uwe
http://uhesse.wordpress.com -
How to get top SQLs in a time period
HI, How can identify top SQL over a period of 1-month. Top SQL tab only displays top SQLs in last 24 hours in grid control.
NeerajAWR is your answer. Find the snapshots from Month old to current or what ever time you want and create a preserved snapshot set. and then create a report.
That will give you the top 10 sql with in that range.
AWR can be found under Adminstration tab.
Naren -
I'm trying to understand the difference vs TOP SQL statement vs. what is showing up in the longops table. I pull a report showing my top 25 SQL statements but yet when I look at the long ops table the statements taking more this 1 minute are different then what shows up as my top SQL.
What should I be spending my time tuning whats in the long ops or my top SQL statements?Top sql shows in the statspack or AWR report shows the top sql during the time period for which you run the report.
e.g if you run report for 4-5 pm,it will show the sql which consumes most resources(CPU,gets,reads etc)
V$session_longops This view displays the status of various operations that run for longer than 6 seconds (in absolute time). These operations currently include many backup and recovery functions, statistics gathering, and query execution, and more
operations are added for every Oracle release."You can also set rows in this view using the procedure dbms_application_info.set_session_longops"
By Jonatan Lewis
sqlexecprogression_cost with the description: "sql execution progression monitoring cost threshold" and the default value of 1,000
cost = 1000 equates to elapsed time = 6 seconds
Maybe you are looking for
-
I have a 2010 Macbook Pro and am a very new user to Mac community only started to use this PC a few weeks ago. My Mac is just hanging and I am unable to shut it down or do anything at all. I left it for 2.5 days hoping the battery will run flat but
-
I have a CMP 2.0 local entity bean, and when I try to create one from a session bean, I get this: java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 s
-
Importing business docs to iCloud
Hi all, I use MacBook Pro, iPad2 and iPhone 4S and want to use them in. A business environment, especially the iPhone and iPad. I have a bunch of business docs (sheets and docs etc.) already stored, and have Numbers on my iPad. I store my stuff in Dr
-
NoClassDefFoundError when starting weblogic
When I am running my weblogic 4.51 I get the error message: Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server. Can someone explain why please?
-
Bridge CS5 - creating thumbnails takes forever
I aleady read about Bridge CS5 being extremely slow. Yes, on my system it sometimes is slow, too. Sometimes it takes AGES to start up (not always), and the most annoying part is, it also takes AGES to create thumbnail previews even of a handful of JP