Posts

ASH and AWR Performance Tuning Query

Listed below are some SQL queries which I find particularly useful for performance tuning. These are based on the Active Session History V$ View to get a current perspective of performance and the DBA_HIST_* AWR history tables for obtaining performance data pertaining to a period of time in the past. Top Recent Wait Events col EVENT format a60 select * from ( select active_session_history.event, sum(active_session_history.wait_time + active_session_history.time_waited) ttl_wait_time from v$active_session_history active_session_history where active_session_history.event is not null group by active_session_history.event order by 2 desc) where rownum < 6 / Top Wait Events Since Instance Startup col event format a60 select event, total_waits, time_waited from v$system_event e, v$event_name n where n.event_id = e.event_id and n.wait_class !='Idle' and n.wait_class = (select wait_class from v$session_wait_class  where wait_class !=...

Huge Archive Log Generation in Oracle

##  Hour wise archive generation: SELECT to_date(first_time) DAY, to_char(sum(decode(to_char(first_time,'HH24'),'00',1,0)),'999') "00", to_char(sum(decode(to_char(first_time,'HH24'),'01',1,0)),'999') "01", to_char(sum(decode(to_char(first_time,'HH24'),'02',1,0)),'999') "02", to_char(sum(decode(to_char(first_time,'HH24'),'03',1,0)),'999') "03", to_char(sum(decode(to_char(first_time,'HH24'),'04',1,0)),'999') "04", to_char(sum(decode(to_char(first_time,'HH24'),'05',1,0)),'999') "05", to_char(sum(decode(to_char(first_time,'HH24'),'06',1,0)),'999') "06", to_char(sum(decode(to_char(first_time,'HH24'),'07',1,0)),'999') "07", to_char(sum(decode(to_char(first_time,'HH24'),'08',1,0)),'999')...

Oracle 11g Active Data Guard

Steps to configure Oracle 11g Active Data Guard:  ==================================================== Server details  Primary Server: hostname: vmnsedb01 Db_name : nsewebdv DB unique name: nsewebdv DB Service name: nsewebdv sys password: N5EwEbdV ++++++++++++++++++++++++ Standby Server hostname: vmnsedb02 Db_name : nsewebdv DB unique name :nsewebsb DB Service name :nsewebsb sys password: N5EwEbdV ==================================================== In Primary Database  STEP:1# Enable force logging: sql> select force_logging from v$database;   #Output: No sql> alter database force logging; sql> select force_logging from v$database;   #Output: Yes STEP:2# Enable archiving: sql> shut immediate; sql> startup mount; sql> alter database archivelog; sql> alter database open; sql> archive log list  #Output: Enable STEP:3# Create a password file for primary and standby. Password should be same for both prim...