Replication Scripts for Unix

(Zip file with scripts)

The scripts are doing after-image replication, i.e. they first copy full after-image (AI), if there are any, to special AI_TO_DR directory and mark them as empty. Then switch the current busy AI to a new one, copy it and mark as empty. This is done in script and it's child is just a wrapper in case you have more than 1 database to replicate.
The AI files are zipped before FTP and unzipped on the other end.
If the source database is down replication will not take place. Script checks db status before processing.
Also FTP is checking that the file got successfully FTPed. Otherwise it is not moved to AIBACKUP directory and will be reprocessed again.
File is FTPed as TMP_name instead of its real name and then renamed. That way roll forward script will not pick up a file while it is in process of FTP.
Files in backup directory AIBACKUP are stored for 2 days which is controlled by the last line in script -mtime +2. Same on the target box.

============= LIST OF SCRIPTS ====================

-- Start with It lists database directories and database names that need replication.

--,, and should run on the source box.

-- is doing FTP so you need to fiill the target DR-server-name, user-name and password.

-- and should run on the target (Disaster-Recovery) box.

-- On target box lists dattabase directories and database names that are replicated.

============== CHANGES TO BE MADE ==============

Here is a list of directories, database names and other stuff specific to your system
Main_replication_dir # Choose one with enough space if you intend to keep AI in $AIBACKUP
Database1-dir # Primary DB
Database1-name # Primary DB
REMOTE_DIR # Some dir on DR server. Same as LOCALAPPLYDIR in
user-name # if you set up user FTP without need to enter password on DR server
password # then you might skip it. Otherwise make sure does not have read permissions for all.
Main_replication_dir # does not have to be the same as in
Database1-dir # Target DB
Database1-name # Target DB
LOCALAPPLYDIR # Some dir on DR server. Same as REMOTE_DIR in
STOREDIR # directory to store AI files on DR server