Actions
Database Mirroring (DB2) on remote site » History » Revision 7
« Previous |
Revision 7/23
(diff)
| Next »
chin-yeh, 03/21/2012 06:15 PM
- Table of contents
- Database Mirroring on remote site
Database Mirroring on remote site¶
Introduction¶
To mirror production database(s) to remote site, there are a number of approaches:- Use
(full)
database backup - Use
(full + incremental)
database backup - Use
(full + delta)
database backup - Use
(full + incremental + delta)
database backup - not recommended because it is too complex - Use
(full database backup + transaction logs)
the approach 1-4 are described in Using DB2 incremental backup
The following sections will describe how the last approach actually works. Before that, let's do a compare:
Full Database Backup + Transaction Logs¶
Below diagram describes how this approach works:
Sample steps:- Like any other approaches, you must perform a full database backup (either offline or online)
- e.g.:
$ db2 backup db prod_db online
- e.g.:
- Use the
rsync
command to do an one way incremental sync from remote (production) site to standby site.- e.g.:
$ rsync -var --delete db2inst1@db-prod:/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/ /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR
- e.g.:
- Execute the
rollfoward
on the standby database: (do not include the complete option)- e.g.:
$ db2 rollforward db prod_db to end of logs
- e.g.:
- If want to bring up standby database, just execute this command:
$ db2 rollforward db prod_db complete
The main selling points of this approach is there's little or no need to revise current backup strategies, however, the mirror database cannot be used until the rollforward
process is terminated.
Test Tools¶
Updated by chin-yeh almost 13 years ago · 7 revisions