IZEA

Sunday, May 12, 2013

Query to find Locked Tables in Oracle


Query to find Locked Objects:
 
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

(OR)

select a.object_id, b.owner, b.object_name, a.session_id, a.oracle_username, a.process
from v$locked_object a, dba_objects b

where a.object_id = b.object_id;

Query to find m/c & user name having lock:

select sid, username, osuser, process, machine, program
from v$session
where sid = sid_of_hanging_session;

Query to kill Session:

ALTER SYSTEM KILL SESSION 'SID,SERIAL#' IMMEDIATE;

Query to find PID of session:

select pid from v$process where addr=
(select paddr from v$session where sid=sid_of_hanging_session);

Whenever there is a lock in the object, if you issue a DML command on the same, it will thrown the below error.

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired.
 

Thursday, May 9, 2013

How To Enable Telnet In Windows Server 2008

Telnet is a network protocol used on the Internet or LAN to provide a bidirectional interactive text-oriented communication facility. Users of different platform use this facility mainly to check the communication between 2 servers or machines. In Windows Server 2008, Telnet is not enabled by default but included as a feature ‘Telnet Client’. Basically allows a computer to connect to a remote Telnet server and run applications on that server.

Unlike Windows 2003, if you give the Telnet command in Windows Server 2008 you will be promoted below message. 


Follow the below steps to enable Telnet on Windows Server 2008.
  • Click Start  > Server Manager, Open Server Manager.


    In Server Manager, click on Features and then Click on Add Features.



    Select Telnet Client from the available list of features, then click Next.


     Installation in Progress...



    Installation is Completed .

    Now run the telnet command and as you expect, it is recognized by Windows Server 2008 and you can start using it to connect to your telnet servers.