|
|
|
|
| Re: same query taking different time when executed thru diff dbs [message #577622 is a reply to message #577620] |
Tue, 19 February 2013 03:07   |
 |
sss111ind
Messages: 268 Registered: April 2012 Location: India
|
Senior Member |

|
|
Hi Michel,
Is any other area needs to have a look apart from query.Because query is as simple as one.Like gathering statistics etc.
To make the update statement look likes below I have modified like as follows to fasten the update statment.
update (select e.ename emp_ename,d.ename dept_ename from e1 e,dept1 d
where d.deptno=e.deptno) set dept_ename=emp_ename;
create table e1 as select * from emp
where rowid in(select max(rowid) from emp group by deptno);
alter table e1 add constraint id_must_be_unique unique(deptno);
select * from e1;
create table dept1 as select * from dept;
Have a look on this URL also.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:288016031632
So It's behaving differently .In real scenario dept and emp having records 40000 and 400000 records.
Regards,
Nathan
[Updated on: Tue, 19 February 2013 03:14] Report message to a moderator
|
|
|
|
|
|
|
|
| Re: same query taking different time when executed thru diff dbs [message #577632 is a reply to message #577631] |
Tue, 19 February 2013 04:34   |
 |
sss111ind
Messages: 268 Registered: April 2012 Location: India
|
Senior Member |

|
|
Hi All,
Thanks All for valuable time,now I got the solution .Please find it below.
select a.object_name, b.oracle_username, b.os_user_name,c.sid, c.serial#,c.terminal, d.sql_text
from sys.dba_objects a,
v$locked_object b,
v$session c,
v$sqltext d
where a.object_id = b.object_id
and c.sid = b.session_id
and c.sql_hash_value = d.hash_value
alter system kill session 'c.sid, c.serial#';
Regards,
Nathan
|
|
|
|
| Re: same query taking different time when executed thru diff dbs [message #577633 is a reply to message #577631] |
Tue, 19 February 2013 04:36  |
 |
Michel Cadot
Messages: 54192 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
1/ "How to find out what are the table's been locked "
If someone is waiting on it, you can query v$lock
If no one is waiting on it, you can search on the web, several have posted a way to do it (basically you try to get the row)
2/ "how to realese the lock"
Only the one that locks the row can released it.
The alternative is to kill the holder session.
Regards
Michel
|
|
|
|