Tag Archives: 11g

Books: Oracle Data Guard 11gR2 Administration…

With all my pleasure I’m glad to announce my friend’s book  «Oracle Data Guard 11gR2 Administration Beginner’s Guide».

All you need to know about disaster recovery technique you’ll find at these pages!

DG_Image Table of Contents

Preface
Chapter 1: Getting Started
Chapter 2: Configuring the Oracle Data Guard Physical Standby Database
Chapter 3: Configuring Oracle Data Guard Logical Standby Database
Chapter 4: Oracle Data Guard Broker
Chapter 5: Data Guard Protection Modes
Chapter 6: Data Guard Role Transitions
Chapter 7: Active Data Guard, Snapshot Standby, and Advanced Techniques
Chapter 8: Integrating Data Guard with the Complete Oracle Environment
Chapter 9: Data Guard Configuration Patching
Chapter 10: Common Data Guard Issues
Chapter 11: Data Guard Best Practices
Pop Quiz Answers
Index

  • Preface

Продолжить чтение этой записи

Реклама

Useful scripts: Get DDL for jobs, created by DBMS_JOB…

Here is a script, which is dedicated to generate DDL commands to recreate jobs, created by DBMS_JOB package.

DECLARE
 CURSOR job_list
 IS
 SELECT JOB FROM dba_jobs;
mysql VARCHAR2 (32767);
BEGIN
 FOR job_id IN job_list
 LOOP
 mysql := '';
 DBMS_OUTPUT.put_line ('BEGIN');
 DBMS_OUTPUT.put_line ('DBMS_JOB.REMOVE(' || job_id.job || ');');
 DBMS_JOB.user_export (job_id.job, mysql);
 DBMS_OUTPUT.put_line (mysql);
 DBMS_OUTPUT.put_line ('END;');
 DBMS_OUTPUT.put_line ('/');
 END LOOP;
END;
/

Useful scripts: Log file switch frequency statistsic

Very nice and easy to use query.

SELECT trunc(first_time) "Date",
 to_char(first_time, 'Dy') "Day",
 count(1) "Total",
 SUM(decode(to_char(first_time, 'hh24'), '00', 1, 0)) "h0",
 SUM(decode(to_char(first_time, 'hh24'), '01', 1, 0)) "h1",
 SUM(decode(to_char(first_time, 'hh24'), '02', 1, 0)) "h2",
 SUM(decode(to_char(first_time, 'hh24'), '03', 1, 0)) "h3",
 SUM(decode(to_char(first_time, 'hh24'), '04', 1, 0)) "h4",
 SUM(decode(to_char(first_time, 'hh24'), '05', 1, 0)) "h5",
 SUM(decode(to_char(first_time, 'hh24'), '06', 1, 0)) "h6",
 SUM(decode(to_char(first_time, 'hh24'), '07', 1, 0)) "h7",
 SUM(decode(to_char(first_time, 'hh24'), '08', 1, 0)) "h8",
 SUM(decode(to_char(first_time, 'hh24'), '09', 1, 0)) "h9",
 SUM(decode(to_char(first_time, 'hh24'), '10', 1, 0)) "h10",
 SUM(decode(to_char(first_time, 'hh24'), '11', 1, 0)) "h11",
 SUM(decode(to_char(first_time, 'hh24'), '12', 1, 0)) "h12",
 SUM(decode(to_char(first_time, 'hh24'), '13', 1, 0)) "h13",
 SUM(decode(to_char(first_time, 'hh24'), '14', 1, 0)) "h14",
 SUM(decode(to_char(first_time, 'hh24'), '15', 1, 0)) "h15",
 SUM(decode(to_char(first_time, 'hh24'), '16', 1, 0)) "h16",
 SUM(decode(to_char(first_time, 'hh24'), '17', 1, 0)) "h17",
 SUM(decode(to_char(first_time, 'hh24'), '18', 1, 0)) "h18",
 SUM(decode(to_char(first_time, 'hh24'), '19', 1, 0)) "h19",
 SUM(decode(to_char(first_time, 'hh24'), '20', 1, 0)) "h20",
 SUM(decode(to_char(first_time, 'hh24'), '21', 1, 0)) "h21",
 SUM(decode(to_char(first_time, 'hh24'), '22', 1, 0)) "h22",
 SUM(decode(to_char(first_time, 'hh24'), '23', 1, 0)) "h23",
 round(count(1) / 24, 2) "Avg"
 FROM V$log_history
 group by trunc(first_time), to_char(first_time, 'Dy')
 Order by 1

