hdrmkpri.bat 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. @echo off
  2. REM : '
  3. REM : ************************************************************************
  4. REM :
  5. REM : Licensed Material - Property Of IBM
  6. REM :
  7. REM : "Restricted Materials of IBM"
  8. REM :
  9. REM : IBM Informix Dynamic Server
  10. REM : (c) Copyright IBM Corporation 1996, 2008 All rights reserved.
  11. REM :
  12. REM : Title : hdrmkpri.bat
  13. REM : Description: This script changes the type of the Data replication
  14. REM : server to Primary.
  15. REM : This script must be run with appropriate DBA privileges.
  16. REM :
  17. REM : ************************************************************************
  18. REM : '
  19. SET WINROOT=%SystemRoot%
  20. IF "x%WINROOT%" == "x" SET WINROOT=C:\WINNT
  21. SET IBIN=%INFORMIXDIR%\bin
  22. SET ONSTAT=%IBIN%\onstat
  23. SET ONMODE=%IBIN%\onmode
  24. echo.
  25. echo This script changes the type of the Data replication server to Primary,
  26. echo and must be run with appropriate Database Administrator privileges.
  27. echo.
  28. echo Steps to switch server types in an HDR pair:
  29. echo.
  30. echo Instance A (currently Primary) Instance B (currently Secondary)
  31. echo ------------------------------ --------------------------------
  32. echo 1] onmode -ky (server should be up)
  33. echo 2] hdrmkpri.bat {primary_server_name}
  34. echo 3] hdrmksec.bat {secondary_server_name}
  35. echo 4] starts %%INFORMIXSERVER%%
  36. echo (now a Secondary server) (now a Primary server)
  37. REM # Check usage
  38. if not "%1" == "" goto USAGE_CORRECT
  39. echo.
  40. echo Usage: %0 {paired server name}
  41. echo.
  42. exit 1
  43. : USAGE_CORRECT
  44. SET PAIRED_SERVER=%1
  45. echo.
  46. echo WARNING: Please ensure the following before proceeding further:
  47. echo.
  48. echo 1] the paired database server is OFFLINE,
  49. echo 2] the current database server is up, and
  50. echo 3] the current database server has Data replication turned OFF.
  51. echo.
  52. echo Not doing so, shall make the two database servers in the
  53. echo Data replication pair out-of-sync, and shall require
  54. echo re-establishing the pair.
  55. echo.
  56. PAUSE
  57. echo.
  58. echo Changing to Standard type via:
  59. echo onmode -d standard
  60. onmode -d standard
  61. sleep 2
  62. echo.
  63. echo Changing to Primary type via: (could take a couple of minutes)
  64. echo onmode -d primary %PAIRED_SERVER%
  65. onmode -d primary %PAIRED_SERVER%
  66. sleep 2
  67. echo.
  68. echo Shutting down the database server via:
  69. echo onmode -ky
  70. echo.
  71. echo NOTE: Shutting down the database server now is MANDATORY, because
  72. echo if the two database servers in a Data replication pair
  73. echo are brought up as Primary/Standard type OR,
  74. echo if one database server is up and the mode of the paired server
  75. echo is changed, then the database servers in the pair could
  76. echo become out-of-sync, leading to establishing the pair again.
  77. onmode -ky
  78. echo.
  79. echo Run %%INFORMIXDIR%%\bin\hdrmksec.bat on the paired server.
  80. echo After the run OR if it has already been run, then WITHOUT bringing the
  81. echo paired (now Secondary) server down, start the current (now Primary)
  82. echo database server, to make the Data replication pair operational.
  83. echo.