|
Re: Long running SELECT that should be erroneous [message #621631 is a reply to message #621630] |
Fri, 15 August 2014 03:15   |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
v$session holds SQL_EXEC_START, you'll need to find the sid you're looking for, obviously.
As to why the db link doesnt work, make certain you are using the same account, if it is not the same account you've a good chance of getting unexpected behaviour.
|
|
|
|
|
|
Re: Long running SELECT that should be erroneous [message #621636 is a reply to message #621635] |
Fri, 15 August 2014 04:20   |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
So you were given sys but not allowed to create users? Wow...I dont even...just wow.
Anyway, v$session is transient real time data. If you've killed it, you'll lose the data. Depending on your options you might get a rough idea from ASH.
There could be a number of reasons why that has stopped working, though you dont need the tns entry on the server, you can push it into the link description. To be honest though, I'd start by asking the person who ran it in the first place.
Looking at your image, the wait events are extremely unexpected for a query like that. I'd not expect a CPU wait on the issuing side - was the host starved for CPU perhaps? I don't really trust what grid is telling you there. On the remote side, maybe, but not the issuing side.
|
|
|
|
Re: Long running SELECT that should be erroneous [message #621638 is a reply to message #621637] |
Fri, 15 August 2014 04:40   |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
Wait, it is still running? If so, you will be able to locate it in v$session - that will give you machine names and osuer.
Furthermore someone ran it and SYS users should be more than rare (though from what you've said I'm going to guess that might not hold true here). Ask around. Failing that, ASH gives machine (as I recall) if you've got the options.
Yes, you can kill it if it is still running (check the destination as it may not die gracefully there) but if it were me, I'd go round up who was running it and see what is going on.
|
|
|
|
Re: Long running SELECT that should be erroneous [message #621640 is a reply to message #621639] |
Fri, 15 August 2014 05:08   |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
TOAD is a gui tool for developers.
Try this
select username, osuser, machine, sid, serial#, program,logon_time, s.sql_id,event, substr(sql_text,1,39) sql_txt from v$session s
left join v$sqlarea sq on s.sql_hash_value=sq.hash_value
where status='ACTIVE'
and s.sid != (select sid from v$mystat where rownum=1)
order by 6,7
You'll need to eyeball it, obviously.
|
|
|
|
|
|
|
|
|
Re: Long running SELECT that should be erroneous [message #621647 is a reply to message #621646] |
Fri, 15 August 2014 07:18   |
 |
OfflineVIP
Messages: 9 Registered: August 2014 Location: Germany
|
Junior Member |
|
|
Ok, perhaps somebody else can help from here?
I did the following:
SQL> select sid, spid from v$process p, v$session s where paddr = addr and s.sid in 274 order by s.sid;
SID SPID
---------- ------------------------
274 4796
Now I use the SPID for orakill? Is the following usage right?
(In that case, SID is the instance and not the Session ID, right?)
[Updated on: Fri, 15 August 2014 07:19] Report message to a moderator
|
|
|
|
|
Re: Long running SELECT that should be erroneous [message #621657 is a reply to message #621637] |
Fri, 15 August 2014 10:23  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:Yes, I know. But it's the only user that was given me by the DBA and I better do nothing like creating users etc..
So you didn't understand what is in the link.
Read it again and again until you understand all what it implies.
ANYTHING is better than using SYS.
|
|
|