Useful scripts: Catch a session, causing ‘cursor: pin S wait on X’…

For sure, every network from time to time aborts connection. Especially this commonly could be seen in WANs.

When this happens while a session is fetching data or using some other object through db-link, PMON for some reason (from time to time) is unable to kill this session, so session stucks, leading to ‘cursor: pin S wait on X’ wait event.

It’s quite difficult to find out, which session you need to kill to release memory lock, so here is the query for this:

SELECT *
 FROM v$session
 WHERE sid IN
 (SELECT TO_NUMBER (SUBSTR (TO_CHAR (RAWTOHEX (p2raw)), 1, 8),
 'XXXXXXXX') sid
 FROM v$session
 WHERE event = 'cursor: pin S wait on X')

The following screenshot shows reducing Latch/mutex waits:

Help, my DB is feeling ill: Troubleshooting sequence…

Hello, my friends!

Many times I’d been asked for a reasons, due to which DB could stuck or even be aborted, so I decided to make a little overview. When a DB hangs, stops responding or even doesn’t startup, then a typical behaviour for a novice — running in circle and screaming.

First thing you must to do — just relax, all bad things, that could happen, already have happen. Take a breath, make a cup of coffee and relax: it’s time for diagnostics. We must find out a problem and allow users to work as fast as possible, all analysis  we’ll make afterwards.

My troubleshooting sequence is:

    1. Hardware;
    2. OS;
    3. Instance;
    4. Database;
    5. Network;
    6. Oracle.Net;
  1. Hardware. In most cases this work is for system administrators: if server is down, DBA can’t even connect to shell.  But nevertheless from time to time this part is assigned to DBA:
    1. Check for error messages at hardware monitoring screens, if there is any;
    2. Check OS logs.
  2. OS. The same — this also belongs to SA. But OS environment parameters must be set by DBA:
    1. Check if Oracle parameters ($ORACLE_HOME,$ORACLE_SID,NLS_LANG etc) are set correctly;
    2. Take a look at OS logs for any related errors;
    3. Check, if OS has enough resources for running and maintaining Oracle DB. Poor resources can make new connections impossible.
  3. Instance:
    1. Find out, if it is started and in which mode;
    2. Take a look at alert log and search for ORA errors that prevent instance to start up or open;
    3. Performance issue, that can stuck all activity (this topic I’ll describe in my next article);
    4. Don’t forget about resources: Memory parameters, Flash Recovery Area free space (a common error of young DBA).
  4. Database. If instance can’t open DB, then there could be a quite badly situation with DB files:
    1. Check alert log for ORA errors;
    2. Check for control file loss;
    3. Check for DB files corruptions or loss of log file groups.
  5. Network:
    1. Check, if NIC is up and configured;
    2. Check, if server can reach its default router and vice versa;
    3. Check, if server can be reached by client PC.
  6. Oracle.Net:
    1. Try to tnsping server and analyze an error if any;
    2. Check, if Listener is up and configured;
    3. Check for a list of registered databases;
    4. Check, if naming method at client’s PC is configured correctly;
    5. Take a look at Oracle.Net log files (listener.ora, sqlnet.log).

As you can see, the most frequently mentioned file is alert log. So if server is up and OS is running, alert log is the first place to look at.

Useful scripts: Get a list of objects to be moved for a data file resize

Every DBA from time to time wants to reduce a size of a data file, thinking ‘There is a lot of free space in datafile, why don’t to resize it?’ But the secret is that shrinking tables is not very helpful in this case — datafile least size will be limited to the block, where the last table’s/index’s block resides.

