HP StorageWorks Storage Mirroring 5.0 application notes - High availability for Oracle 10g (T2558-88089, April 2008)

Storage Mirroring 5.0 High availability for Oracle 10g application notes 9
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 in the Oracle
rem ## failover directory c:\oracle_fo
rem ## Note: %%a is a constant recognized in the command line mode and should NOT be
substituted.
rem ## This script demonstrates a multiple (2) Oracle instance environment
rem ## The next two lines establish the working directories. Specify the location of your
Oracle
rem ## program files in the first line. Make sure to update the home directory path for your
rem ## version of Oracle. Do not leave any spaces around the equal (=) sign.
set ORACLE_HOME=E:\oracle\product\10.x.x
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%\db_1\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). Substitute your Oracle instance
names
rem ## for instance_name1 and instance_name2. Multiple 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 are started
on an
rem ## as-needed basis depending on the Oracle operations you are running. The
OracleDBConsole is
rem ## started in the following example. Add additional services as needed, separating the
rem ## service name by a space. The outcome is redirected to a log file in the failover
directory.
rem ## Check this log file for errors.
for %%a IN (OracleDBConsole) DO NET START %%a >>%ORACLE_FO%\start_services.log
rem ## The following lines mount and open the databases. Note that the same command is
repeated
rem ## for each database. Also note that separate files (DB1_Start.sql and DB2_Start.sql)
are
rem ## called for the different databases so that the correct path to the parameter file
rem ## (init.ora) is used. The outcome is redirected to a log file in the failover
directory.
rem ## Check this log file for errors. Substitute your instance names for instance_name1 and
rem ## instance_name2.