A trick to always keep andy all SID’s of all the different DB instance in your system’s can belike the following script.
I recommend to save into a separate text file (say orasids.sh) in your oracle $HOME directory and source from .bash_profile as its last line: or in alternatives, you can source at any time as follows
# source orasids.sh
Of course this file must be chown’ed 750.
#!/bin/bash
#
function showsid () { echo -en “ORACLE_SID: $ORACLE_SID\n” ;};
function db01test () { export ORACLE_SID=db01test; showsid ;};
function prod () { export ORACLE_SID=prod; showsid ;};
function nosid () { unset ORACLE_SID; showsid ;};
showsid
#
# end-of-file