Studies on long term variability of active galactic nuclei and O VI absorption in the interstellar medium