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 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. 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 lines stop the Oracle service for each instance
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 the
rem ## third and fourth lines of this section.
set ORACLE_SID=instance_name1
%ORACLE_HOME%\bin\sqlplus.exe "/ AS SYSDBA" <%ORACLE_FO%\db_stop.sql
>%ORACLE_FO%\stop_%ORACLE_SID%.log
set ORACLE_SID=instance_name2
%ORACLE_HOME%\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 (OracleOraDb11g_home1TNSListener) 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.
shutdown immediate
exit
3. Select Start, Programs, Storage Mirroring, Failover Control Center.
4. Select the target machine from the list of available machines. If the target you need is not displayed,
click Add Target, enter the machine name, and click OK.
5. Click Login to login to the selected target.