HP StorageWorks Storage Mirroring application notes - High availability for Oracle 9i (T2558-88087, April 2008)
10
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
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 lines stop the Oracle databases.
rem ## Substitute your oracle instance names for instance_name1 and
rem ## instance_name2.
rem ## If you only have one Oracle database, remark out the last two commands 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 lines stop other non-instance specific Oracle services.
rem ## The value in parenthesis are the services to stop.
FOR %%a IN (OracleOraHomeTNSListener OracleOraHomeHTTPServer OracleOraHomeAgent) DO net
stop %%a >>%ORACLE_FO%\stop_service.log
The DB_STOP.SQL script used in the pre-failback script is included below.
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. To add a monitor for the selected target, click
Add Monitor. Type the name of the source machine and
click
OK. The Monitor Settings window will open.