Toad World® Forums

Log off a user

Hi guys, how can i log off a user connected to a database. The user was previously logged on in an application

that using database, but didnt shut down his system properly and now the user tries to login and his getting

and error message “this user is already logged in”.

Now, how can i totally log out the user “back-end” to enable the user login access?

Thanks

This sounds like an application message as Oracle usually lets you login as many times as you like to the same user.

You will need to talk with the application support team I suspect.

Cheers,

Norm [ TeamT ]

On 19 August 2015 11:03:46 BST, omokwek bounce-omokwek@toadworld.com wrote:

Log off a user

Thread created by omokwek
Hi guys, how can i log off a user connected to a database. The user was previously logged on in an application

that using database, but didnt shut down his system properly and now the user tries to login and his getting

and error message “this user is already logged in”.

Now, how can i totally log out the user “back-end” to enable the user login access?

Thanks

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Oracle notifications altogether.

Toad World - Oracle Discussion Forum

Flag this post as spam/abuse.

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Thanks for your advice. Sure an application problem thats why i want to use toad to completely log off the user so he can sign in again.

The problem is that the user is actually logged out of Oracle - can you see his/her session in V$SESSION? I doubt it. The error message above in your original post is not an Oracle message. The user is still logged in to the application - at least, the application thinks so.

Oracle doesn’t care, usually, how often your user logs in. Your application sounds like it has a USERS table, or a table used for users and a flag on that user’s row in the USERS table says “logged in already”. When your user didn’t log out, that flag was left set and subsequent login attempts are saying that the user is still logged in.

What this means is that the designers of said application need to be taken outside and given a good kicking! Only kidding! However, they do need to consider that there are numerous ways for a user to “log out” of the database, but which will not officially log them out of the application:

  • Database crash;

  • DBA kills user sessions;

  • SMON/PMON terminates the user session with extreme prejudice;

  • Application raises an exception which is not handled;

  • User CTRL-C’s or incorrectly shuts down their application session;

  • Server session for the user gets killed by the SYSADMINS;

  • And so on.

What your application needs to provide is a utility that allows an application admin user the ability to “log out” a user who has suffered from one or more of the above and is effectively left logged in to the application.

Using Toad to do this is not likely to be of any use as the problem is not in the database, it’s in the way that the application works. Ask me how I know - I spent years in support (I’m still there) and we have had to deal with incomplete applications that do this very thing all the time. This is something for the vendors to fix, not the DBAs.

Anyway, to use Toad to get around your problem this is what you can try:

  • Look at the tables used by the application to see if there are any named USERS or similar;

  • Check for a LOGGED_IN column - it could be STATUS or similar;

  • Try to find out what it should be for a logged out user;

  • Find the row for the affected user and change the LOGGED_IN flag to indicate logged out;

  • COMMIT;

  • Document the process in the support documentation for the application and make it known to all your database support staff.

  • If there is a need to do this regularly, create a procedure or script that carries out the above processing and update the documentation with details of how to call it, who should call it and what parameters to pass.

HTH

Cheers,

Norm. [TeamT]