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 11
Sample_preback.bat
rem ## ***SAMPLE*** Oracle pre-failback 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 db_stop.sql file referenced in this script is located in the Oracle failover
rem ## 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=C:\oracle\product\10.x.x set ORACLE_FO=C:\ORACLE_FO
rem ## The following lines stop the Oracle service for each instance
rem ## as well as the dependant OracleDBConsole service.
FOR %%a IN (instance_name1 instance_name2) DO NET STOP ORACLEDBCONSOLE%%a
>>%ORACLE_FO%\stop_service.log
FOR %%a IN (instance_name1 instance_name2) DO NET STOP ORACLESERVICE%%a
>>%ORACLE_FO%\stop_service.log
rem ## The following lines stop the Oracle databases. Substitute your Oracle instance names
rem ## for instance_name1 and instance_name2. If you only have one Oracle database, remark
out
rem ## the third and fourth lines of this section.
set ORACLE_SID=instance_name1
%ORACLE_HOME%\db_1\bin\sqlplus.exe "/ AS SYSDBA" <%ORACLE_FO%\db_stop.sql
>%ORACLE_FO%\stop_%ORACLE_SID%.log
set ORACLE_SID=instance_name2
%ORACLE_HOME%\db_1\bin\sqlplus.exe "/ AS SYSDBA" <%ORACLE_FO%\db_stop.sql
>%ORACLE_FO%\stop_%ORACLE_SID%.log
rem ## The following line stops other non-instance specific Oracle services. The value in
rem ## parenthesis are the services to stop.
FOR %%a IN (OracleOraHomeTNSListener) DO net stop %%a >>%ORACLE_FO%\stop_service.log
The following example illustrates the DB_STOP.SQL script used in the pre-failback script.
Sample_db_stop.sql
## ***SAMPLE*** db_stop.sql script called during the Storage Mirroring pre-failback script.
## This sample batch file is provided as an example only. Because no two
## environments or configurations are exactly the same, you MUST modify
## this script in order to make the solution work in your environment.
## Shutdown the database immediately.