Checking who (or what) is connected to my Oracle database

It happened recently that we had to move (export/import) an Oracle DB instance from one machine to another.

Well, this instance was pointed by several applications that had to be reconfigured for connecting to the new machine.

After this was done, before shutting down the “old” instance, I had a doubt: is someone/something still using the old database?

To answer this question, there is what we could call an “SQL BLAME” query:

SELECT username, seconds_in_wait, machine, port, terminal, program, module, service_name
FROM v$session
WHERE type = 'USER';
Advertisements

One thought on “Checking who (or what) is connected to my Oracle database

  1. This might help in case your application is not connected to the database, and you want to double check your connection settings:
    select * from v$parameter where name in (‘service_names’, ‘instance_name’, ‘db_name’);

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s