Monday, January 31, 2022

Grant command hanging for long time

 Issue:

Grant Command hanging for longer time

SQL> grant SELECT on "SYS"."GV_$INSTANCE" to "EBS_SYSTEM" with grant option  ;

ORA-04021: timeout occurred while waiting to lock object


Solution:

1. Find out what session / process is blocking the grant and kill it.

select inst_id, username, BLOCKING_SESSION_STATUS, BLOCKING_INSTANCE,
 BLOCKING_SESSION, SID, SERIAL#
from gv$session
where username is not null;


2. Get the SID and session # of the account preventing the grant (in my case it was DBSNMP)

 log into the correct database instance as SYS and kill it


alter system kill session ',<serial#>' immediate;

alter system kill session '12,53838';


3. Completed successfully 

SQL> grant SELECT on "SYS"."GV_$INSTANCE" to "EBS_SYSTEM" with grant option;

Grant succeeded.

No comments:

Post a Comment

Featured post

Migrate OCR & vote from external to normal or High redundancy in ASM

How to Move OCR & Vote from external to Normal or high. 1)  Create New diskgroup(CRS) with suitable redundancy for OCR and Voting files....

Popular Posts