Longrunning jobs/Queries in oracle
Hi ,
How to find long running jobs/queries which are executing less than 6 seconds.
The primary criterion for any operation to appear in v$session_longops is to run more than 6 seconds. I want to find out the queries which are executing more than 1 seconds.
Please suggest.
Thanks in advance.
-Surya
884629 wrote:
I agree with you but still at any point of time if we want to find out the queries which are running more than 4 secs(may be because lot of resources issue) then how we can find out? I hope we can not say 'Its meaningless'.It is totally meaningless. You even originally said you want to look at queries running longer than 1 second for problem queries. Now you want to look at queries running more than 4 seconds for problems.
So are 1 sec queries okay now? And 4+ sec queries not? What made you decide that?
You do not know where to draw the line as you do not where the problem is. A sub-second query can be non-optimally written. A 1 hour query can be optimally written.
So what does the query's time tell you? How can you look at the time and say "+Yep, this 2 second query is okay and this 4 second query needs further investigation+".?
What about the SAME query that gives DIFFERENT execution times? You have very conveniently chosen to ignore this basic behaviour of queries in Oracle. For example:
SQL> select count(*) from all_objects;
COUNT(*)
69465
Elapsed: 00:00:04.96
SQL> select count(*) from all_objects;
COUNT(*)
69465
Elapsed: 00:00:02.88So is the 1st query bad as it is almost 5 seconds? And the 2nd query good as it just over 2 seconds? Where do you draw the line using execution time? And what about the same query falling in falling into both good and bad query time regions?
In Oracle® Database Performance Tuning Guide, section 1.1.2.1 Performance Principles, it says:
+"Tuning is driven by *identifying the most significant bottleneck* and making the appropriate changes to reduce or eliminate the effect of that bottleneck."+
So how do you identify the most significant bottleneck? By looking at something as variable and inconsistent as query time? You are wrong if you think that.
Similar Messages
-
How to Prepare for a Job Interview of Oracle DBA ?
How to Prepare for a Job Interview of Oracle DBA ?
Like, What books, PDF's, Websites to refer to get selected for the post of Oracle DBA.
Edited by: sdmuzdba on Mar 25, 2009 7:10 PM
Edited by: sdmuzdba on Mar 25, 2009 7:13 PM
Edited by: sdmuzdba on Mar 25, 2009 7:24 PMsdmuzdba wrote:
How to Prepare for a Job Interview of Oracle DBA ?
Like, What books, PDF's, Websites to refer to get selected for the post of Oracle DBA.
Well , you won't go for shopping when there are already guests in your home , will you? In case, that didn't make much sense, I meant that you won't start reading books, pdfs, looking at websites when you are going to have an interview already scheduled for you. I can bet my money( whatever little I have) that even doing this, won't bring you any good. If your question directly or indirectly is related to the questions that the interviewer may ask, once again, this would be a total wrong approach to go for an interview. In almost no time, it can be find out whether you are speaking some crammed line or from yourself. I had a chance to sit on the other side of the hot seat and the guy in front of me was giving all teh bookish answers. I twisted the questions and I was sure that he must have not read them anywhere, guess what happened. he started fumbling and finally gave up.
Interview is what you know, what you have done so far. Its not to start picking up LOTS of books, looking for the questions/answers and just think that the interview will happen from that only. I have some questions whose answers, at least the complete answers , you won't find anywhere. My suggestion is to just go for the interview, be honest about what you know and more about , what you don't know. You haven't committed a crime by not knowing some thing. I know nothing and I am never scared from the interviews ;-) .
Not sure that did help or not but still, best of luck.
Aman.... -
JDBC issue while calling queries in oracle- urgent
Hi !
Theres a peculiar problem being faced while calling queries(SQL statements having join of more than 2 tables) in oracle database. We are using JDBC thin driver.
We are calling SQL statements from stateless session EJBs deployed in weblogic app server and using connection pool facility to connect to oracle database.
Now, the issue is that select queries having more then 2 tables run fine & give proper result in java but when we see trace in oracle by setting sql_trace to true.. we see some column rowid added as first column selected in such queries and oracle shows such queries to be failed.
Can anyone tell why & how & who adds this rowid ?
Has anyone faces such a problem ?
regards'Am I right in you saying that the data is returned to the app server, but the database is saying it's not???
Veeeeeerrrry strange.
...I mean, if I understand you right, then I have to ask if you're sure that's what's actually happening.
Can anyone tell why & how & who adds this rowid?...and that you're sure you're not adding this yourself in the join?
...since (you imply) you're not using entities, just sql queries against the datasource connection, did you try running that query direct against the database?
...and... oh never mind.
hth
/k1 -
Running Stacked Queries in Oracle SQL Developer
Is it possible to run stacked queries in Oracle SQL Developer???
Something like this...
SELECT *
FROM TABLE_1
SELECT *
FROM TABLE_2
SELECT *
FROM TABLE_3
And give my 3 different result sets in my Query Result window
I tried "BEGIN" and "END" and Oracle SQL Developer did not seem to like it.
Can someone let me know if this is possible and what the syntax might be???
Thanks in advance for your review and am hopeful for a reply.
PSULionRPWrong forum!
Please post this in the sql developer forum.
SQL Developer
You can run multiple queries exactly the way you posted them but you need to use F5 - the run script toolbar button. -
Entry level jobs for recent oracle 8i dba with no experience
how to find a entrylevel job with a oracle 8i
dba certificate. help.CURRICULUM VITAE
RAMESH KUMAR KANDHAGATLA
H.No. - 48/C, Vengal Rao Nagar
S.R. Nagar (POST)
Hyderabad 500038
Andhra Pradesh, INDIA.
PHONE : + 91 - 040 3812229
E-mail: [email protected], [email protected], [email protected]
CAREER OBJECTIVE To obtain a position in Software Development in Professional
environment to utilize skills and acquire a position of
responsibility.
EDUCATIONAL QUALIFICATION Bachelor of Science from Osmania University, Hyderabad,
March/April 1993.
Post Graduate Diploma in Computer Applications.
COMPUTER SKILLS :
OPERATING SYSTEM : Windows 95, MS-Dos
LANGUAGES : C, C++, JAVA
RDBMS : Oracle 9.0
DBMS : DogPro
Frontend Tools : Developer 4000, Forms 9.5, Reports 9.5
GUI's : Visual Basic 9.0, Java, Advanced Java (EXB, XHl/OOAD, Uml, RIM,
CORBA) Servlets, Weblogic.
PROJECTS UNDERTAKEN
#1. Title : Automobile Pricing System
Hardware : Pentium
Operating System : Windows95
RDBMS : Oracle
Front-end : Developer 2000
GUIS : Visual Basic
Team Size : 3
Role : Programmer, Coding
Duration : 2 months
Description : This project deals with Sales Flow. It contains Invoice Details, Branch
Details, Manufacturer Details, Price Table, and Discount Details. It gives us
idea of flow of how customer selects a car, which model, cost of the car and
the list of sales are prepared and making the invoices and generating reports.
#2. Title : Banking Sextem
Hardware : Pentium
Operating System : Windows95
RDBMS : Oracle
Front-end : Developer 2000
GUIS : Visual Basic
Team Size : 3
Role : Programmer, Coding
Duration : 2 months
Description : This project deals with Banking System that has Saving Account,
Current Account, that keeps track of the Customer Transactions,
Opening of New Accounts, Closing the existing Accounts,
Maintaining minimum Balance Amount, withdrawals and Generating
reports like customer Report, Dealing Transaction Report, Monthly
Transaction report.
LIVE PROJECT
Title : Financial Accounting
Hardware : Pentium
Operating System : Windows2000
RDBMS : JAVA
Front-end : C++
GUIS : Visual Basic
Team Size : 2
Role : Programmer, Coding
Description : This project deals with General Ledger Type, Ledger Group, Ledger
Accounts, SL Accounts, Voucher Master, Voucher Entry Screen, Voucher
Details, Voucher Head ( ref Type, Ch no). How to perform Validations,
checking the total amount.
PERSONAL PROFILE :
FATHER'S NAME : K.V.B. Gupta
DATE OF BIRTH : 31st March, 1974
NATIONALITY : Indian
GENDER : male
MARITAL STATUS : unmarried
PASSPORT NUMBER : C69867452
( K. RAMESH KUMAR )
null -
Doubt's regarding the Hierarchial Queries in Oracle
Hi,
i have a doubt regarding the Hierarchial Queries in Oracle.
SELECT * FROM TMP_TEST;
ID NUMVAL STRVAL
1 100 Hello
1 -100 World
2 1 Concatenate
2 2 In String
2 3 using Connect By
2 4 Using SYS_CONNECT_BY_PATH
i am clear with my execution of IN_Line view (mechanism how it work's) .
But i have also read about the Hierarchial queries in the Oracle product documentation's. i am also aware of the
SYS_CONNECT_BY_PATH , LEVEL & START WITH , CONNECT BY Keywords.
But i couldnot able to Manually work out as how this below Query works.
Can you please explain me how this Hieracial query works ?
SELECT ID, (SYS_CONNECT_BY_PATH(STRVAL,',')),LEVEL
FROM
SELECT ID,STRVAL,ROW_NUMBER() OVER(PARTITION BY ID ORDER BY ID) RNUM,
COUNT(*) OVER(PARTITION BY ID ORDER BY ID) CNT,NUMVAL
FROM TMP_TEST
START WITH RNUM = 1
CONNECT BY PRIOR RNUM = RNUM - 1
Many Thanks,
Rajesh.Hi, Rajesh,
My first message was in response to your first message.
In your latest message, the query is:
SELECT ID, (SYS_CONNECT_BY_PATH(STRVAL,',')),LEVEL
FROM (
SELECT ID,STRVAL,ROW_NUMBER() OVER(PARTITION BY ID ORDER BY ID) RNUM,
COUNT(*) OVER(PARTITION BY ID ORDER BY ID) CNT,NUMVAL
FROM TMP_TEST
WHERE RNUM = CNT
START WITH RNUM = 1
CONNECT BY PRIOR RNUM = RNUM - 1;It looks like you lost the second CONNECT BY condition:
AND PRIOR ID = IDPut it back: it's important.
Now you're confused about the output row:
2 ,Hello,World,using Connect By,Using SYS_CONNECT_BY_PATH 4It doesn't seem to correspond to anything results that you got when you ran the sub-query alone.
That's because the resutls from your sub-query may change every time you run it, even though the data doesn't change. The ORDER BY clauses in both of the analytic functions do not result in a complete ordering. In fact, they're completely meaningless. It never makes any sense to PARTITON BY and ORDER BY the same value; "PARTITION BY id" means that only rows with the same id will be compared to each other; you might as well say "ORDER BY 0" or "ORDER BY dmbs_random.value".
The ORDER BY clause of ROW_NUMBER whould reflect that way in which you want the results to appear within each id, for example:
ROW_NUMBER () OVER (PARTITION BY id ORDER BY UPPER (strval))Note that this is very similar to what was in my first reply.
In the COUNT function, why do you want an ORDER BY clause at all? Just say:
COUNT (*) OVER (PARTITION BY id) -
Can I get job after doing Oracle certification at this age?
Hi
I am 37 yrs old man from Calcutta,India. I am presently jobless for 3 years now .I am a BSc(PCM) . I was earlier working as a salesman in a sales based company. I have no experience in IT though I have done lots of IT courses. Can I get job after doing Oracle certification at this age?
Please advice.
RegardsCan I get job after doing Oracle certification at this age?
Can you get a job if you become certified in Oracle? Certainly!
Will you get a job if you become certified in Oracle? Who knows?
Professional certifications are not magic wands. You cannot wave a certificate and cause employers to come running to hire you. Certifications can help you to learn some of the skills required to administer Oracle, or develop in Oracle, or use various Oracle software products. There are companies that need people with this knowledge. I have written a number of articles about the topic:
Oracle Certification Prep: What is Certification?
Oracle Certification Prep: Oracle Certified but not Oracle Employed
Oracle Certification Prep: I know nothing about Oracle... but I want to be a DBA.
DBA or Developer? Deciding which one suits you best - Certification Magazine
If you decide to pursue a certification, you can find materials to help you study here:
Oracle Certification Prep -
How to schedule jobs for brtools/oracle on EP
How to schedule jobs for brtools/oracle (Update statistics
Chech db
Db verify
) on an EP system where as no tool for java to do that (like db13). How to invoke it with cron?In Brtools you can always see the "Command line" before executing an action, You can simply copy that and use it to run BRTOOLS command from prompt, You can make a script with it and schedule via Cron.
Regards
Juan -
How to write Inline queries in Oracle 10g
Hi all,
The following Procedure is written in SQL Server 2005 . It uses Inline queries and executes it in the end . I want to write the same stored procedure in Oracle 10g.
Could you guys please help me in doing the same .
CREATE PROCEDURE [dbo].[proc_MDM_ShowDetails]
@MASTERCODE VARCHAR(50),
@MDMCode VARCHAR(50),
@IsDrpDwnFill BIT,
@CntryCode INT,
@StateCode INT,
@CityCode INT = 0,
@GetParent INT = 0,
@PinCode BIT = 0
AS
BEGIN
DECLARE @strSQL VARCHAR(4000)
DECLARE @TableName VARCHAR(4000)
SET NOCOUNT ON;
SELECT @TableName = MASTER_TABLE FROM MDM_MASTER WHERE MASTER_CODE=@MASTERCODE
IF @IsDrpDwnFill = 0 AND @CntryCode = 0 AND @GetParent = 0
BEGIN
SET @strSQL = 'SELECT M.*,H.* FROM ' + @TableName + ' M LEFT JOIN MDM_HIERARCHY H ON M.MDM_MASTER_CODE=H.MASTER_CODE WHERE M.MDM_CODE=' + @MDMCode
END
ELSE IF @CntryCode = 0 AND @IsDrpDwnFill = 1
BEGIN
SET @strSQL = 'SELECT MDM_DESCRIPTION,MDM_CODE FROM ' + @TableName + ' WHERE MDM_STATUS=' + '''' + 'approved' + '''' + ' AND MDM_EXIST=1'
END
ELSE IF @CntryCode > 0 and @GetParent = 0
BEGIN
SET @strSQL = 'SELECT M.MDM_DESCRIPTION,M.MDM_CODE,H.* FROM ' + @TableName + ' M INNER JOIN MDM_HIERARCHY H ON M.MDM_MASTER_CODE=H.MASTER_CODE WHERE MDM_STATUS=' + '''' + 'approved' + '''' +
' AND MDM_EXIST = 1 AND MDM_PARENT_CODE =' + str(@CntryCode)
END
ELSE IF @StateCode > 0 and @GetParent = 0
BEGIN
SET @strSQL = 'SELECT MDM_DESCRIPTION,MDM_CODE FROM ' + @TableName + ' WHERE MDM_STATUS=' + '''' + 'approved' + '''' +
' AND MDM_EXIST = 1 AND MDM_PARENT_CODE =' + str(@StateCode)
END
ELSE IF @CityCode > 0 and @GetParent = 0
BEGIN
SET @strSQL = 'SELECT MDM_DESCRIPTION,MDM_CODE FROM ' + @TableName + ' WHERE MDM_STATUS=' + '''' + 'approved' + '''' +
' AND MDM_EXIST = 1 AND MDM_PARENT_CODE =' + str(@CityCode)
END
ELSE IF @PinCode = 1 and @GetParent = 0 and @IsDrpDwnFill = 1
BEGIN
SET @strSQL = 'SELECT MDM_DESCRIPTION,MDM_CODE FROM ' + @TableName + ' WHERE MDM_STATUS=' + '''' + 'approved' + '''' +
' AND MDM_EXIST = 1 '
END
ELSE IF @GetParent > 0
BEGIN
SET @strSQL = 'SELECT * FROM ' + @TableName + ' WHERE MDM_STATUS=' + '''' + 'approved' + '''' +
' AND MDM_EXIST = 1 AND MDM_CODE =' + str(@GetParent)
END
EXEC(@strSQL)
SET NOCOUNT OFF;
END
Thanks
ShobhitHi,
I dont know sql server 2005. But by observing it I feel you are generating sql dynamically based on condition inside the proc.
DECLARE
TYPE EmpCurTyp IS REF CURSOR;
emp_cv EmpCurTyp;
emp_rec employees%ROWTYPE;
sql_stmt VARCHAR2(200);
v_job VARCHAR2(10) := 'ST_CLERK';
BEGIN
sql_stmt := 'SELECT * FROM employees WHERE job_id = :j';
OPEN emp_cv FOR sql_stmt USING v_job;
LOOP
FETCH emp_cv INTO emp_rec;
EXIT WHEN emp_cv%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Name: ' || emp_rec.last_name || ' Job Id: ' ||
emp_rec.job_id);
END LOOP;
CLOSE emp_cv;
END;something like this it will be. it is in oracle documentaion
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/dynamic.htm#i14500 -
How to see job section in "Oracle SQL Developer"
Hi,
I am using oracle SQL developer to connect to oracle instance unlike procedure,tables,views i am not able to see job section (we have can see in toad as job section) please help me to get locate the same.There's no support for jobs yet. Vote on the existing feature requests at the SQL Developer Exchange if you want to add weight for future implementation.
If you have trouble handling them manually, you can always ask help on the SQL And PL/SQL forum...
Thanks,
K.
Edited by: -K- on 20/05/2009 12:27:
BTW, there are some job reports (Reports - All Reports - Data Dictionary Reports - Jobs), but those will list only DBMS_JOB stuff, not the DBMS_SCHEDULER ones.
You can also create your own reports and/or User Defined Extensions to add a Jobs node inside the connection navigator, but that's for more advanced users... -
Error in job execution in oracle reports
Hi,
The end user is getting the following error when executing a job in Oracle reports.
" RWCGI GET JOB OUTPUT
Cannot get output of Job ID 4 you requested on December ,08 2008 , 11:35:18
Job is not done yet .Try again later"
Can you please help .PLEASE !!!Hi
Metalink is reporting some similar errors, please see that:
Cause
SSO turned on for one component only, either Forms or Reports.
This problem has been reported and is documented in an unpublished bug.
Solution
To take advantage of SSO, out-of-the-box, the SINGLESIGNON parameter in the
rwservlet configuration file (rwservlet.properties) is set to YES to indicate
that you will use single sign-on to authenticate users. You may change this to
NO if you choose to not use single sign-on. If you choose NO, the Reports
Server will use its own authentication mechanism to authenticate users (i.e.,
the mechanism used in Reports6i). The rwservlet configuration file is usually
found in the ORACLE_HOME\reports\conf directory. This value is usually
commented out after installation however the default value is YES.
This is the expected behavior. For the Forms/Reports integration, Forms will send
to Reports thecurrent SSO user. However, with this particular configuration, you
still log into SSO to run Reports. Thus, nexttime you run the form, you are logged
into SSO and thus things work because Forms passes thatSSO user info to Reports.
The way to not have the report run the 2nd time would be to log off of SSO when the first
form was exited, but that defeats the purpose of SSO in the first place!
So enable for Forms and Reports SSO or disable SSO for both.
Read more on Doc ID: Note:289666.1
Subject: REP-52251: Cannot Get Output Of Job Id
Doc ID: Note:289666.1
Subject: Understanding Reports Execution from Forms Under High Availability
and
Note 367887.1 - Rep-52251: Cannot Get Output Of Job Id You Requested, When Calling Reports From Forms -
Running Multiple queries in Oracle 10g Express Edition! Help Me!
I am new to Oracle 10g Express Edition.
I used my browser to navigated to http://127.0.0.1:8080/apex
I saw the database page.. logged in.. went into the SQL section.. now am not able to run two or more queries at the same time.. i have given a screenshot too. Plz.. check it and reply me quickly..
http://i71.photobucket.com/albums/i149/prasanna7287/546895215.jpg
Help me plz..
Prasanna.There are two possibilities:
1) Run the SQL commands, one command at a time;
2) Create a script of multiple commands, and run the script.
These are discussed in some detail in the online documentation at http://www.oracle.com/pls/xe102/homepage
In particular, look at
http://download-east.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25108/xedev_sql.htm#BJEIEIFJ
Message was edited by:
Hans Forbrich
No ... wait ... please do not read the documentation! <g> -
Can join queries in Oracle 8i and above span multiple databases
Hi,
In Oracle 8i and above, can join queries span multiple databases??
For eg., I have two databases A and B, and say database A has table A_T and
database B has table B_T. Assume that both the databases are on the same
server.
Can I run a join query from my application using OCI calls that spans across
tables from multiple databases, namely, A_T and B_T?
My query probably looks like this - Select * from A.A_T, B.B_T;
Thank you,
SashiIn Oracle 8i and above, can join queries span multiple databases??
For eg., I have two databases A and B, and say database A has table A_T and
database B has table B_T. Assume that both the databases are on the same
server.
Can I run a join query from my application using OCI calls that spans across
tables from multiple databases, namely, A_T and B_T?
My query probably looks like this - Select * from A.A_T, B.B_T;If you create a database link from database A to B your SQL would look something like this:
select * from A.A_T, B.B_T@dbB where A.A_T.PK = B.B_T.PK@dbB
The Oracle manuals should have the information you need on creating a database link. -
XML queries in ORACLE 10gR1 vs ORACLE 10gR2
Hi
in the research project where I'm involved in, we have two databases. One is the test database, upgraded recently in ORACLE 10gR2 and the production database in ORACLE 10gR1.
We have the same table with the same data in both test and production database.
I can run successfully the query and get result in test db ORACLE 10gR2:
SELECT XMLQuery('declare namespace
mpeg7="urn:mpeg:mpeg7:schema:2001";for $i in /mpeg7:Mpeg7
return $i' PASSING xmlcolumn RETURNING CONTENT) FROM
XMLTable WHERE existsNode(xmlcolumn,
'//@id="2005"',
'xmlns="urn:mpeg:mpeg7:schema:2001"') = 1;
but if I try the same query in production db ORACLE 10gR1, I get the error
return $i' PASSING xml_column RETURNING CONTENT) FROM
FEHLER in Zeile 3:
ORA-00907: missing right parenthesis
Is there any difference in the queries syntax between R1 and R2?
What should I change in my query?
Please help. I’m really facing with some problems with XML storage and retrieve.
Any kind of help will be appreciable
Best regards,
EvanelaHi Evanela,
XQuery is available from 10gR2 and higher - the XQuery functionality
is just not available in 10gR1 ...
Does this help ...?
-Carsten -
Hi,
how to get top 10 queries.. then which query is cosuming more cpu.I would suggest using statspack (free of cost ! ) and using SQL ordered by gets section to find the top queries consuming maximum CPu. To read about it more refer to performance tuning guide in 9i docs or check spdoc.txt in oracle-home/rdbms/admin
Regards
Amit
Maybe you are looking for
-
Mod_jk binaries or Studio11 FTP dowload
I need compile mod_jk.so for Soalris10 and SPARC. So i ma two ways: the sorter: download mod_jk.so for SPARC from somewhere. the longer: install studio11 and then compile. Someone know from where i can download studio11 via FTP ?
-
Hi all, I am doing some conversion process from C# to java. I am struck with c# foreach statement. Here I give the coding, foreach (MapFieldInfo item in Fields) if (item == null) continue; if (item.Field.Equals(fieldInfo)) exp = item.NewExpression; b
-
Conversion from 1/2 Case to full case
Hi, I have a reporting requirement where I need to provide user with flexibility to report on 2 different levels. For example there is a material with 12 packs. The actual unit of measurement is 24packs for a case.So 12 packs form 1/2 case. If there
-
Oracle 11g interval partitioning - meaningfull partition-names
Hello, On 11g, when creating interval partitions, the partitions get automatically created just fine. Very nice feature. But is it possible to supply meaningfull names to them? Now they get names SYS_nnn, but I would like to name them for instance SA
-
Canoscan LIDE 90 with Image capture on 10.6.6
This scanner used to work fine with 10.6, but since one of the last few updates (non used the scanner in a while so not sure which) it doesn't work any more. Specifically, Image capture can scan the preview image fine but not the full resolution imag