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

Storage Mirroring 5.0 High availability for Oracle 11g 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
version
rem ## of Oracle, if necessary. Do not leave any spaces around the equal (=) sign.
set ORACLE_HOME=J:\app\Administrator\product\11.1.0\db_1
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.
Multiple
rem ## 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
j:\app\administrator\admin\%%a\pfile\init.ora.xxxxxxxxxx
rem ## The following line STARTS the Oracle instance(s). Substitute your Oracle instance
names for
rem ## 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
service
rem ## 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 for
rem ## each database. Also note that separate files (DB1_Start.sql and DB2_Start.sql) are
called for
rem ## the different databases so that the correct path to the parameter file (init.ora) is
used.
rem ## The outcome is redirected to a log file in the failover directory. Check this log
file for
rem ## errors. Substitute your instance names for instance_name1 and instance_name2.
set ORACLE_SID=instance_name1
%ORACLE_HOME%\bin\sqlplus.exe "/ AS SYSDBA"