$0 manages a SAP database of any type as an HA resource.
Currently Oracle, MaxDB, DB/2 UDB, Sybase ASE and SAP HANA Database are supported.
ABAP databases as well as JAVA only databases are supported.
The 'start' operation starts the instance.
The 'stop' operation stops the instance.
The 'status' operation reports whether the instance is running
The 'monitor' operation reports whether the instance seems to be working
The 'recover' operation tries to recover the instance after a crash (instance will be stopped first!)
The 'validate-all' operation reports whether the parameters are valid
The 'methods' operation reports on the methods $0 supports
- !
+ EOF
}
meta_data() {
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="SAPDatabase">
<version>2.14</version>
<shortdesc lang="en">Manages a SAP database instance as an HA resource.</shortdesc>
<longdesc lang="en">
Resource script for SAP databases. It manages a SAP database of any type as an HA resource.
The purpose of the resource agent is to start, stop and monitor the database instance of a SAP system. Together with the RDBMS system it will also control the related network service for the database. Like the Oracle Listener and the xserver of MaxDB.
The resource agent expects a standard SAP installation of the database and therefore needs less parameters to configure.
The resource agent supports the following databases:
- Oracle 10.2, 11.2 and 12
- DB/2 UDB for Windows and Unix 9.x
- SAP-DB / MaxDB 7.x
- Sybase ASE 15.7
-- SAP HANA Database since 1.00 - with SAP node 1625203 (http://sdn.sap.com)
+- SAP HANA Database since 1.00 - with SAP note 1625203 (http://sdn.sap.com)
In fact this resource agent does not run any database commands directly. It uses the SAP standard process SAPHostAgent to control the database.
The SAPHostAgent must be installed on each cluster node locally. It will not work, if you try to run the SAPHostAgent also as a HA resource.
Please follow SAP note 1031096 for the installation of SAPHostAgent.
The required minimum version of SAPHostAgent is:
Release: 7.20
Patch Number: 90
or compile time after: Dec 17 2011
</longdesc>
<parameters>
<parameter name="SID" unique="1" required="1">
<longdesc lang="en">The unique database system identifier. e.g. P01</longdesc>
<shortdesc lang="en">Database system ID</shortdesc>
<longdesc lang="en">Must be used for special database implementations, when database instance name is not equal to the SID (e.g. Oracle DataGuard)</longdesc>
<shortdesc lang="en">Database instance name, if not equal to SID</shortdesc>
<longdesc lang="en">The parameter can be set, if the database processes on operating system level are not executed with the default user of the used database type. Defaults: ADA=taken from /etc/opt/sdb, DB6=db2SID, ORA=oraSID and oracle, SYB=sybSID, HDB=SIDadm</longdesc>
<shortdesc lang="en">the Linux user that owns the database processes on operating system level</shortdesc>
<longdesc lang="en">This controls how the resource agent monitors the database. If set to true, it will use 'saphostctrl -function GetDatabaseStatus' to test the database state. If set to false, only operating system processes are monitored.</longdesc>
<longdesc lang="en">Defines which services are monitored by the SAPDatabase resource agent, if STRICT_MONITORING is set to true. Service names must correspond with the output of the 'saphostctrl -function GetDatabaseStatus' command.</longdesc>
<shortdesc lang="en">Database services to monitor</shortdesc>
# we have to parse the output, because the returncode doesn't tell anything about the instance status
for SERVICE in `echo "$output" | grep -i 'Component[ ]*Name *[:=] [A-Za-z][A-Za-z0-9_]* (' | sed 's/^.*Component[ ]*Name *[:=] *\([A-Za-z][A-Za-z0-9_]*\).*$/\1/i'`