PRIMECLUSTER Wizard for Oracle allows users to execute their own unique processing before, while or after startup or stop of Oracle instances and listeners (Online/ Offline processing). For example, application startup/stop and batch processing can be executed along with startup or stop of Oracle instances and listeners.
Script Type
Script | Description | ||
startup | PreOnlineScript | Executed before OnlineScript. | |
OnlineScript | Starts resource up during userApplication Online processing. | ||
| prestartup* | It is usable only for the Oracle instance resource in standby operation. | |
| nomount* | It is usable only for the Oracle instance resource in standby operation. | |
| mount* | It is usable only for the Oracle instance resource in standby operation. | |
PostOnlineScript | Executed after OnlineScript. | ||
stop | PreOfflineScript | Executed before OfflineScript. | |
OfflineScript | Stops resource down during userApplication Offline processing. | ||
PostOfflineScript | Executed after OfflineScript. | ||
other | FaultScript | Executed when failures occur. |
See
For information on how to set up the scripts below, see the step 5 or 7 of “2.2.7.2 Oracle Resource Creation”, the step 5 of “2.3.4 userApplication with Oracle Clusterware”, or the step 7 or 10 of “2.3.5 userApplication with Oracle RAC Instances and Listeners”.
PreOnlineScript
PostOnlineScript
PreOfflineScript
PostOfflineScript
FaultScript
For detail of these scripts below, refer to "3.1 Oracle Control through PRIMECLUSTER Wizard for Oracle".
OnlineScript
OfflineScript
Execution Sequence
Script | userApplication startup | resource AutoRecover | userApplication stop | userApplication stop | ||
startup | PreOnlineScript | 1 | - | - | - | |
OnlineScript | 2 | 1 | - | - | ||
| prestartup* | 3 | 2 | - | - | |
| nomount* | 4 | 3 | - | - | |
| mount* | 5 | 4 | - | - | |
PostOnlineScript | 6 | 5 | - | - | ||
stop | PreOfflineScript | - | - | 1 | 2 | |
OfflineScript | - | - | 2 | 3 | ||
PostOfflineScript | - | - | 3 | 4 | ||
other | FaultScript | - | - | - | 1 |
Example
A sample of execution sequence where an Oracle instance resource and a listener resource are registered in the standby operation and StartPriority is set as "Listener" is described below.
userApplication startup
Note that all PreOnlineScript are executed firstly.
PreOnlineScript of Listener resource
PreOnlineScript of Oracle instance resource
OnlineScript of Listener resource
PostOnlineScript of Listener resource
OnlineScript (including startup*, nomount*, mount*) of Oracle instance resource
PostOnlineScript of Oracle instance resource
Listener resource AutoRecover
Note that PreOnlineScript of Listener resource is not executed.
OnlineScript of Listener resource
PostOnlineScript of Listener resource
normal userApplication stop (user operation)
Note that all PreOfflineScript are executed firstly.
PreOfflineScript of Oracle instance resource
PreOfflineScript of Listener resource
OfflineScript of Oracle instance resource
PostOfflineScript of Oracle instance resource
OfflineScript of Listener resource
PostOfflineScript of Listener resource
userApplication stop caused by Listener resource failure
Note that not only FaultScript of Listener resource but also FaultScript of Oracle instance resource are executed.
FaultScript of Listener resource
FaultScript of Oracle instance resource
PreOfflineScript of Oracle instance resource
PreOfflineScript of Listener resource
OfflineScript of Oracle instance resource
PostOfflineScript of Oracle instance resource
OfflineScript of Listener resource
PostOfflineScript of Listener resource
Notice (PreOnlineScript, PostOnlineScript, PreOfflineScript, PostOfflineScript, FaultScript)
Execute the scripts using root privileges.
The exit code 0 indicates normal termination. The value other than 0 indicates abnormal termination or Online processing or Offline processing of userApplication failure.
If the script exceeds the maximum execution time (ScriptTimeout), switching process will fail.
Each script has the environment variable defined in RMS.
Information
For details of each script, see “2.6.3 Script” of the “PRIMECLUSTER RMS Configuration and Administration Guide”.
Notice (prestartup*, nomount*, mount*)
The file is stored in /opt/FJSVclora/usr. If there are two or more files, they will be executed in alphabetical order of the file name.
A return code of 0 indicates normal termination. A return code of other than 0 indicates abnormal termination. If the script terminates abnormally, Oracle instance startup will also fail.
root privileges are used for script execution.
The parameters are as follows:
$1 : $ORACLE_HOME
$2 : $ORACLE_SID
$3 : Oracle user name
If the script is not completed within the timeout period for Oracle instance startup, it will be considered as abnormal exit. Refer to step 5 of "2.2.7.2 Oracle Resource Creation".
Using of the "su -" command is not supported for user scripts(prestartup*, nomount*, mount*) under /opt/FJSVclora/usr.
Note
These scripts are enabled with Oracle instance resources in standby operation.
Note that they cannot be used with resources other than Oracle instance resources, and cannot also be used in scalable operation with Oracle RAC.