So, the solution is to relocate used blocks to free gaps between blocks.

We can achieve this by several ways:

  • ALTER TABLE …. MOVE or INDEX REDUILD;
  • use DBMS_REDIFINITION package;
  • Export table, purge it and import again with the help of DataPump.

But prior we need to get a list of objects, which need to be relocated to make datafile reduce possible. The following query show such objects:

DECLARE
   V_FILE_ID       NUMBER;
   V_BLOCK_SIZE    NUMBER;
   V_RESIZE_SIZE   NUMBER;
BEGIN
   V_FILE_ID := &FILE_ID;
   V_RESIZE_SIZE := &RESIZE_FILE_TO;
   SELECT BLOCK_SIZE
     INTO V_BLOCK_SIZE
     FROM V$DATAFILE
    WHERE FILE# = V_FILE_ID;

   DBMS_OUTPUT.PUT_LINE ('.');
   DBMS_OUTPUT.PUT_LINE ('.');
   DBMS_OUTPUT.PUT_LINE ('.');
   DBMS_OUTPUT.PUT_LINE (
         'OBJECTS IN FILE '
      || V_FILE_ID
      || ' THAT MUST MOVE IN ORDER TO RESIZE THE FILE TO '
      || V_RESIZE_SIZE
      || ' BYTES');
   DBMS_OUTPUT.PUT_LINE (
      '=======================================================================');
   FOR my_record
      IN (  SELECT DISTINCT
                   (   OWNER
                    || '.'
                    || SEGMENT_NAME
                    || ' - OBJECT TYPE = '
                    || SEGMENT_TYPE)
                      ONAME
              FROM DBA_EXTENTS
             WHERE (block_id + blocks - 1) * V_BLOCK_SIZE > V_RESIZE_SIZE
                   AND FILE_ID = V_FILE_ID
          ORDER BY 1)
   LOOP
      DBMS_OUTPUT.PUT_LINE (my_record.ONAME);
   END LOOP;
END;
/

Useful scripts: Table list with stale statistics

This script is intended for daily use to get tables where percentage of changed records is above 10%:

SELECT DT.OWNER,
       DT.TABLE_NAME,
       ROUND ( (DELETES + UPDATES + INSERTS) / NUM_ROWS * 100) PERCENTAGE
FROM   dba_tables dt, ALL_TAB_MODIFICATIONS atm
WHERE      DT.OWNER = ATM.TABLE_OWNER
       AND DT.TABLE_NAME = ATM.TABLE_NAME
       AND NUM_ROWS > 0
       AND ROUND ( (DELETES + UPDATES + INSERTS) / NUM_ROWS * 100) >= 10
ORDER BY 3 desc

Also you can avoid system schemas by adding:

AND OWNER NOT IN ('SYS','SYSTEM','DBSNMP','OSMMON','PERFSTAT')

Another query for statistic

Hello everybody!

Here is another stats gathering script, work checked under 11.2:

