ORACLE Migration by using Dataguard

Target: migrate the dataase from server1 to server2 and sync the two database by using archive log.

12.11.0.104 RHEL11G source
12.11.0.105 RHEL11G2 target

12.11.0.104
1. Create table test1
2. Insert two record 
1 abc
2 bcd
3. alter system archive log current;
4. shutdown database take snapshot; --> snapshot 5
5. Clone new server 12.11.0.105;

6. create table test2
7. Insert two record 
3 abc
4 bcd
8. drop table test1
9 create standby control file;
10. alter system archive log current;
11. shutdown database and listener; --> snapshot 6

12.11.0.105 
1. startup system --> snapshot 1
2. Change IP address and hostname --> snapshot 2
3. generate standby control file 
scp /u01/standby.ctl oracle@12.11.0.105:/u01/app/oracle/oradata/orcl11g/control01.ctl
cp /u01/app/oracle/oradata/orcl11g/control01.ctl /u01/app/oracle/flash_recovery_area/orcl11g/control02.ctl
scp /u01/app/oracle/flash_recovery_area/ORCL11G/archivelog/2015_02_26/o1_mf_1_20_bgwbwst6_.arc oracle@12.11.0.105:/u01/app/oracle/flash_recovery_area/ORCL11G/archivelog/2015_02_26/

4. apply the archive log into database: 
startup mount
recover standby database;
/u01/app/oracle/flash_recovery_area/ORCL11G/archivelog/2015_02_26/o1_mf_1_20_bgwbwst6_.arc
CANCEL
alter database recover managed standby database cancel;
alter database recover managed standby database finish;
alter database commit to switchover to primary;
alter database open;

Comments

Popular posts from this blog

Nginx Proxy & Load Balance & LNMP

Snort+barnyard2+Snorby CentOS 6.5_64 Installation

ORACLE Error