Tuesday, December 30, 2014

How To Convert Working Dates into Days

How to Convert Only Working Dates into Days.

SELECT START_DATE,END_DATE,
  (TRUNC(END_DATE) - TRUNC(START_DATE) ) +1,
  trunc(end_date,'d')
  /*((((TRUNC(END_DATE,'D'))-(TRUNC(START_DATE,'D')))/7)*2) -
  (CASE WHEN TO_CHAR(START_DATE,'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) -
  (CASE WHEN TO_CHAR(END_DATE,'DY','nls_date_language=english')='SAT' THEN 1 ELSE 0 END) as BusinessDays*/  abc
FROM table_name
where to_char(start_date,'mon-yyyy')='dec-2014';

Tuesday, December 9, 2014

Different Caches Functions in Oracle

  • Shared pool:  used for caching shared cursors, stored procedures, dictionary caches, etc.
  • Buffer cache:  cache of disk data
  • Large pool:  large allocations
  • Java pool:  Java allocations and for caching java objects
  • Log buffer:  in-memory buffer for redo generation
  • Streams Pool:  new in 10g, for buffering inbound and outbound logical change records
  • Fixed SGA:  bootstrap section of the SGA

How To Flush Shared Pool/Buffer Cache

To Flush Buffer Cache.

alter system flush buffer_cache;

To Flush Shared Pool
alter system FLUSH SHARED_POOL;