|
|
cf07b3 |
From bc521235c8b630dd1f379e005c51b106a4cce701 Mon Sep 17 00:00:00 2001
|
|
|
cf07b3 |
From: David Vossel <dvossel@redhat.com>
|
|
|
cf07b3 |
Date: Tue, 10 Sep 2013 18:17:21 -0500
|
|
|
cf07b3 |
Subject: [PATCH] Low: oralsnr: Add tns_admin option for setting custom
|
|
|
cf07b3 |
TNS_ADMIN path
|
|
|
cf07b3 |
|
|
|
cf07b3 |
---
|
|
|
cf07b3 |
heartbeat/ora-common.sh | 9 +++++++--
|
|
|
cf07b3 |
heartbeat/oracle | 2 +-
|
|
|
cf07b3 |
heartbeat/oralsnr | 14 +++++++++++++-
|
|
|
cf07b3 |
3 files changed, 21 insertions(+), 4 deletions(-)
|
|
|
cf07b3 |
|
|
|
cf07b3 |
diff --git a/heartbeat/ora-common.sh b/heartbeat/ora-common.sh
|
|
|
cf07b3 |
index f52dbc5..5bbb163 100644
|
|
|
cf07b3 |
--- a/heartbeat/ora-common.sh
|
|
|
cf07b3 |
+++ b/heartbeat/ora-common.sh
|
|
|
cf07b3 |
@@ -19,6 +19,7 @@ ora_common_getconfig() {
|
|
|
cf07b3 |
ORACLE_SID=$1
|
|
|
cf07b3 |
ORACLE_HOME=$2
|
|
|
cf07b3 |
ORACLE_OWNER=$3
|
|
|
cf07b3 |
+ TNS_ADMIN=$4
|
|
|
cf07b3 |
|
|
|
cf07b3 |
# get ORACLE_HOME from /etc/oratab if not set
|
|
|
cf07b3 |
[ x = "x$ORACLE_HOME" ] &&
|
|
|
cf07b3 |
@@ -28,9 +29,13 @@ ora_common_getconfig() {
|
|
|
cf07b3 |
[ x = "x$ORACLE_OWNER" ] &&
|
|
|
cf07b3 |
ORACLE_OWNER=`ls -ld $ORACLE_HOME/. 2>/dev/null | awk 'NR==1{print $3}'`
|
|
|
cf07b3 |
|
|
|
cf07b3 |
+ # There are use-cases were users want to be able to set a custom TMS_ADMIN path.
|
|
|
cf07b3 |
+ # When TNS_ADMIN is not provided, use the default path.
|
|
|
cf07b3 |
+ [ x = "x$TNS_ADMIN" ] &&
|
|
|
cf07b3 |
+ TNS_ADMIN=$ORACLE_HOME/network/admin
|
|
|
cf07b3 |
+
|
|
|
cf07b3 |
LD_LIBRARY_PATH=$ORACLE_HOME/lib
|
|
|
cf07b3 |
LIBPATH=$ORACLE_HOME/lib
|
|
|
cf07b3 |
- TNS_ADMIN=$ORACLE_HOME/network/admin
|
|
|
cf07b3 |
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/dbs:$PATH
|
|
|
cf07b3 |
export ORACLE_SID ORACLE_HOME ORACLE_OWNER TNS_ADMIN
|
|
|
cf07b3 |
export LD_LIBRARY_PATH LIBPATH
|
|
|
cf07b3 |
@@ -70,7 +75,7 @@ ORACLE_HOME=$ORACLE_HOME
|
|
|
cf07b3 |
ORACLE_OWNER=$ORACLE_OWNER
|
|
|
cf07b3 |
LD_LIBRARY_PATH=$ORACLE_HOME/lib
|
|
|
cf07b3 |
LIBPATH=$ORACLE_HOME/lib
|
|
|
cf07b3 |
-TNS_ADMIN=$ORACLE_HOME/network/admin
|
|
|
cf07b3 |
+TNS_ADMIN=$TNS_ADMIN
|
|
|
cf07b3 |
export ORACLE_SID ORACLE_HOME ORACLE_OWNER TNS_ADMIN
|
|
|
cf07b3 |
export LD_LIBRARY_PATH LIBPATH
|
|
|
cf07b3 |
EOF
|
|
|
cf07b3 |
diff --git a/heartbeat/oracle b/heartbeat/oracle
|
|
|
cf07b3 |
index 2d17e1a..d6b2c50 100755
|
|
|
cf07b3 |
--- a/heartbeat/oracle
|
|
|
cf07b3 |
+++ b/heartbeat/oracle
|
|
|
cf07b3 |
@@ -473,7 +473,7 @@ ora_cleanup() {
|
|
|
cf07b3 |
}
|
|
|
cf07b3 |
|
|
|
cf07b3 |
oracle_getconfig() {
|
|
|
cf07b3 |
- ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user"
|
|
|
cf07b3 |
+ ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user" "$OCF_RESKEY_tns_admin"
|
|
|
cf07b3 |
|
|
|
cf07b3 |
clear_backupmode=${OCF_RESKEY_clear_backupmode:-"false"}
|
|
|
cf07b3 |
shutdown_method=${OCF_RESKEY_shutdown_method:-"checkpoint/abort"}
|
|
|
cf07b3 |
diff --git a/heartbeat/oralsnr b/heartbeat/oralsnr
|
|
|
cf07b3 |
index 3a6d6f2..98fb120 100755
|
|
|
cf07b3 |
--- a/heartbeat/oralsnr
|
|
|
cf07b3 |
+++ b/heartbeat/oralsnr
|
|
|
cf07b3 |
@@ -104,6 +104,18 @@ Defaults to LISTENER.
|
|
|
cf07b3 |
<content type="string" default="" />
|
|
|
cf07b3 |
</parameter>
|
|
|
cf07b3 |
|
|
|
cf07b3 |
+<parameter name="tns_admin" required="0" unique="1">
|
|
|
cf07b3 |
+<longdesc lang="en">
|
|
|
cf07b3 |
+ Full path to the directory that contains the Oracle
|
|
|
cf07b3 |
+ listener tnsnames.ora configuration file. The shell
|
|
|
cf07b3 |
+ variable TNS_ADMIN is set to the value provided.
|
|
|
cf07b3 |
+</longdesc>
|
|
|
cf07b3 |
+<shortdesc lang="en">
|
|
|
cf07b3 |
+ Full path to the directory containing tnsnames.ora
|
|
|
cf07b3 |
+</shortdesc>
|
|
|
cf07b3 |
+<content type="string"/>
|
|
|
cf07b3 |
+</parameter>
|
|
|
cf07b3 |
+
|
|
|
cf07b3 |
</parameters>
|
|
|
cf07b3 |
|
|
|
cf07b3 |
<actions>
|
|
|
cf07b3 |
@@ -245,7 +257,7 @@ oralsnr_status() {
|
|
|
cf07b3 |
}
|
|
|
cf07b3 |
|
|
|
cf07b3 |
oralsnr_getconfig() {
|
|
|
cf07b3 |
- ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user"
|
|
|
cf07b3 |
+ ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user" "$OCF_RESKEY_tns_admin"
|
|
|
cf07b3 |
listener=${OCF_RESKEY_listener:-"LISTENER"}
|
|
|
cf07b3 |
}
|
|
|
cf07b3 |
|
|
|
cf07b3 |
--
|
|
|
cf07b3 |
1.8.1
|
|
|
cf07b3 |
|