Keep Oracle SID’s handy

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

, , , , ,

  1. Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.