Cookies on this site

We would like to use cookies to understand how the site is used and to measure our campaigns. Nothing is set until you choose, and you can change your mind at any time from “Cookie settings” at the foot of every page. Privacy policy

Contact UsContact Us

Resources / Blogs

Oracle & databases

oracle – generate kill database sessions script

Check out the script that comes handy to Oracle DBAs for generating script to kill sessions based on user sessions. Learn more here.

· · 1 min read

Oracle Script

Here is the script that comes handy to Oracle DBAs for generating script to kill sessions based on user sessions.

For example, this SQL script generates the script to kill all the sessions belong to user – SCOTT.

Login to database as sys or system or sysdba or user with DBA role:


SQL> select 'alter system kill session '''||sid||','||serial#||''';' as script from v$session where username='SCOTT';

–Example output:

alter system kill session ‘2545,48723’;
alter system kill session ‘5642,317’;

Here is an example of kill session in Oracle RAC environment:


select 'alter system kill session '''||sid||','||serial#||',@'||inst_id||''';' as script from gv$session where sid =

← All articles

Case studies

Oracle Consulting in practice

Client names are withheld. We are happy to share details on a call.

All case studies
  • Delivered

    30 TB, zero downtime

    Financial services

    Oracle

    Zero-downtime move of a 30 TB Oracle database for a global retail bank

    The bank's transaction database served thousands of users around the clock. We built the new Oracle 12c RAC platform on IBM AIX alongside the old Solaris system, kept the two in sync with Oracle GoldenGate, tested everything and switched over with no downtime and no data loss.

    • 30 TB moved with zero downtime
    • Zero data loss at cut-over
  • Delivered

    Zero downtime

    Legal technology

    Oracle

    Sybase to Oracle with zero downtime for an e-discovery company

    Sybase was holding back a platform that processes large volumes of legal data. We converted the schema, kept both databases in sync with continuous replication, validated the data and switched over without interrupting the business.

    • Zero downtime at cut-over
    • No disruption to client workflows
  • Delivered

    No service disruption

    Local government

    Oracle

    A city's Oracle database moved off ageing Solaris hardware

    A major California city ran a mission-critical Oracle database on Solaris servers nearing end of life. We mapped the dependencies, confirmed the applications would work unchanged and re-platformed the database to Linux without disrupting public services.

    • No disruption to public services
    • Minimal application changes

Keep reading

All Oracle & databases articles

Planning an Oracle or database migration?

Request a migration plan consult with the DBAs who do this work, and leave with a fixed-scope plan.