Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

ORA-01940 cannot drop a user that is currently connected tips
 

Oracle Tips by Burleson Consulting
December 18, 2007

Question:  I am trying to drop a user and I get the error "ORA-01940: cannot DROP a user that is currently logged in".  The problem is that the user is not connected according to v$session.  I suspect that it's related to my replication, and the user is a propagator.  How do I get around this ORA-01940 error?

Answer: First, be very careful when dropping a user who owns replication, as it can cause you to have to completely redo the replication definitions.  The docs note:

ORA-01940: cannot DROP a user that is currently logged in

Cause: An attempt was made to drop a user that was currently logged in.

Action: Make sure the user is logged out, then re-execute the command.

 

The ORA-01940 can always be cured by bouncing the source and replicated instance.  First, double-check to ensure that the user is not connected to the current instance.

select s.sid, s.serial#, s.status, p.spid
from v$session s, v$process p
where s.username = 'myuser'
and p.addr (+) = s.paddr;

-- alter system kill session '<sid>,<serial#>';

Also, check that the user is not associated with any active jobs:

select job from dba_jobs where log_user='myuser';

Finally, check that the user is not associated with any Streams replication queues:


select
   queue_table,
   qid
from
   dba_queues
where owner='myuser';

select
   apply_name
from
   dba_apply
where
   queue_owner='myuser'; 

select
   capture_name,
   queue_name
from
   dba_capture
where
   queue_owner='myuser';

select
   propagation_name
from
   dba_propagation
where
   source_queue_owner='myuser'
or
   destination_queue_owner='myuser';
 

Once you release the user from the propagation replication they can be dropped, but you must then re-define the replication mechanism.

If you like Oracle tuning, you might enjoy my book "Oracle Tuning: The Definitive Reference", with 950 pages of tuning tips and scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 

  
 

 
 
 
 
 

 
 
 
 
 
 
Oracle training Excel
 
Oracle performance tuning software 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright ? 1996 -  2014

All rights reserved by Burleson

Oracle ? is the registered trademark of Oracle Corporation.