How to get all database which can be used in 'db_set_active'
All database connection strings are in global $databases variable;

global $databases;
dpm($databases);


with drush:

drush php-eval 'global $databases; print_r($databases);'