public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: RHEL5 - rgmanager: Fix up multiple Oracle instance handling Date: Thu, 21 May 2009 14:28:00 -0000 [thread overview] Message-ID: <20090521142818.66E2A12022C@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1e9e9ee1f1ba6449f1de3c0261fbfd4aebc03cd3 Commit: 1e9e9ee1f1ba6449f1de3c0261fbfd4aebc03cd3 Parent: 94baaa8813089f1496b8a2564ec1874ea97c1f60 Author: Lon Hohberger <lhh@redhat.com> AuthorDate: Thu May 21 09:37:15 2009 -0400 Committer: Lon Hohberger <lhh@redhat.com> CommitterDate: Thu May 21 10:27:58 2009 -0400 rgmanager: Fix up multiple Oracle instance handling Note that you can only have one instance start/manage Enterprise Manager. You must set all other instances to "base" type (see metadata). Resolvs: 471226 Signed-off-by: Lon Hohberger <lhh@redhat.com> --- rgmanager/src/resources/oracledb.sh | 75 +++++++++++++++++++++++----------- 1 files changed, 51 insertions(+), 24 deletions(-) diff --git a/rgmanager/src/resources/oracledb.sh b/rgmanager/src/resources/oracledb.sh index 86f4b74..5c7b15c 100755 --- a/rgmanager/src/resources/oracledb.sh +++ b/rgmanager/src/resources/oracledb.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2003-2004, 2006-2007 Red Hat, Inc. +# Copyright 2003-2004, 2006-2008 Red Hat, Inc. # # Author(s): # Hardy Merrill <hmerrill at redhat.com> @@ -51,6 +51,7 @@ declare SCRIPTDIR="`dirname $0`" [ -n "$OCF_RESKEY_user" ] && ORACLE_USER=$OCF_RESKEY_user [ -n "$OCF_RESKEY_home" ] && ORACLE_HOME=$OCF_RESKEY_home [ -n "$OCF_RESKEY_name" ] && ORACLE_SID=$OCF_RESKEY_name +[ -n "$OCF_RESKEY_listener_name" ] && ORACLE_LISTENER=$OCF_RESKEY_listener_name [ -n "$OCF_RESKEY_lockfile" ] && LOCKFILE=$OCF_RESKEY_lockfile [ -n "$OCF_RESKEY_type" ] && ORACLE_TYPE=$OCF_RESKEY_type [ -n "$OCF_RESKEY_vhost" ] && ORACLE_HOSTNAME=$OCF_RESKEY_vhost @@ -90,7 +91,7 @@ declare SCRIPTDIR="`dirname $0`" # # 5. Type of Oracle Database. Currently supported: 10g 10g-iAS(untested!) # -[ -n "$ORACLE_TYPE" ] || ORACLE_TYPE=10g +[ -n "$ORACLE_TYPE" ] || ORACLE_TYPE="base-em" # # 6. Oracle virtual hostname. This is the hostname you gave Oracle during @@ -150,7 +151,21 @@ meta_data() <content type="string"/> </parameter> - <parameter name="user" unique="1" required="1"> + <parameter name="listener_name" unique="1"> + <longdesc lang="en"> + Oracle Listener Instance Name. If you have multiple + instances of Oracle running, it may be necessary to + have multiple listeners on the same machine with + different names. + </longdesc> + <shortdesc lang="en"> + Oracle Listener Instance Name + </shortdesc> + <content type="string"/> + </parameter> + + + <parameter name="user" required="1"> <longdesc lang="en"> Oracle user name. This is the user name of the Oracle user which the Oracle AS instance runs as. @@ -161,7 +176,7 @@ meta_data() <content type="string"/> </parameter> - <parameter name="home" unique="1" required="1"> + <parameter name="home" required="1"> <longdesc lang="en"> This is the Oracle (application, not user) home directory. This is configured when you install Oracle. @@ -172,11 +187,13 @@ meta_data() <content type="string"/> </parameter> - <parameter name="type" required="1"> + <parameter name="type" required="0"> <longdesc lang="en"> - This is the Oracle installation type. - Only "10g" and "10g-ias" are supported, and 10g-ias is - untested. + This is the Oracle installation type: + base - Database Instance and Listener only + base-em (or 10g) - Database, Listener, Enterprise Manager, + and iSQL*Plus + ias (or 10g-ias) - Internet Application Server (Infrastructure) </longdesc> <shortdesc lang="en"> Oracle Installation Type @@ -209,8 +226,8 @@ meta_data() <action name="status" timeout="10"/> <action name="monitor" timeout="10"/> - <action name="status" depth="10" timeout="30" interval="5m"/> - <action name="monitor" depth="10" timeout="30" interval="5m"/> + <action name="status" depth="10" timeout="30" interval="30"/> + <action name="monitor" depth="10" timeout="30" interval="30"/> <action name="meta-data" timeout="5"/> <action name="verify-all" timeout="5"/> @@ -285,7 +302,7 @@ start_db() grep -q "failure" $logfile if [ $? -eq 0 ]; then rm -f $tmpfile - echo "ORACLE_SID Incorrectly set?" + echo "ORACLE_SID Incorrectly set?" echo "See $logfile for more information." return 1 fi @@ -347,7 +364,8 @@ force_cleanup() declare pids declare pid - pids=`ps ax | grep $ORACLE_HOME | grep -v grep | awk '{print $1}'` + # Patch from Shane Bradley to fix 471266 + pids=`ps ax | grep $ORACLE_HOME | grep "ora_.*_${ORACLE_SID}" | grep -v grep | awk '{print $1}'` initlog -n $SCRIPT -s "<err> Not all Oracle processes exited cleanly, killing" @@ -467,8 +485,9 @@ get_lsnr_status() # for (( i=$RESTART_RETRIES ; i; i-- )) ; do - action "Restarting Oracle listener:" lsnrctl start - lsnrctl status >& /dev/null + action "Restarting Oracle listener:" lsnrctl start \ + $ORACLE_LISTENER + lsnrctl status $ORACLE_LISTENER >& /dev/null if [ $? == 0 ] ; then break # Listener was (re)started and is running fine fi @@ -670,7 +689,16 @@ validation_checks() # # If we don't know the type, we're done # - [ "$ORACLE_TYPE" = "10g" ] || [ "$ORACLE_TYPE" = "10g-ias" ] || oops ORACLE_TYPE + if [ "$ORACLE_TYPE" = "base" ]; then + # Other names for base + ORACLE_TYPE="base" + elif [ "$ORACLE_TYPE" = "10g" ] || [ "$ORACLE_TYPE" = "base-em" ]; then + ORACLE_TYPE="base-em" + elif [ "$ORACLE_TYPE" = "10g-ias" ] || [ "$ORACLE_TYPE" = "ias" ]; then + ORACLE_TYPE="ias" + else + oops ORACLE_TYPE + fi # # If the hostname is zero-length, fix it @@ -712,12 +740,12 @@ validation_checks() start_oracle() { faction "Starting Oracle Database:" start_db || return 1 - action "Starting Oracle Listener:" lsnrctl start || return 1 + action "Starting Oracle Listener:" lsnrctl start $ORACLE_LISTENER || return 1 - if [ "$ORACLE_TYPE" = "10g" ]; then + if [ "$ORACLE_TYPE" = "base-em" ]; then action "Starting iSQL*Plus:" isqlplusctl start || return 1 action "Starting Oracle EM DB Console:" emctl start dbconsole || return 1 - elif [ "$ORACLE_TYPE" = "10g-ias" ]; then + elif [ "$ORACLE_TYPE" = "ias" ]; then action "Starting Oracle EM:" emctl start em || return 1 action "Starting iAS Infrastructure:" opmnctl startall || return 1 fi @@ -740,16 +768,16 @@ stop_oracle() return 0 fi - if [ "$ORACLE_TYPE" = "10g" ]; then + if [ "$ORACLE_TYPE" = "base-em" ]; then action "Stopping Oracle EM DB Console:" emctl stop dbconsole || return 1 action "Stopping iSQL*Plus:" isqlplusctl stop || return 1 - elif [ "$ORACLE_TYPE" = "10g-ias" ]; then + elif [ "$ORACLE_TYPE" = "ias" ]; then action "Stopping iAS Infrastructure:" opmnctl stopall || return 1 action "Stopping Oracle EM:" emctl stop em || return 1 fi faction "Stopping Oracle Database:" stop_db || return 1 - action "Stopping Oracle Listener:" lsnrctl stop + action "Stopping Oracle Listener:" lsnrctl stop $ORACLE_LISTENER faction "Waiting for all Oracle processes to exit:" exit_idle if [ $? -ne 0 ]; then @@ -785,7 +813,6 @@ status_oracle() { declare -i subsys_lock=1 declare -i last - declare -i depth=$1 # # Check for lock file. Crude and rudimentary, but it works @@ -804,12 +831,12 @@ status_oracle() update_status $? $last last=$? - if [ "$ORACLE_TYPE" = "10g" ]; then + if [ "$ORACLE_TYPE" = "base-em" ]; then # XXX Add isqlplus status check?! emctl status dbconsole 2>&1 | grep "is running" update_status $? $last last=$? - elif [ "$ORACLE_TYPE" = "10g-ias" ]; then + elif [ "$ORACLE_TYPE" = "ias" ]; then # Check & report opmn / opmn-managed process status get_opmn_status $subsys_lock update_status $? $last
reply other threads:[~2009-05-21 14:28 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090521142818.66E2A12022C@lists.fedorahosted.org \ --to=lon@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).