From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27100 invoked by alias); 21 May 2009 14:28:55 -0000 Received: (qmail 27093 invoked by alias); 21 May 2009 14:28:55 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,SPF_HELO_PASS X-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: RHEL5 - rgmanager: Fix up multiple Oracle instance handling To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 94baaa8813089f1496b8a2564ec1874ea97c1f60 X-Git-Newrev: 1e9e9ee1f1ba6449f1de3c0261fbfd4aebc03cd3 From: Lon Hohberger Message-Id: <20090521142818.66E2A12022C@lists.fedorahosted.org> Date: Thu, 21 May 2009 14:28:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00356.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1e9e9ee1f1ba6449f1de3c0261fbfd4aebc03cd3 Commit: 1e9e9ee1f1ba6449f1de3c0261fbfd4aebc03cd3 Parent: 94baaa8813089f1496b8a2564ec1874ea97c1f60 Author: Lon Hohberger AuthorDate: Thu May 21 09:37:15 2009 -0400 Committer: Lon Hohberger 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 --- 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 @@ -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() - + + + 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. + + + Oracle Listener Instance Name + + + + + + 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() - + This is the Oracle (application, not user) home directory. This is configured when you install Oracle. @@ -172,11 +187,13 @@ meta_data() - + - 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) Oracle Installation Type @@ -209,8 +226,8 @@ meta_data() - - + + @@ -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 " 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