The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 02-10-2009
ddreggors ddreggors is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 91
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