Re: SQL statements

From: Pradhan <empradhan_at_dplus.net>
Date: Thu, 22 Jul 1999 18:09:28 -0400
Message-ID: <2DMl3.259$xA.897_at_newsfeed.slurp.net>


Puneet Khanna wrote in message <7n7dv4$7g8$1_at_nntp3.uunet.ca>...
>I want to know SQL statements for -
>
>1. Checking how long database instance is up.
  there is a system view named v$lock and look for the column like ttime or so.. then
following will give you the how long instance was up.

    select max(time)/86400 from v$lock;

>2. How many active users are in the system.

        select count(*) from v$session;

     only thing here is it also gives you the background processes and in general case they are 6 processes .

>3. Are there any locking problems.

     select * from v$lock;

check for the sessions which are not background processes lgwr (log writer) and some times smon (system monitor) background processes will have lock on some object continuously... disregard them and look for the other processes.

>
>Thanks in advance,
>Puneet
>

HTH
Pradhan Received on Fri Jul 23 1999 - 00:09:28 CEST

Original text of this message