HP StorageWorks Storage Mirroring application notes - High availability for Oracle 9i (T2558-88087, April 2008)

8
NOTE: After you modify the sample scripts, save them with a new name to remove the sample_ prefix.
Copy the scripts to the directory where Storage Mirroring is installed.
The sample batch files provided are only examples. Because no two environments or configurations are
exactly the same, you MUST modify the sample scripts in order to make the solution work in your
environment.
Sample_postover.bat
rem ## ***SAMPLE*** Oracle post-failover script
rem ## This sample batch file is provided as an example only. Because no two
rem ## environments or configurations are exactly the same, you MUST modify
rem ## this script in order to make the solution work in your environment.
rem ## This script makes the following two assumptions:
rem ## 1. You have created a directory c:\oracle_fo
rem ## 2. The dbx_start.sql file referenced in this script is located
rem ## in the oracle failover directory c:\oracle_fo
rem ## Note: %%a is a constant recognized in the command line mode and should NOT
rem ## be substituted.
rem ## This script demonstrates a multiple (2) Oracle instance environment
rem ## The next two lines establish the working directories. Specify the location
rem ## of your Oracle program files in the first line. Do not leave any spaces
rem ## around the equal (=) sign.
set ORACLE_HOME=C:\ORACLE\ORA90
set ORACLE_FO=C:\ORACLE_FO
rem ## The following line CREATES the Oracle instance(s). In the event where a database
instance
rem ## has not been created on the target it will need to be created here. An example is if
the
rem ## database was created on the source server after the Storage Mirroring connection is
established
rem ## and that instance was not created on the target. The command is given below.
rem ## Substitute your Oracle instance names for instance_name1 and instance_name2.
rem ## Multiple instances are separated by a space.
rem ## for %%a IN (instance_name1 instance_name2) DO %ORACLE_HOME%\bin\oradim -new -sid %%a
-srvc oracleservice%%a -startmode auto -pfile %ORACLE_HOME%\admin\instance_name\init.ora
rem ## The following line STARTS the Oracle instance(s).
rem ## Substitute your oracle instance names for instance_name1 and instance_name2.
Multiple
rem ## instances are separated by a space.
for %%a IN (instance_name1 instance_name2) DO NET START ORACLESERVICE%%a
rem ## The following line starts other Oracle services. The services specified
rem ## are started on an as-needed basis depending on the Oracle operations
rem ## you are running. The Oracle HTTP Server and the Oracle Agent are started
rem ## in the following example. Add additional services as needed separating
rem ## the service names by a space. The outcome is redirected to a log file in
rem ## the failover directory. Check this log file for errors.
for %%a IN (OracleOraHomeHTTPServer OracleOraHomeAgent) DO NET START %%a
>>%ORACLE_FO%\start_services.log