Wednesday, August 10, 2011

How To Identify Database Idle Sessions


The below scripts will identify the Database Idle Session .When on firing the below the scripts, it will prompt for the number of minutes the session is idle for.
 
SQL> select 
sid, username, status,
 to_char(logon_time,’dd-mm-yy hh:mi:ss’) “LOGON”,
floor(last_call_et/3600)||’:'||  floor(mod(last_call_et,3600)/60)||’:'||
mod(mod(last_call_et,3600),60) “IDLE”,
program
from   v$session
where  type=’USER’
and   (LAST_CALL_ET / 60) > &minutes
order by last_call_et;

Enjoy    :-) 

Difference Between OBSOLETE AND EXPIRED Backup


RMAN considers backups of datafiles and control files as obsolete, that is, no longer needed for recovery, according to criteria that we specify in the CONFIGURE command. We can then use the REPORT OBSOLETE  command to view obsolete files and DELETE OBSOLETE to delete them .
For ex  :  we set our retention policy to redundancy 2. this means we always want to keep at least 2 backup, after 2 backup, if we take an another backup oldest one become obsolete because there is 3 backup and we want to keep 2. if our flash recovery area is full then obsolete backups can be overwrite.

A status of "expired" means that the backup piece or backup set is not found in the backup destination or missing .Since backup info is hold in our controlfile and catalog . Our controlfile thinks that there is a backup under a directory with a name but someone delete this file from operating system. We can run crosscheck command to check if these files are exist and if rman found a file is missing then mark that backup record as expired which means is no more exists.


Enjoy   :-) 

Monday, August 8, 2011

Daily Tasks Of A Database Administrator


The Database Administrator is one of the most difficult and critical positions to fill and retain. DBAs must be able to react, communicate, and plan across many different business functions.  Here we will find a set of common tasks needed to be performed daily by any DBA. The tasks are as below  

  1.) Regular Monitoring of The free space in Database.
  2.) Verify instance status
  3.) Check alerts logs, Trace files and Listener Logs
  4.) Check configured metrics
  5.) Tablespace Usage
  6.) Check RMAN backups
  7.) Check users User sessions
  8.) Check memory usage
  9.) Check network load
10.) Object modifications
11.) Check User sessions
12.) Redo log status
13.) Analyzing the performance of theDatabase
14.) Checking the long running queries on the database
15.) Monitoring the Top SQL Statements
16.) Monitoring Sessions
17.) Monitoring System Statistics
18.) Are the Oracle Names and LDAP Servers up and responding to requests.
19.) Check to ensure that no objects exist in the database with the status ‘INVALID’


Enjoy    :-)