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 .
Create directories
For storing audit information, I create a new directory. Likewise, all database-relevant files are stored in the file system and not as the primary database in the ASM .
[oracle@dg1 tmp]$ mkdir -p /u01/app/oracle/admin/ORCL/adump [oracle@dg1 tmp]$ mkdir -p /u01/app/oracle/fast_recovery_area [oracle@dg1 tmp]$ mkdir -p /u01/app/oracle/oradata
Create Controlfile
The Far Sync instance needs a special control file . This must be created from the primary database.
sqlplus / as sysdba SQL> ALTER DATABASE CREATE FAR SYNC INSTANCE CONTROLFILE AS '/tmp/far_sync_standby.ctl';
Create pfile from spfile for far sync standby database in the primary database.
SQL> create pfile=’/tmp/pfile_farsync_standby.ora’ from spfile; File created.
Copy passwordfile, controlfile and pfile from primary server
[oracle@prim tmp]$ scp far_sync_standby.ctl pfile_farsync_standby.ora oracle@192.100.48.30:/tmp [oracle@prim dbs]$ scp orapwORCL oracle@192.100.48.30:/u01/app/oracle/oradata/dbs/orapwORCLFS
Adjust parameters
I will now adjust the parameter file for the Far Sync instance . To remember, I am using a copy of the parameter file of the primary database.
*.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_name='NONCDB' *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' *.db_recovery_file_dest_size=4560m *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=NONCDBXDB)' *.open_cursors=300 *.pga_aggregate_target=394m *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=1184m *.undo_tablespace='UNDOTBS1'
##Dataguard Parameter *.db_unique_name=ORCLFS *.log_archive_config='dg_config=(ORCL,ORCLFS,ORCLSBY)' *.fal_server='ORCLSBY' *.log_archive_dest_1 ='location=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES)' *.log_archive_dest_2='SERVICE=ORCL_DR VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=ORCLSBY' *.LOG_ARCHIVE_DEST_STATE_2=ENABLE
Copy controlfile and parameter file to true location
[oracle@dg1 tmp]$ cp far_sync_standby.ctl /u01/app/oracle/oradata/control01.ctl [oracle@dg1 tmp]$ cp pfile_farsync_standby.ora /u01/app/oracle/oradata/dbs/initORCLFS.ora
Add TNS entry to far sync standby database tnsnames.ora for primary,far sync and standby database.
Set oracle parameter and start far sync standby database.
[oracle@dg1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11204 [oracle@dg1 ~]$ export ORACLE_SID=farsydb [oracle@dg1 ~]$ export PATH=$ORACLE_HOME/bin:$PATH [oracle@dg1 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Fri Aug 22 09:54:21 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount; 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 Database mounted.
Using the DATABASE_ROLE column in the V$DATABASE View, you can see that it is a Far Sync instance .
SQL> select database_role from v$database; DATABASE_ROLE —————- FAR SYNC
Standby Redo logs
Creating Standby Redo Logs is a prerequisite for the Far Sync instance to use the synchronous transfer mode. Therefore, as with the primary database, standby redo logs are created.
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 4 SIZE 50M, GROUP 5 SIZE 50M, group 6 size 50M,group 7 size 50M;
Activation of log shipping
For the primary database to transfer the archive logs correctly to the Far Sync instance , the corresponding archive destination must be activated.
ALTER SYSTEMSET LOG_ARCHIVE_DEST_2_STATE = 'ENABLE' SCOPE = both SID = '*';
Far sync standby database is ready.
Now we will prepare standby database and configure primary database for dataguard.
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