Oracle Concurrent Program Running Long - oracle

Question.. I am not the DBA for my company but am I able to run a query to see what a program has completed and where its currently stuck on? I currently have one that has been running for almost 300 mins. The program is a seeded program named Create Accounting and Accounting Program. Just looking for any advice as I am not a DBA..
Oracle Applications : 12.1.3
I understand if this isn't an on topic questions, but I am actively searching the web. Thank you for any advice in advance

I'm not sure that's what you need. The following query will give you the currently running SQL. You can limit it to the username, SID module or action.
SELECT s1.username,
s1.sid,
s1.module,
s1.action,
s2.sql_id,
s2.sql_text
FROM v$session s1
JOIN v$sql s2
ON s1.sql_id = s2.sql_id;
Also have a look at DBMS_APPLICATION_INFO: SET_MODULE and SET_ACTION.

Related

Oracle 12c: SQL query hangs forever only occasionally

I have a SQL query that fetches roughly 200 columns from multiple tables and normally runs in a matter of minutes.
A Java program kicked off by cron calls the SQL every 4 hours, but occasionally hangs forever(=not fetching any data. Neither updates nor inserts are involved).
Here are some outputs from V$SESSION.
STATUS: ACTIVE
ROW_WAIT_OBJ#: 22392 ←not changing
ROW_WAIT_FILE#: 6 ←not changing
ROW_WAIT_BLOCK#: 8896642 ←not changing
ROW_WAIT_ROW#: 0 ←not changing
LAST_CALL_ET: 5632 ←keeps incresing
★No other heavy SQL queries are running at the same time
What could be the cause of this and what should I look into to solve it?
You can use TKPROF or SQL Profiler. This reports can help you. We can not replay your question now.
If you attach your tuning reports, we can help you. Because many things can cause performance problems. A comprehensive study is needed to understand this.
Follow this link;
https://docs.oracle.com/cd/E11882_01/server.112/e41573/perf_overview.htm

Stats in v$sqlarea over time gets lower

I wrote an application that queries oracle v$sqlarea and dumps data to my own database for further analysis. I noticed something very strange - sometimes data in the v$sqlarea shows less executions than before. I'm pretty sure that the oracle cache was not cleaned (the first load time of query is still the same, and since I query oracle each minute I dont believe that in this one minute the query was executed 100k+ times).
Can anybody explain how this is possible?
Ok, so I asked this on Oracle forum as well, and I believe that the correct answer is this one
https://community.oracle.com/message/12980175#12980175

informix query performance problem

The following SQL takes 62 seconds to return:
select getCreditBalance(Customerid)
from business_apply
where serialno = '20101013000005'
How to tune it?
Please tell me in detail.
I just want to know the steps I should do to tune it .
we use IDS 9.04 .
As in JDBC I cant see output with SET Explain ON
shall I execute query in dbaccess (with SET Explain on)?
My problem is I cant get execution plan ...If I can get it ,I will post it here.
You've not given us very much to work on.
Basic questions
What is the type of the column 'SerialNo'?
If it is a numeric column, don't quote the value you are searching for.
Is there an index on 'SerialNo'?
The index is important; the type is not so important.
Crucial question
What does the getCreditBalance() procedure do?
Auxilliary questions
Which version of Informix are you using? Is it IDS or SE or something else?
When did you last run UPDATE STATISTICS?
Is there a problem connecting to the database, or is it definitely just this query that is slow?
What language are you using to submit the query?
Are there any networks with huge latencies involved?
Which isolation level are you running at?
How big is the Business_Apply table?
What is the size of each row?
How many rows?
Which other tables are accessed by the getCreditBalance() procedure?
How big are they?
Do they have appropriate indexes?
What sort of machine is the Informix server running on?
What does the query plan tell you when you run with SET EXPLAIN on?
Is there any chance you've got a failing disk and the o/s is taking forever to read it?
Make sure there is an index on serialno and tune the code in the getCreditBalance function. Without knowing what that does, it's hard to give you any additional help.

Hibernate with Oracle JDBC issue

I have a select query which takes 10 min to complete as it runs thru 10M records. When I run thru TOAD or program using normal JDBC connection I get the results back, but while running a Job which uses Hibernate as ORM does not return any results. It just hangs up ...even after 45 min? Please help
Are you saying you trying to retrieve 10M records using an ORM like hibernate?
If this is the case you have one big problems, you need to redesign your application because this is not going to work, and about why it hangs up, well, I bet is because it runs out of memory.
Have you enabled SQL output for Hibernate? You need to set hibernate.show_sql to true in order to do that.
Once that's done, compare the generated SQL with the one you're been running through TOAD. Are they exactly the same or not?
I'm going to venture a guess here and say they're not because once SQL is generated Hibernate does nothing fancy - connection is taken from a pool; prepared statement is created and executed - so it should be no different from JDBC.
Thus the question most likely is how can your HQL be optimized. If you need any help with that you'll have to post the HQL in question as well as appropriate mappings / table schemas. Running explain on query would help as well.

Simplest way to get the number of calls to an MSSQL2000 Server

Does anyone know how one can get the total number of calls to an MSSQL2000 server during a specified time, let’s say 24 hours?
We want figures of how many calls our production machine gets per day, but we can’t find any good tools/strategies for this.
Best regards
Fredrik
You could use SQL Profiler?
http://technet.microsoft.com/en-us/library/aa173918(SQL.80).aspx
http://www.sqlteam.com/article/sql-server-2000-performance-tuning-tools
http://support.microsoft.com/kb/325263
I think using SQL Profiler here is overkill in this situation, particularly as it can create a substantial load on the server depending on what you trace. SQL Server exposes the raw values used for its performance counters via the sysperfinfo system table; you should just be able to run this query once each day and subtract the values to work out how many SQL requests you received for the day:
SELECT cntr_value
FROM sysperfinfo
WHERE object_name = 'SQLServer:SQL Statistics'
AND counter_name = 'Batch Requests/sec'
This will obviously only work if the server is up for the whole day; restarting will reset the number.
I sloved this another way (all calls are "routed" thru an IIS cluster and I where able to analyze their logs).
Thanx!

Resources