lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
private function killUserSessions($user)
    {
        $sql = <<<SQL
SELECT
    s.sid,
    s.serial#
FROM
    gv\$session s,
    gv\$process p
WHERE
    s.username = ?
    AND p.addr(+) = s.paddr
SQL;

        $activeUserSessions = $this->_conn->fetchAll($sql, [strtoupper($user)]);

        foreach ($activeUserSessions as $activeUserSession) {
            $activeUserSession = array_change_key_case($activeUserSession, CASE_LOWER);

            $this->_execSql(
                sprintf(
                    "ALTER SYSTEM KILL SESSION '%s, %s' IMMEDIATE",
                    $activeUserSession['sid'],
                    $activeUserSession['serial#']
                )
            );
        }
    }
private function killUserSessions($user)
    {
        $sql = <<<SQL
SELECT
    s.sid,
    s.serial#
FROM
    gv\$session s,
    gv\$process p
WHERE
    s.username = ?
    AND p.addr(+) = s.paddr
SQL;

        $activeUserSessions = $this->_conn->fetchAll($sql, [strtoupper($user)]);

        foreach ($activeUserSessions as $activeUserSession) {
            $activeUserSession = array_change_key_case($activeUserSession, CASE_LOWER);

            $this->_execSql(
                sprintf(
                    "ALTER SYSTEM KILL SESSION '%s, %s' IMMEDIATE",
                    $activeUserSession['sid'],
                    $activeUserSession['serial#']
                )
            );
        }
    }
private function killUserSessions ( $ user ) { $ sql =  <<<SQL
SELECT
    s.sid,
    s.serial#
FROM
    gv\$session s,
    gv\$process p
WHERE
    s.username = ?
    AND p.addr(+) = s.paddr
SQL ; $ activeUserSessions = $ this -> _conn -> fetchAll ( $ sql , [ strtoupper ( $ user ) ] ) ; foreach ( $ activeUserSessions as $ activeUserSession ) { $ activeUserSession = array_change_key_case ( $ activeUserSession , CASE_LOWER ) ; $ this -> _execSql ( sprintf ( "ALTER SYSTEM KILL SESSION '%s, %s' IMMEDIATE" , $ activeUserSession [ 'sid' ] , $ activeUserSession [ 'serial#' ] ) ) ; } }
Kills sessions connected with the given user.

This is useful to force DROP USER operations which could fail because of active user sessions.

@param string $user The name of the user to kill sessions for.

@return void
Kills sessions connected with the given user .