Context: 

mirrored configuration with one primary member and one async member (without failover/backup member)

Purpose:

replace the CACHE.DAT of a mirrored database on the primary member.

 Steps to follow:

  1. on the PRIMARY
    1. remove the database to replace from the mirror
    2. dismount the database
    3. copy the new database
    4. mount the database
    5. add the database to the mirror
    6. backup the database (external backup)
  2. on the ASYNC
    1. remove the database to replace from the mirror
    2. dismount the database
    3. restore the new database backup from the PRIMARY
    4. mount the database
    5. activate database
    6. catch up database

The following script use the same update() method on both PRIMARY and ASYNC members with 2 parameters

Last comment 21 October 2016
0 0
398

views

+ 5

rating

to dismount/mount a database, use Dismount() and Mount() methods in SYS.Database class available in %SYS namespace.
NB: the database ID is its Directory

You'll find  some examples of how to dismount/mount and check if a database is mounted (Mounted=1) or not (Mounted=0), and quickly see all the attributes of a database (via zwrite

0 2
0

comments

772

views

+ 2

rating

C:\data\backup.bat :

C:\InterSystems\Ensemble\bin\cache -s"C:\InterSystems\Ensemble\Mgr" -U%%SYS ##Class(Backup.General).ExternalFreeze() <C:\data\login.scr 

echo %ERRORLEVEL%

rem note that we need to check errorlevel from highest to lowest here....

if errorlevel 5 goto OK

if errorlevel 3 goto FAIL

echo errorlevel returned wrong value

goto END

:OK

0 3
0

comments

978

views

+ 1

rating