awk -F: '/^[^#]/ { print $2 }' /etc/oratab | uniq
`/^[^#]/` matches every line the first character of which is not a `#`; `[^` means "none of the charaters before the next (or rather: closing) `]`.
As only the part between the first two colons is needed `-F:' makes`awk`split the line at colons, and`print $2` prints the second part.