This depend on distance between primary and standby and network bandwidth. So this feature that came with 12c resolve this situation. We are preparing a database one more. This database take archive–log primary database and then send this archive–log to standby. Primary and far sync standby database are sync, whereas far sync standby database and physical standby database are async.
Let’s begin with creating the physical standby with FAR SYNC instance in place.
First of all our environment information is following.
Name | IP | Database |
Primary | 192.100.48.28 | ORCL |
Far sync | 192.100.48.30 | ORCLFS |
Standby | 192.100.48.42 | ORCLSBY |
We continue with configuring the Far Sync instance . The Far Sync instance is not a full-fledged database. It consists only of a control file and redo logs .
As we already configured the Far Sync Instance, Now we are going to configure standby database.
For configuring Far Sync: Click Here
Configure Primary Database: We must set some parameter for dataguard enviroinment. Before doing this you don’t forget that primary database must be archivelog mode.
- We edit tnsnames.ora file to reach far sync standby database. Primary database tnsnames.ora file is as following.
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.48.28)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) ) ORCLSBY= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.48.42)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCLSBY) ) ) ORCLFS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.48.30)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCLFS) ) )
2. We edit some parameter for dataguard.
SQL> alter system set log_archive_dest_2='SERVICE=ORCLFS SYNC COMPRESSION=ENABLE VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCLFS' scope=both; System altered. SQL> alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both; System altered. SQL> alter system set log_archive_config='dg_config=(ORCL,ORCLFS,ORCLSBY)' scope=both; System altered.
NOTE: If we use pfile for database we must add this parameter to pfile.
3. We create standby redo log. Oracle recommend that number of standby redo log is one more than number of redo log file.
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 4 SIZE 50M, GROUP 5 SIZE 50M, group 6 size 50M,group 7 size 50M;
Create Standby Database
Now we will create standby database. We will use active database duplication while creating standby database.
1) First we create tnsnames.ora file to reach far sync standby database.
2) We copy pfile and password file from primary database and edit pfile for physical standby database.
[oracle@vprimary dbs]$ scp orapwORCL initORCL.ora oracle@192.100.48.42:/tmp oracle@192.100.48.42's password: orapwORCL 100% 7680 7.5KB/s 00:00 initORCL.ora 100% 1034 1.0KB/s 00:00
3) We create require directory.
[oracle@vstandby tmp]$ mkdir -p /u01/app/oracle/admin/ORCL/adump [oracle@vstandby tmp]$ mkdir -p /u01/app/oracle/fast_recovery_area [oracle@vstandby tmp]$ mkdir -p /u01/app/oracle/oradata [oracle@vstandby tmp]$ cat /oracle12c/12.2home/dbs/initORCLSBY.ora *.audit_file_dest='/u01/app/oracle/admin/ORCL/adump' *.audit_trail='db' *.compatible='12.1.0.2.0′ *.control_files='/u01/app/oracle/oradata/control01.ctl' *.db_block_size=8192 *.db_create_file_dest='/u01/app/oracle/oradata' *.db_domain='' *.db_name='ORCL' *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' *.db_recovery_file_dest_size=4560m *.diagnostic_dest='/oracle12c' *.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)' *.open_cursors=300 *.pga_aggregate_target=394m *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=1184m *.undo_tablespace='UNDOTBS1′ Dataguard Parameter *.db_unique_name='ORCLSBY' *.log_archive_config= 'dg_config=(ORCL,ORCLFS,ORCLSBY)' *.fal_server='ORCLFS' *.log_archive_dest_1 = 'location=USE_DB_RECOVERY_FILE_DESTVALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ORCLSBY' *.log_archive_dest_2='SERVICE=ORCLFS VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=ORCLFS' *.log_archive_dest_state_2=ENABLE
4) We configure listener.ora file.
LISTENER= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=192.100.48.42)(PORT=1521)) (ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
5) We set oracle parameter and start standby instance
[oracle@vstandby ~]$ export ORACLE_HOME=/u01/app/oracle/product/12102 [oracle@vstandby ~]$ export ORACLE_SID=ORCLSBY [oracle@vstandby ~]$ export PATH=$ORACLE_HOME/bin:$PATH [oracle@vstandby ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Fri Aug 22 08:53:04 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount; ORACLE instance started. Total System Global Area 1241513984 bytes Fixed Size 2923872 bytes Variable Size 452985504 bytes Database Buffers 771751936 bytes Redo Buffers 13852672 bytes
6) Now we create standby database with active database duplication. We connect to ORCL database as target and to ORCLSBY as auxiliary.
[oracle@vstandby ~]$ rman target sys/oracle@ORCL auxiliary sys/oracle@ORCLSBY Recovery Manager: Release 12.1.0.2.0 – Production on Fri Aug 22 09:04:42 2017 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1674007175) connected to auxiliary database: ORCL (not mounted) RMAN> run{ 2> allocate channel prmy1 type disk; 3> allocate channel prmy2 type disk; 4> allocate auxiliary channel c1 device type disk; 5> allocate auxiliary channel c2 device type disk; 6> duplicate target database for standby from active database nofilenamecheck; 7> }
After standby database has created we can start log applying in the standby database with following command.
SQL> alter database recover managed standby database using current logfile disconnect; Database altered.
After doing this we can check dataguard process in the dataguard machines.
Primary database
SQL> select process,status,thread#,sequence#,delay_mins,active_agents,client_process from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# DELAY_MINS ACTIVE_AGENTS CLIENT_P ——— ———— ———- ———- ———- ————- ——– ARCH CLOSING 1 68 0 0 ARCH ARCH CLOSING 1 69 0 0 ARCH ARCH CLOSING 1 50 0 0 ARCH ARCH OPENING 1 69 0 0 ARCH LGWR WRITING 1 70 0 0 LGWR
Far sync Standby Database
SQL> select process,status,thread#,sequence#,delay_mins,active_agents,client_process from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# DELAY_MINS ACTIVE_AGENTS CLIENT_P ——— ———— ———- ———- ———- ————- ——– ARCH CLOSING 1 49 0 0 ARCH ARCH CLOSING 1 51 0 0 ARCH ARCH CONNECTED 0 0 0 0 ARCH ARCH CLOSING 1 69 0 0 ARCH RFS IDLE 0 0 0 0 ARCH RFS IDLE 0 0 0 0 UNKNOWN RFS IDLE 0 0 0 0 UNKNOWN LNS WRITING 1 70 0 0 LNS RFS IDLE 0 0 0 0 ARCH RFS IDLE 0 0 0 0 UNKNOWN RFS IDLE 0 0 0 0 UNKNOWN
Standby database
SQL> select process,status,thread#,sequence#,delay_mins,active_agents,client_process from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# DELAY_MINS ACTIVE_AGENTS CLIENT_P ——— ———— ———- ———- ———- ————- ——– ARCH OPENING 1 68 0 0 ARCH ARCH CONNECTED 0 0 0 0 ARCH ARCH CLOSING 1 69 0 0 ARCH ARCH OPENING 1 69 0 0 ARCH MRP0 APPLYING_LOG 1 70 0 5 N/A RFS IDLE 0 0 0 0 UNKNOWN RFS IDLE 0 0 0 0 UNKNOWN RFS IDLE 0 0 0 0 UNKNOWN RFS IDLE 1 70 0 0 LGWR
Now we will configure DG Broker for far sync datagaurd.
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: www.linkedin.com/in/SirDBaaSJoelPerez
Anuradha’s LinkedIn: https://www.linkedin.com/in/dbaanuradhamudgal/
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp