Query .............. (killing me )
Gurus,
Please help me in going for a query for the following conditions :-
the columns are like this :- First_name, Middle_name, Last_name, bonds, shares, total_shares , carry_forward, plan, designation, contact number.
Now Plans are of 9 types
so if i want to check all details of a particular person* there will be 9 records as such under one NAME ( FULLNAME)
And there will be 1000 employess.. so now how can i write a select query where it dispaly all 9 records of a particualr employee and the same for other 999 employeess.....
Please save me............
Maybe
SELECT *
FROM your_table
WHERE first_name = :input_first_name
AND middle_name = :input_middle_name
AND last_name = :input_last_name;
Message was edited by:
dmill
Use John's for all at once...
mine for one at a time
Similar Messages
-
Query killing Win2KServer box!
I am running an 8i installation on a Windows2000 Server box with 1 CPU and 512K RAM. Service Pack 2 has been installed. My database and server runs happily along...until...one of my reports that looks at a fairly large slice of the database (only about 300MB total in data) is submitted. The report is tuned to use all of the correct indexes..and in fact runs quickly when it runs. I have been working with Oracle for about 15 years. I have spent almost all of it working on Unix (a REAL O/S) machines. I have tweaked and tuned every imaginable init param on my database, turned on monitoring tools at the O/S level to see if my CPU or RAM is causing the issue. Here is the problem. The report runs fine (95% of the time) as long as NO other activity is happening on the server. Opening a Word document, having a user just sign onto the network (the machine is the domain controller). As soon as other activity happens, or 5% of the time when no other activity at all, the server stops responding completely...no keyboard....no mouse...no network accessibility. There are no errors logged, no "not enough resources so I'm gonna kill the query and the database" messages. It just DIES! Otindher than leaving MS (broken)-Windows behind....what else can I try???????
Hello,
use the dual table to populate the values using record group.Define the list style as "poplist"
Thanks -
SCOM SQL query killing instance performance
Hi!
Since a few day, a new query running against our SCOM datawarehouse db is killing the performance of the SQL instance. The query run 1'000'000 times per hour for a total of 100'000'000 logical read per hour, and this continuously. The query is part of the
following Procedure: OperationsManagerDW.dbo.fn_BuildInstancePropertyDelta
Any idea what's wrong ?
What could trigger this new behavior ?
Rgds
/Chris
Waiting on statement:
RETURN
SELECT 1 AS Tag ,
NULL AS Parent ,
ISNULL(S1.PropertyGuid, S2.PropertyGuid) AS [Property!1!Guid] ,
S1.PropertyValue AS [Property!1!NewValue!ELEMENT] ,
S2.PropertyValue AS [Property!1!OldValue!ELEMENT]
FROM
SELECT PropertyGuid = Set1.PropertyXml.value('@Guid' ,'nvarchar(256)') ,
PropertyValue = Set1.PropertyXml.value('.' ,'nvarchar(max)')
FROM @PropertyXml1.nodes('Root/Property') AS Set1(PropertyXml)
) AS S1
FULL JOIN
SELECT PropertyGuid = Set1.PropertyXml.value('@Guid' ,'nvarchar(256)') ,
PropertyValue = Set1.PropertyXml.value('.' ,'nvarchar(max)')
FROM @PropertyXml2.nodes('Root/Property') AS Set1(PropertyXml)
) AS S2
ON (S1.PropertyGuid = S2.PropertyGuid)
WHERE (S1.PropertyValue <> S2.PropertyValue)
OR ( (ISNULL(S1.PropertyValue, S2.PropertyValue) IS NOT NULL)
AND ((S1.PropertyValue IS NULL)
OR (S2.PropertyValue IS NULL)) ) FOR XML EXPLICITHallo,
We open a ticket to Microsoft Support.
In the SCOM application logs, this huge SQL cpu activity correlates with an error 31553, Violation of unique key constraint.
We get the information that if the following query return some rows, it means you are hitting the same issue and you should better open a ticket to get information how to fix the problem.
select
* from ManagedEntityStage mes
inner
join ManagedEntity me on mes.ManagedEntityGuid
= me.ManagedEntityGuid
inner
join ManagedEntityProperty mep
on me.ManagedEntityRowId
= mep.ManagedEntityRowId
where mep.FromDateTime
= mes.ChangeDateTime
order
by mep.ManagedEntityRowId
Rgds
/Chris -
I have a very weird case when a particular JDBC query kills weblogic server. Attached
is a thread dump. What's weird is:
1. There is only one client on the system, and I sware the client sends only one
request. At the same time there are 12 threads trying to execute the same query.
2. The query is at the start of thread dump and it takes ~9sec to execute on our
DB from SQL+. It returns ~300 records. If I change parameters it will be executed
fine. Each time a client wants to execute a query before it is executed it is
dumped to log, and there is only one query per all threads in the dump.
3. Looking into DB log there is no sight of the query that is dumped into log
file. DB does not have a clue... Both DB and WLS are waiting for each other...
Environment:
6.1sp2 on solaris
Oracle 8.1.7
JDBC driver from Oracle 9i
[x.txt]There were two problems: request got hanging in the database (original) with proxy
timing out and making situation worse (sending more requests). 9.2.0.1 did not
have the original problem (statement did not hang), but the price was too high
(data corruption) :( Also the problem was very touchy - we got only two environments
which were duplicating it. This last mail was more on the whining side - hope
that someone seen something similar and can say a-ha! So I guess I'm back in slow
and painful try to reproduce and then fix mode... Most likely it all will end
up with SQL tuning, not app level solution...
"Slava Imeshev" <[email protected]> wrote:
Mike,
AFAIR the poblem was not in the driver but in the load balancer
resubmitting requests. Could you please try to use 9.0.1 driver.
Regards,
Slava Imeshev
"mike" <[email protected]> wrote in message
news:[email protected]...
Unfortunately the story is not completely over.
We found that the new driver in some cases garbles the data. That happenson updates
when WLS is changing object and the first parameter in the updatestatement is
string. Sounds weird, so here more details:
- We found that some strings in the database are garbled.
- JDBC trace brought us to update statements. It looks like for eachupdate container
creates prepared statement and sets parameters on it.
- If the first parameter is a string then it will be garbled (happenswith
two
independant objects).
The problem is defenitely driver-specific. It does not show up withany
driver
but 9.2.0.1. All previous drivers work right, but 9.0.1 that we usedbefore had
the problem described in the thread, and 8.x work at least 10 timesslower
(no
kidding).
Test app which connects to the same oracle instance and executes thestatement
from JDBC log works fine (sure it does). Adding nls_charset to classpathdoes
not make any difference. Attempt to create statement from within WLSwas
not taken.
Solution was even more bizzare. Since it was happening only when thefirst
attribute
was string we shuffled attributes and the problem went away. But Ido not
believe
that is a solution - IMHO that just masks the problem.
Any and all brignt and not-so-much ideas are welcome. -
Getting issue with .rss file
Hi,
I have created a report and added .rss file. When I run report, getting following error.
The same format rss files for other reports are working fine. Please help.
The specified script failed to compile with the following errors: C:\Windows\system32> "C:\Windows\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:exe /main:MainModule /utf8output /R:"System.dll" /R:"System.Xml.dll"
/R:"System.Web.Services.dll" /R:"C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\rs.exe" /out:"C:\Windows\TEMP\_ubvgwzl.exe" /debug- "C:\Windows\TEMP\_ubvgwzl.0.vb" "C:\Windows\TEMP\_ubvgwzl.1.vb"
Microsoft (R) Visual Basic Compiler version 8.0.50727.5420 for Microsoft (R) .NET Framework version 2.0.50727.5477 Copyright (c) Microsoft Corporation. All rights reserved. C:\Windows\TEMP\_ubvgwzl.1.vb(42)
: warning BC42020: Variable declaration without an 'As' clause; type of Object assumed. Sub SetReportParameters(parameters) ~~~~~~~~~~ C:\Windows\TEMP\_ubvgwzl.1.vb(45)
: error BC30451: Name 'Key' is not declared. SetParameter(0, parameters, "Key", Key)
~~~~~~~~~~~ C:\Windows\TEMP\_ubvgwzl.1.vb(46) : error BC30451: Name 'FromDate' is not declared. SetParameter(1, parameters, "FromDate", FromDate)
~~~~~~~~ C:\Windows\TEMP\_ubvgwzl.1.vb(47) : error BC30451: Name 'ToDate' is not declared.
SetParameter(2, parameters, "ToDate", ToDate) ~~~~~~ C:\Windows\TEMP\_ubvgwzl.1.vb(52)
: warning BC42020: Variable declaration without an 'As' clause; type of Object assumed. Sub SetParameter(index, parameters, Name, Value) ~~~~~
C:\Windows\TEMP\_ubvgwzl.1.vb(52) : warning BC42020: Variable declaration without an 'As' clause; type of Object assumed. Sub SetParameter(index, parameters, Name, Value)
~~~~~~~~~~ C:\Windows\TEMP\_ubvgwzl.1.vb(52) : warning BC42020: Variable declaration without an 'As' clause; type of Object assumed.
Sub SetParameter(index, parameters, Name, Value) ~~~~ C:\Windows\TEMP\_ubvgwzl.1.vb(52)
: warning BC42020: Variable declaration without an 'As' clause; type of Object assumed. Sub SetParameter(index, parameters, Name, Value)
~~~~~ No query killed ~~~~~ No query killed
PorusI found the issue, the service provided by UCM i.e. the GET_REMOTE_FEED as when checked in the source code found doesn't support https. So any request made on https will give no result.
Thanks,
Abhijit -
Cannot kill a session that is running a query on a linked server in SQL Server 2008 R2
Hi,
Cannot kill a session that is running a query on a linked server in SQL Server 2008 R2.
When I try to kill, it status shown as "KILLED/ROLLBACK"
I have facing the issue from long back. I searched many and none of them worked for me
Any help is greatly appreciated
Thanks
Jaison
CarverI guess its stuck, can you see some blocking or any other process blocking the rollback.
can you check rollback status using below command. Or you can use sp_who2 and check status column
select percent_complete,estimated_completion_time from sys.dm_exec_requests
where spid=xxx
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles -
Is there a way to kill a query running under a session without killing the session?
We are using connection pooling so for many front-end sessions, there is only one database connection open...
How do you kill a query executed by one of these front-end sessions without killing the database connection?
Thanks...Hi
My opinian is that it is not possible. There is no command to cancel query. It can be canceled from client side in multithread application only.
Regards
null -
Killing Parallel Query Session
Hi,
I am running Oracle 11.2.0.1.0 on Solaris 5.10.
Couple of hours ago, I ran a job through DBMS_JOB (Yes, I need to use dbms_schedular), and in the job I used parallel query. Now I want to remove the job. Also I want to clean up the sessions. I can remove the job by doing DBMS_JOB.remove(job id). Is there a way that I kill one parallel query coordinator session, and it would automatically kill all the slave sessions?
Thanks and regards
Edited by: Fahd Mirza on Apr 22, 2010 11:57 AMThanks for the answer.
I have run the following query with output:
SQL> select ps.sid,s.username,ps.qcsid
from v$session s, v$px_session ps
where s.sid=ps.sid
and s.username='BIADM'; 2 3 4
SID USERNAME QCSID
91 BIADM 147
267 BIADM 147
290 BIADM 147
332 BIADM 147
345 BIADM 147
69 BIADM 147
92 BIADM 147
102 BIADM 147
222 BIADM 147
112 BIADM 147
73 BIADM 147
126 BIADM 147
136 BIADM 147
145 BIADM 147
170 BIADM 147
180 BIADM 147
276 BIADM 147
190 BIADM 147
221 BIADM 147
234 BIADM 147
214 BIADM 147
246 BIADM 147
270 BIADM 147
256 BIADM 147
278 BIADM 147
291 BIADM 147
309 BIADM 147
298 BIADM 147
323 BIADM 147
344 BIADM 147
2 BIADM 147
331 BIADM 147
134 BIADM 94
125 BIADM 94
156 BIADM 94
168 BIADM 94
181 BIADM 94
205 BIADM 94
191 BIADM 94
215 BIADM 94
232 BIADM 94
245 BIADM 94
255 BIADM 94
269 BIADM 94
292 BIADM 94
302 BIADM 94
280 BIADM 94
311 BIADM 94
147 BIADM 147
94 BIADM 94
50 rows selected.If I kill sessions with sid 147 and 94, shouldn'it it be killing all the sessions of BIADM?
REGARDS -
How to cancel/kill a long SQL query?
For example, I issued a SQL query from Java, which may run for a long time, then, I want to cancel/kill it after a certain amount of time, how can I do it?
Also, is there a way to cancel/kill the query session in Oracle without using Java/JDBC?
Thanks!Yes. Either set it up automatically with Statement.setQueryTimeout()
or cancel the statement from a different thread, via Statement.cancel().
Joe Weinstein at BEA Systems -
Hi, Group.
This seems like the type of question that has been asked / answered a million times before but a quick Google and a search in this forum didn't return what I was hoping for.
I have a Java application that issues SQL statements against an Oracle database (10g). Is there anyway I can have the Java application tell the database to kill a specific query? I know how to do this in SQL*Plus and so I could figure out a long-winded way of wrapping that in Java but I'm wondering if there isn't a "simple" hook that I can call that does what I want?
Cheers, MaxHi,
You can delete the query and query elements using RSZDELETE transaction.
Hope this helps... -
How to associate a submitted query with a sessionid (for kill by enduser)
After submitting queries in batch mode through a (self-programmed) user interface, we would like to give the enduser the possibility of killing executing queries submitted by himself.
I guess the keyword is to get hold of the session id, after starting/submitting the query.
One way could be by retrieving information from V$SESSION after the job has been started (and before next job is started) and look for 'a new session id/serial#'. When identified, it is stored along with the query making it possible for the application to issue 'ALTER SYSTEM KILL SESSION (x,y);'.
Does anyone see problems with this solution or have better suggestions ? A detailed description would be highly appriciated.
We are using Oracle 8.1.6 (HP/Unix).
Best regards
CarstenThe main problem to the suggested solution is you END USERS.
I would never-ever give them an ability to kill sessions. Never!
What will happend if they kill an Oracle session and immidiently start another one
while the first session was only marked as killed. And even more. Sometimes I saw situations when it was not enough to kill Oracle sessions but Unix sessions also need to be killed.
In another words, let your end user submit a request to a person (like DBA) who knows what he is doing and how to handle a "run-away" process.
Best regards. -
Closing/Killing a long runing Query gracefully using PLSQL
I have dynamic query which I want to kill programatically in PLSQL if its runing for more then 5 mins and return NULL result set.
Any advise how best in can do it.
I read about dbms_alert but not sure that is the correct way.
Any inputs on this
Thanks
RaviIf that Oracle session is tied to a client application, then there is a 3rd option.
The OCI (Oracle Call Interface) allows the client to make an "interrupt session's execution" call. This will terminate the current execution, but not the session itself. SQL*Plus for example uses this when you press CTRL-BREAK while a stored proc or SQL call is being executed by the server.
The real issue though is Why? It is not the usual approach to "abort" a long running process.
If the process does not complete in 5 minutes now, there is absolutely no guarantees that it will be able to do so when executed again. So that makes the execution on that process senseless... and the actions executed by that process meaningless.
I would rather address that process and actions then deal with the symptoms by forcing it to terminate after 5 minutes. -
Kill query on forms? Possible?
I have inherited a forms application, when it was developed 10 years ago having a select * from table_name on all tables was fine.
Now I have a form that still allows a full table scan- but now the table has over 200 million records. What would be the easiest way to stop a full table scan on this form? I am running forms 6i on a linux x86 platform. I was thinking to create an alert- but I can't get it to kill the query.
I am new to forms- because I have inherited this application.
Hitting cancel query- which exectues a KILL_FORM doesn't work- it hangs the form and the query still is active when I query v$session, v$process.
Sorry, to bother you, but I would like to get a good feel of which avenue to look at before I invest research time."Would maximum query time, or maximum records fetched work?"
The on-line help points out for this property
"Specifies the interaction mode for the form module. Interaction mode dictates
how a user can interact with a form during a query. If Interaction Mode is set to
Blocking, then users are prevented from resizing or otherwise interacting with the
form until the records for a query are fetched from the database. If set to Non-
Blocking, then end users can interact with the form while records are being
fetched.
Non-blocking interaction mode is useful if you expect the query will be
time-consuming and you want the user to be able to interrupt or cancel the query.
In this mode, the Forms runtime will display a dialog that allows the user to
cancel the query. "
Greetings...
Sim -
Can't kill query when I run using "statement" option
Help! I get an "X" to kill the query when I run a query using the "script"" option, but when I use the "statement" option I have no option I can find to cancel/kill the query. What should I do? I am using SQL Developer 2.1.1.64. In prior versions the "X" was always there. This has got to be a bug but I don't see this quetions posted anywhere else.
Please help!!! Thanks.
Edited by: user13064034 on Jul 9, 2010 10:06 AMOh... right, but that's only on SELECTs. I thought we were all referring to the still missing features discussed in-depth in 30EA2->2.1.*: Task Progress indication
K. -
Kill Query (exec phase) in OCI (windows app)
How do I stop a query from being executed thru OCI? I have a windows application
that starts another thread to execute a query. The worker thread basically parses
the statement, executes and then fetches. I'd like to be able to stop the worker
thread from executing immediately. In other words, if the user decides to cancel
the query from the main thread, I'd like the worker thread to stop execution.
I have tried Oracle "obreak" function, but that doesn't seem to do what I want. Alter
session to kill the session is not an option since I don't have "alter system" privileges. I have
thought about TerminateThread, but that seems to be a little tricky since there is no chance to clean up.
nullAt one point, there was a problem with OCIBreak on NT. I believe that if you install the latest Oracle client patchkit and the latest NT service pack, you'll find that OCIBreak will work.
Are you running an Oracle 7 or Oracle 8 client? obreak is an OCI 7 call, so I'm not sure whether it was fixed by the same bug fix that solved the problem in the Oracle 8 code stream.
Justin -
I moved from TOAD to SQL Developer and am not an experienced programmer.
When a query gets away from me that I want to kill, I hit the red X button. SQL Developer will hang. Sometimes I will actually have to stop and restart the Oracle service to kill the query.
How do I kill a query immediately?This is probably due to the nature of your query rather than an sqldev bug, so the database won't let you cancel and sqldev just hangs there until it completes anyway.
You shouldn't have any trouble canceling a normal select. If you do, get back with DB/sqldev version and a reproducible script.
Also, it would be great if you can compare the same statement with TOAD. If it can be canceled there, it should be possible in sqldev too.
Last, you can always kill the whole session through sqldev's Monitor Sessions tool (in a second instance since the first one is blocked by your statement), the Enterprise Manager or the OS' KILL command.
Regards,
K.
Maybe you are looking for
-
Can not see wireless TM in disk utility or desktop.
Am I running a TM Airport (router) it runs great, I love everything about it and the backups have no issues. But I wanted to partition my 500mb drive on my TM yet for some reason I can not see the drive either on my desktop or in disk utility. Is the
-
Dreamwiever behaviors Go to URL (new blank or browser window)
<script type="text/javascript"> function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); </script> <a href="http://example.com"
-
QuickTime animation becomes blurry on YouTube
I am working on a MacBookPro with OS 10.6.8. I have both QuickTime Player 10, and Quicktime Pro 7.6.6. I made an animation of a SketchUp model (a garden with trees and walls and such) and the exported animation looks very sharp and clear when viewed
-
How do i get photos from google to my iphoto?
How do I get photos from google to my iphoto?
-
MCTC report not visible for particular period.
Hi. I am uanble to see data in MCTC t code. Figures are visible Nov Month Figures Not are visible Dec Month MCTC report itself doesnt fetch data for Jan Month. Any configuration need to be maintained? Customer & material both marked for statistical