12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- @echo off
- REM : '
- REM : ************************************************************************
- REM :
- REM : Licensed Material - Property Of IBM
- REM :
- REM : "Restricted Materials of IBM"
- REM :
- REM : IBM Informix Dynamic Server
- REM : (c) Copyright IBM Corporation 1996, 2008 All rights reserved.
- REM :
- REM : Title : hdrmkpri.bat
- REM : Description: This script changes the type of the Data replication
- REM : server to Primary.
- REM : This script must be run with appropriate DBA privileges.
- REM :
- REM : ************************************************************************
- REM : '
- SET WINROOT=%SystemRoot%
- IF "x%WINROOT%" == "x" SET WINROOT=C:\WINNT
- SET IBIN=%INFORMIXDIR%\bin
- SET ONSTAT=%IBIN%\onstat
- SET ONMODE=%IBIN%\onmode
- echo.
- echo This script changes the type of the Data replication server to Primary,
- echo and must be run with appropriate Database Administrator privileges.
- echo.
- echo Steps to switch server types in an HDR pair:
- echo.
- echo Instance A (currently Primary) Instance B (currently Secondary)
- echo ------------------------------ --------------------------------
- echo 1] onmode -ky (server should be up)
- echo 2] hdrmkpri.bat {primary_server_name}
- echo 3] hdrmksec.bat {secondary_server_name}
- echo 4] starts %%INFORMIXSERVER%%
- echo (now a Secondary server) (now a Primary server)
- REM # Check usage
- if not "%1" == "" goto USAGE_CORRECT
- echo.
- echo Usage: %0 {paired server name}
- echo.
- exit 1
- : USAGE_CORRECT
- SET PAIRED_SERVER=%1
- echo.
- echo WARNING: Please ensure the following before proceeding further:
- echo.
- echo 1] the paired database server is OFFLINE,
- echo 2] the current database server is up, and
- echo 3] the current database server has Data replication turned OFF.
- echo.
- echo Not doing so, shall make the two database servers in the
- echo Data replication pair out-of-sync, and shall require
- echo re-establishing the pair.
- echo.
- PAUSE
- echo.
- echo Changing to Standard type via:
- echo onmode -d standard
- onmode -d standard
- sleep 2
- echo.
- echo Changing to Primary type via: (could take a couple of minutes)
- echo onmode -d primary %PAIRED_SERVER%
- onmode -d primary %PAIRED_SERVER%
- sleep 2
- echo.
- echo Shutting down the database server via:
- echo onmode -ky
- echo.
- echo NOTE: Shutting down the database server now is MANDATORY, because
- echo if the two database servers in a Data replication pair
- echo are brought up as Primary/Standard type OR,
- echo if one database server is up and the mode of the paired server
- echo is changed, then the database servers in the pair could
- echo become out-of-sync, leading to establishing the pair again.
- onmode -ky
- echo.
- echo Run %%INFORMIXDIR%%\bin\hdrmksec.bat on the paired server.
- echo After the run OR if it has already been run, then WITHOUT bringing the
- echo paired (now Secondary) server down, start the current (now Primary)
- echo database server, to make the Data replication pair operational.
- echo.
|