Runs faster then previous queries.

 
SELECT SS.SID,
       USERNAME,
       CPU              AS "CPU, used by session",
       SESSION_READS    AS "Logical read bytes, in MB",
       PGA              AS "PGA Memory, in MB",
       PHYS_READS       AS "Physical read bytes, in MB",
       PHYS_WRITES      AS "Physical write bytes, in MB",
       REDO             AS "Redo size, in MB",
       NET_RECI_FROM    AS "Received from client, in MB",
       NET_SENT_TO      AS "Sent to client, in MB",
       vs.*
  FROM v$session vs,
       (SELECT SID,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (session_reads / 1024 / 1024, 2), NULL,
                          ROUND (session_reads / 1024 / 1024, 2)))
                  SESSION_READS,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (PGA / 1024 / 1024, 2), NULL,
                          ROUND (PGA / 1024 / 1024, 2)))
                  PGA,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (CPU / 1024 / 1024, 2), NULL,
                          ROUND (CPU / 1024 / 1024, 2)))
                  CPU,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (PHYS_READS / 1024 / 1024, 2), NULL,
                          ROUND (PHYS_READS / 1024 / 1024, 2)))
                  PHYS_READS,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (PHYS_WRITES / 1024 / 1024, 2), NULL,
                          ROUND (PHYS_WRITES / 1024 / 1024, 2)))
                  PHYS_WRITES,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (REDO / 1024 / 1024, 2), NULL,
                          ROUND (REDO / 1024 / 1024, 2)))
                  REDO,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (NET_RECI_FROM / 1024 / 1024, 2), NULL,
                          ROUND (NET_RECI_FROM / 1024 / 1024, 2)))
                  NET_RECI_FROM,
               TO_NUMBER (
                  DECODE (0,
                          ROUND (NET_SENT_TO / 1024 / 1024, 2), NULL,
                          ROUND (NET_SENT_TO / 1024 / 1024, 2)))
                  NET_SENT_TO
          FROM v$sesstat PIVOT (SUM (VALUE)
                         FOR STATISTIC#
                         IN  (12  AS SESSION_READS,
                              17  AS CPU,
                              35  AS PGA,
                              83  AS PHYS_READS,
                              96  AS PHYS_WRITES,
                              185 AS REDO,
                              590 AS NET_RECI_FROM,
                              589 AS NET_SENT_TO))) SS
 WHERE vs.sid = ss.sid AND USER# > 0

DGMGRL: Reinstating ex-Primary to Standby by FlashBack Database feature…

From time to time every of us meets with hardware crashes. That’s why creating disaster recovery configurations by DataGuard is very useful for every DB regardless of its size. But the size of DB defines the tool with which DBA must recreate primary DB and DR configuration.

If DB is quite small — simple cold copy or RMAN duplicate is good enough. But in case of huge warehouses or datamarts this way is too long. That’s why I recommend the following solution: reinstate DR by Flashback Database feature.

For this example I need 2 DBs, configured by DataGuard Manager, something I’ve made earlier in this article.

Work Plan:

  1. Simulate «disaster» at PRM;
  2. Failover to STB;
  3. Convert failed PRM into standby database;
  4. Reinstate PRM in DataGuard configuration;
  5. Switchover to PRM.

1. Simulate «disaster» at PRM:

SQL> select sequence#,archived from v$log;
 SEQUENCE# ARC
---------- ---
         4 YES
         5 NO
         3 YES
SQL> create table test01 as select * from v$log;
Table created.
SQL> shutdown abort;
ORACLE instance shut down.

2. Connect to dgmgrl@STB and failover to STB:

C:\Tools\Oracle\product\11.2.0\db\database>set ORACLE_SID=STB
C:\Tools\Oracle\product\11.2.0\db\database>dgmgrl sys/manager
DGMGRL for 64-bit Windows: Version 11.2.0.1.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration
Configuration - dr
Protection Mode: MaxAvailability
 Databases:
 prm - Primary database
 stb - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
ORA-16625: cannot reach database "prm"
DGM-17017: unable to determine configuration status
DGMGRL> failover to STB;
Performing failover NOW, please wait...
Failover succeeded, new primary is "stb"

3. Convert failed PRM into standby database:

Here we need to determine SCN, when STB DB has became primary:

SQL> select STANDBY_BECAME_PRIMARY_SCN from v$database;
 STANDBY_BECAME_PRIMARY_SCN
--------------------------
                   1378375

After getting SCN, we need to mount PRM and execute:

C:\Tools\Oracle\product\11.2.0\db\database>set ORACLE_SID=PRM

C:\Tools\Oracle\product\11.2.0\db\database>sqlplus sys/manager as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 14 13:55:35 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.
Total System Global Area  810053632 bytes
Fixed Size                  2180104 bytes
Variable Size             532679672 bytes
Database Buffers          268435456 bytes
Redo Buffers                6758400 bytes
Database mounted.
SQL> FLASHBACK DATABASE TO SCN 1378375;
Flashback complete.
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.
SQL> SHUTDOWN IMMEDIATE;

ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area  810053632 bytes
Fixed Size                  2180104 bytes
Variable Size             532679672 bytes
Database Buffers          268435456 bytes
Redo Buffers                6758400 bytes
Database mounted.

