Add extra standby database to complete database migration to new servers with minimal outage
2017-04-19 22:58
459 查看
1. Background:
When we have to upgrade Redhat Operating System due to license expiration for a Production database which has been configured Data Guard, as we know Redhat dosen`t support self-upgrade therefore we have to build brand new servers then migrate theprimary and standby databases. thus the question comes up: What do we do to complete this migration with minimal outage?
In this test, I`ll complete this task by adding the new server as an standby into dataguard, then switch-over the roles to complete migration.
2. Environment:
Existing data guard contains one standby database. Oracle 11.2.0.3 EE. Linux Redhat 5.8Hostname: redhat1 (primary), redhat2 (standby)
New built Operating system server without any Oracle application installed. Linux Redhat 6.
Hostname: redhat3 (new primary), redhat4 (new standby) .
3. Thinking:
i) Install Oracle software into redhat3 and redhat4ii) Add redhat3 , redhat4 as two additional standby databases for redhat1. (One primary DB and three standby DBs)
iii) Switchover redhat1 to standby and redhat3 to primary. And modify application connection string to access redhat3. (only 5 mins outage)
iv) Remove redhat1, redhat2 from Data Guard.
4. Test Process:
step1. Install Oracle software into redhat3 and redhat4
Please refer to previous articles for details:《Centos5.7x64 上部署 oracle11R2 重点概要》
《离开图形界面的那些日子 之一:Oracle 11.2.0.3 software setup in Silent Mode》
step2. Modify network files for 4 servers
i) listener.ora :Copy the file into redhat3 and redhat4. No modification is required.
ii) tnsnames.ora :
Add redhat3, redhat3 database alias into tnsnames.ora, then copy to new servers. Use tnsping to verify it works fine from any server to any other one.
iii) oraPWD file :
Copy it into new servers $ORACLE_HOME/dbs directly.
step3. Modify instance initial parameters for 4 servers (Sample)
Redhat1: test3_Aalter system set log_archive_config='dg_config=(test3_A,test3_B,test3_C,test3_D)';
alter system set log_archive_dest_3='service=test3_C lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_C';
alter system set log_archive_dest_4='service=test3_D lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_D';
alter system set log_archive_dest_state_3=enable;
alter system set log_archive_dest_state_4=enable;
alter system set fal_server='test3_B','test3_C','test3_D';
Redhat2: test3_B
alter system set log_archive_config='dg_config=(test3_A,test3_B,test3_C,test3_D)';
alter system set log_archive_dest_3='service=test3_C lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_C';
alter system set log_archive_dest_4='service=test3_D lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_D';
alter system set log_archive_dest_state_3=enable;
alter system set log_archive_dest_state_4=enable;
alter system set fal_server='test3_A','test3_C','test3_D';
Redhat3: test3_C
db_unique_name='test3_C'
log_archive_config='dg_config=(test3_A,test3_B,test3_C,test3_D)'
log_archive_dest_1='location=/u01/archivelogs/test3 valid_for=(all_logfiles,all_roles) db_unique_name=test3_C'
log_archive_dest_2='service=test3_A lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_A'
log_archive_dest_3='service=test3_B lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_B'
log_archive_dest_4='service=test3_D lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_D'
log_archive_dest_state_1=enable
log_archive_dest_state_2=enable
log_archive_dest_state_3=enable
log_archive_dest_state_4=enable
fal_client='test3_C'
fal_server='test3_A','test3_B','test3_D'
Redhat4: test3_D
db_unique_name='test3_D'
log_archive_config='dg_config=(test3_A,test3_B,test3_C,test3_D)'
log_archive_dest_1='location=/u01/archivelogs/test3 valid_for=(all_logfiles,all_roles) db_unique_name=test3_C'
log_archive_dest_2='service=test3_A lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_A'
log_archive_dest_3='service=test3_B lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_B'
log_archive_dest_4='service=test3_C lgwr sync AFFIRM delay=0 reopen=300 net_timeout=15 valid_for=(online_logfiles,primary_roles) db_unique_name=test3_C'
log_archive_dest_state_1=enable
log_archive_dest_state_2=enable
log_archive_dest_state_3=enable
log_archive_dest_state_4=enable
fal_client='test3_D'
fal_server='test3_A','test3_B','test3_C'
step4. Create standby databases in redhat3 and redhat4
RUN{
backup incremental level=0 as compressed backupset database format '/u01/rman/test3/db_%u_%T.bk' include current controlfile for standby
plus archivelog format '/u01/rman/test3/arc_%u_%T.bk' delete all input;
}
[oracle@redhat1 ~]$ rman target / auxiliary sys/oracle@test3_C
duplicate target database for standby nofilenamecheck;
[oracle@redhat1 ~]$ rman target / auxiliary sys/oracle@test3_D
duplicate target database for standby nofilenamecheck;
alter database recover managed standby database using current logfile disconnect from session;
step5. Switch over database roles and make application access the new Primary Database (Only 5 mins Outage)
P: alter database commit to switchover to physical standby; shutdown immediate
startup mount
alter database recover managed standby database using current logfile disconnect from session;
S: alter database commit to switchover to physical primary;
alter database open
step6. Remove redhat1 , redhat2 from Data Guard.
Change files and parameters which were modified in step2&3.----END----
相关文章推荐
- How to Add/Drop/Resize Redo Log with Physical Standby in place. [ID 473442.1]
- After new files are added to primary, rman fails at Standby with ORA-20079: Full Resync From Primary
- How to Add/Drop/Resize Redo Log with Physical Standby in place. [ID 473442.1]
- Oracle DG故障诊断一则:alter database recover to logical standby new_logical_dbname卡住
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- UNNAMED FILE ERROR IN STANDBY AFTER ADDING NEW FILE TO PRIMARY DATABASE – ORA-01111, ORA-01110, ORA-
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- Oracle DG故障诊断一则:alter database recover to logical standby new_logical_dbname卡住
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- Oracle:How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- Managing EBS 12 Physical Standby Databases with Oracle Data Guard Broker
- How to grant access to SQL logins on a standby database when the guest user is disabled in SQL Serve
- Oracle 10g Data Guard – Quick Switchover with Physical Standby Database
- alter database recover to logical standby xxx no response