Observational studies are important tools for providing information on the safety and benefit of approved medications; they provide data on real-life use, rare outcomes and long-term effects that were undetectable in randomized controlled trials. We review various administrative databases in the US and Canada, in addition to European medical records databases, which have been used extensively to assess drug safety. We present their advantages, which include their large size and the availability of systematic and accurate medication data from pharmacies and extensive outcome data from hospital records, and limitations, including the questionable validity of diagnostic information and absence of information on confounders (e.g. disease severity) and over-the-counter drugs. We illustrate these challenges in the investigation of the cardiovascular risks of the cyclo-oxygenase 2 inhibitor rofecoxib and highlight important methodological issues, beyond the limitations of the databases, which could explain the contradictory findings from three observational studies that used these databases. We show that issues relating to the duration of drug use, immortal time, depletion of susceptibles and overadjustment were problematic sources of bias in these studies and discuss remedies to avoid these pitfalls. With careful attention to their design and analysis, observational database studies are powerful and modern tools for providing crucial data on drug effects.