We also use our Oracle Database for config management. As to how here is an example function...

Code:

#!/bin/sh
LOGIN="user/pass@host:1521"
CREATE_HOSTS_FILE () {
sqlplus -s $LOGIN <<EOF > hosts.out
SET HEAD OFF
SET LINESIZE 120
SET FEEDBACK OFF
SELECT
HOSTNAME, IP
FROM
HOSTS
WHERE
ACTIVE = 1
/
EOF
}
CREATE_HOSTS_FILE
# Now we have a file named hosts.out that we can review and then pass to all servers as the "/etc/hosts" file