And now we have at PRM:

SQL> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED

4. Reinstate PRM in DataGuard configuration;

Connect to DataGuard at STB (as it’s configuration is only valid) and run:

DGMGRL> show configuration
Configuration - dr
  Protection Mode: MaxAvailability
  Databases:
    stb - Primary database
      Warning: ORA-16629: database reports a different protection level from the protection mode
    prm - Physical standby database (disabled)
      ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: DISABLED
Configuration Status:
WARNING
DGMGRL> reinstate database prm;

Reinstating database "prm", please wait...
Reinstatement of database "prm" succeeded
DGMGRL> show configuration
Configuration - dr
  Protection Mode: MaxAvailability
  Databases:
    stb - Primary database
      Warning: ORA-16629: database reports a different protection level from the protection mode
    prm - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
WARNING

5. Switchover to PRM. At last we are ready to switchover back to PRM :

 
C:\Tools\Oracle\product\11.2.0\db\database>dgmgrl sys/manager@stb
DGMGRL for 64-bit Windows: Version 11.2.0.1.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> switchover to PRM;
Performing switchover NOW, please wait...
New primary database "prm" is opening...
Operation requires shutdown of instance "stb" on database "stb"
Shutting down instance "stb"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "stb" on database "stb"
Starting instance "stb"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor Failed.
Warning: You are no longer connected to ORACLE.
Please complete the following steps to finish switchover:
        start up and mount instance "stb" of database "stb"

Starting STB as standby DB:

Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 810053632 bytes
Fixed Size 2180104 bytes
Variable Size 478153720 bytes
Database Buffers 322961408 bytes
Redo Buffers 6758400 bytes
SQL> alter database mount standby database;
Database altered.

And at last:

C:\Tools\Oracle\product\11.2.0\db\database>dgmgrl sys/manager
DGMGRL for 64-bit Windows: Version 11.2.0.1.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration
Configuration - dr
Protection Mode: MaxAvailability
 Databases:
 prm - Primary database
 stb - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

At the end of article all instances are fine, PRM is primary back and all work could be made by users is safe.

Here Oracle Docs I used to write this note.

Enjoy your safety!

Useful scripts: Gather some session statistics…

