"gumby" <da******@gmail.com> wrote in message
news:11**********************@f6g2000cwb.googlegro ups.com...
These are the commands I have run to try to get HADR going. (Basically
cut paste from what the GUI displays). Do they look okay ? any
suggestions ? I have used your (Mark) suggested ports the others are
the ones that the HADR GUI comes up with.
The ports don't really matter so long as no one else is using them. Each
database must have its own ports (in case you more than one database on that
server using HADR). They should be documented in /etc/services
Here are the scripts that I use (run in order as indicated):
Assumptions:
server01 - primary db server
server02 - standby db server
db2inst1 - instance on primary server
db2inst2 - DB2 instance on standby server (but can be the same as primary)
database - sample
SCRIPT01 - RUN ON PRIMARY SERVER01
# Activate log retain and set log archive path (not necessary if logretain
already enabled some other way)
db2 update db cfg for sample using LOGARCHMETH1 DISK:/db2/archive_logs
#Create offline backup of db to be restored on standby server02 (I am
backing up to a shared mount point)
db2 "BACKUP DATABASE sample TO /db_backup/SAMPLE COMPRESS WITHOUT PROMPTING"
db2 update db cfg for sample using HADR_LOCAL_HOST server01
db2 update db cfg for sample using HADR_REMOTE_HOST server02
db2 update db cfg for sample using HADR_LOCAL_SVC 18819
db2 update db cfg for sample using HADR_REMOTE_SVC 18820
db2 update db cfg for sample using HADR_REMOTE_INST db2inst2
db2 update db cfg for sample using HADR_SYNCMODE nearsync
db2 update db cfg for sample using HADR_TIMEOUT 30
db2 update db cfg for sample using LOGINDEXBUILD ON
#Recommended parms for HADR because logs are sent to standby server
db2 update db cfg for sample using DBHEAP 2048
db2 update db cfg for sample using LOGBUFSZ 256
#This is the host name for automatic client re-route:
db2 update alternate server for database sample using hostname server02 port
50000
SCRIPT02 - RUN ON STANDBY SERVER02
# Restore database on standby server02
db2 RESTORE DATABASE sample FROM /db_backup/SAMPLE TAKEN AT 20060204213007
replace history file
# Activate log retain and set log archive path
db2 update db cfg for sample using LOGARCHMETH1 DISK:/db2/archive_logs
db2 update db cfg for sample using HADR_LOCAL_HOST server02
db2 update db cfg for sample using HADR_REMOTE_HOST server01
db2 update db cfg for sample using HADR_LOCAL_SVC 18820
db2 update db cfg for sample using HADR_REMOTE_SVC 18819
db2 update db cfg for sample using HADR_REMOTE_INST db2inst1
db2 update db cfg for sample using HADR_SYNCMODE nearsync
db2 update db cfg for sample using HADR_TIMEOUT 30
db2 update db cfg for sample using LOGINDEXBUILD ON
#Recommended parms for HADR because logs are sent to standby server
db2 update db cfg for sample using DBHEAP 2048
db2 update db cfg for sample using LOGBUFSZ 256
#This is the host name for automatic client re-route:
db2 update alternate server for database sample using hostname server01 port
50000
db2 start hadr on db sample as standby
SCRIPT03 - RUN ON PRIMARY SERVER01
db2 start hadr on db sample as primary