RDBMS Version: 10g.
Script shows following session statistic values:
  • PGA Memory, in MB;
  • CPU, used by session;
  • Hard Parse, %;
  • Physical read bytes, in MB;
  • Physical write bytes, in MB;
  • Redo size, in MB;
  • Received from client, in MB;
  • Sent to client, in MB.
  SELECT Logon_time,
         (SELECT ROUND (VALUE / 1024 / 1024, 2)
            FROM v$sesstat
           WHERE STATISTIC# = 25 AND v$sesstat.SID = v$session.sid)
            AS "PGA Memory, in MB",
         (SELECT VALUE
            FROM v$sesstat
           WHERE STATISTIC# = 12 AND v$sesstat.SID = v$session.sid)
            AS "CPU, used by session",
         ROUND ( (SELECT VALUE
                    FROM v$sesstat
                   WHERE STATISTIC# = 339 AND v$sesstat.SID = v$session.sid)
                / (SELECT DECODE (VALUE, 0, 1, VALUE)
                     FROM v$sesstat
                    WHERE STATISTIC# = 338 AND v$sesstat.SID = v$session.sid),
                2)
            AS "Hard Parse, %",
         (SELECT ROUND (VALUE / 1024 / 1024, 2)
            FROM v$sesstat
           WHERE STATISTIC# = 58 AND v$sesstat.SID = v$session.sid)
            AS "Physical read bytes, in MB",
         (SELECT ROUND (VALUE / 1024 / 1024, 2)
            FROM v$sesstat
           WHERE STATISTIC# = 66 AND v$sesstat.SID = v$session.sid)
            AS "Physical write bytes, in MB",
         (SELECT ROUND (VALUE / 1024 / 1024, 2)
            FROM v$sesstat
           WHERE STATISTIC# = 139 AND v$sesstat.SID = v$session.sid)
            AS "Redo size, in MB",
         (SELECT ROUND (VALUE / 1024 / 1024, 2)
            FROM v$sesstat
           WHERE STATISTIC# = 344 AND v$sesstat.SID = v$session.sid)
            AS "Received from client, in MB",
         (SELECT ROUND (VALUE / 1024 / 1024, 2)
            FROM v$sesstat
           WHERE STATISTIC# = 343 AND v$sesstat.SID = v$session.sid)
            AS "Sent to client, in MB",
         SID,
         SERIAL#,
         v$session.STATUS,
         PROGRAM,
         USER#,
         USERNAME,
         COMMAND,
         OWNERID,
         OSUSER,
         PROCESS,
         MACHINE,
         OBJECT_NAME
    FROM    v$session
         LEFT OUTER JOIN
            DBA_OBJECTS
         ON v$session.ROW_WAIT_OBJ# = dba_objects.object_ID
   WHERE v$session.LOGON_TIME BETWEEN TRUNC (SYSDATE) AND SYSDATE
         --AND v$session.STATUS = 'ACTIVE'
ORDER BY 5 DESC

Oracle 11g have changed statistac ID’s there for I put the same script for 11g:

SELECT Logon_time,
       (SELECT ROUND (VALUE / 1024 / 1024, 2)
          FROM v$sesstat
         WHERE STATISTIC# = 35 AND v$sesstat.SID = v$session.sid)
          AS "PGA Memory, in MB",
       (SELECT VALUE
          FROM v$sesstat
         WHERE STATISTIC# = 17 AND v$sesstat.SID = v$session.sid)
          AS "CPU, used by session",
       ROUND ( (SELECT VALUE
                  FROM v$sesstat
                 WHERE STATISTIC# = 584 AND v$sesstat.SID = v$session.sid)
              / (SELECT DECODE (VALUE, 0, 1, VALUE)
                   FROM v$sesstat
                  WHERE STATISTIC# = 583 AND v$sesstat.SID = v$session.sid),
              2)
          AS "Hard Parse, %",
       (SELECT ROUND (VALUE / 1024 / 1024, 2)
          FROM v$sesstat
         WHERE STATISTIC# = 83 AND v$sesstat.SID = v$session.sid)
          AS "Physical read bytes, in MB",
       (SELECT ROUND (VALUE / 1024 / 1024, 2)
          FROM v$sesstat
         WHERE STATISTIC# = 96 AND v$sesstat.SID = v$session.sid)
          AS "Physical write bytes, in MB",
       (SELECT ROUND (VALUE / 1024 / 1024, 2)
          FROM v$sesstat
         WHERE STATISTIC# = 185 AND v$sesstat.SID = v$session.sid)
          AS "Redo size, in MB",
       (SELECT ROUND (VALUE / 1024 / 1024, 2)
          FROM v$sesstat
         WHERE STATISTIC# = 590 AND v$sesstat.SID = v$session.sid)
          AS "Received from client, in MB",
       (SELECT ROUND (VALUE / 1024 / 1024, 2)
          FROM v$sesstat
         WHERE STATISTIC# = 589 AND v$sesstat.SID = v$session.sid)
          AS "Sent to client, in MB",
       SID,
       SERIAL#,
       v$session.STATUS,
       PROGRAM,
       USER#,
       USERNAME,
       COMMAND,
       OWNERID,
       OSUSER,
       PROCESS,
       MACHINE,
       OBJECT_NAME
  FROM    v$session
       LEFT OUTER JOIN
          DBA_OBJECTS
       ON v$session.ROW_WAIT_OBJ# = dba_objects.object_ID
 WHERE v$session.LOGON_TIME BETWEEN TRUNC (SYSDATE) AND SYSDATE
       --AND v$session.STATUS = 'ACTIVE'
ORDER BY 5 DESC
%d такие блоггеры, как: