Oracle 12C Active Data Guard Far Sync configuration

Source: Internet
Author: User

Active Data Guard Far sync is a new feature of Oracle 12c (also known as Far Sync Standby), and the Far Sync feature is implemented in a location that is relatively close to the main library (Primary database) Far Sync instance, main library (Primary database) synchronous (synchronous) transfer redo to far sync instance, then far sync instance then transfer Redo asynchronous (asynchronous) to the terminal repository (Standby Database). This can guarantee 0 data loss and reduce the main library pressure. The Far Sync instance has only password files, init parameter files and control files, and no data files. If the redo transmission uses the maximum availability mode, we can configure the far sync instance at a location relatively close to the production center (Primary database), and the main library (Primary database) synchronizes ( Synchronous) transmission redo to far sync instance to ensure 0 data loss (zero data loss), while the main library and far sync distance, network delay is very small, so the main library performance impact is very small. The far sync instance is then sent to the redo asynchronous (asynchronous) to the terminal repository (Standby database). If the redo transmission uses the maximum performance mode, we can configure the far sync instance at a location relatively close to the production center (Primary database), and the main library (Primary database) asynchronously transmits redo to far Sync instance, and then far the sync instance to transfer redo to several other terminal repositories (Standby database). This reduces the pressure (offload) that the main library transmits redo to multiple terminal repositories (Standby database). The Far sync configuration is transparent to the data Guard role transitions, that is, the Switchover/failover command is the same as before 12c.
1. Main Library configuration fra
Sql> alter system set db_recovery_file_dest_size=200g;

System altered.

Sql> alter system set db_recovery_file_dest= '/u01/app/oracle/fast_recovery_area ';

System altered.
2. Enable archive mode and force log
sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Sql> Startup Mount
ORACLE instance started.

Total System Global area 2516582400 bytes
Fixed Size 4585912 bytes
Variable Size 671090248 bytes
Database buffers 1828716544 bytes
Redo buffers 12189696 bytes
Database mounted.
sql> ALTER DATABASE Archivelog;

Database altered.

sql> ALTER DATABASE force logging;

Database altered.

sql> ALTER DATABASE open;

Database altered.
3. Host Planning
192.168.137.121 ora1221---> Main Library (ORCL12C)
192.168.137.122 ora1222--->far sync instance (ORCL12CFS)
192.168.137.123 ora1223---> Reserve (ORCL12CDG)
4.tns Configuration
ORCL12C =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = ora1221) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = orcl12c)
)
)

ORCL12CDG =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = ora1223) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = orcl12c)
)
)

ORCL12CFS =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = ora1222) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = orcl12c)
)
)
5. parameter file configuration
--Main Library
Db_unique_name= ' orcl12c '
service_names= ' orcl12c '
Log_archive_dest_1= ' Location=use_db_recovery_file_dest valid_for= (all_logfiles,all_roles) db_unique_name= ORCL12C '
log_archive_dest_2= ' Service=orcl12cfs lgwr sync affirm max_failure=1 alternate=log_archive_dest_3 valid_for= (online_ Logfiles,primary_role) Db_unique_name=orcl12cfs '
log_archive_dest_3= ' service=orcl12cdg lgwr ASYNC alternate=log_archive_dest_2 valid_for= (ONLINE_LOGFILES,PRIMARY_ role) DB_UNIQUE_NAME=ORCL12CDG '
Log_archive_dest_state_3=alternate
Log_archive_config= ' dg_config= (ORCL12C,ORCL12CDG,ORCL12CFS) '
Standby_file_management=auto
Db_file_name_convert= '/u01/app/oracle/oradata/orcl12c/', '/u01/app/oracle/oradata/orcl12c/'
Log_file_name_convert= '/u01/app/oracle/oradata/orcl12c/', '/u01/app/oracle/oradata/orcl12c/'
Fal_server= ' orcl12cdg ', ' Orcl12cfs '

--far Sync Instance
Db_unique_name= ' Orcl12cfs '
service_names= ' orcl12c '
Log_archive_dest_1= ' Location=use_db_recovery_file_dest valid_for= (all_logfiles,all_roles) db_unique_name= Orcl12cfs '
Log_archive_dest_2= ' service=orcl12cdg lgwr async valid_for= (standby_logfiles,standby_role) db_unique_name= ORCL12CDG '
Log_archive_config= ' dg_config= (ORCL12C,ORCL12CDG,ORCL12CFS) '
Standby_file_management=manual
Fal_server= ' orcl12c '

--Reserve Library
Db_unique_name= ' ORCL12CDG '
service_names= ' orcl12c '
Log_archive_dest_1= ' Location=use_db_recovery_file_dest valid_for= (all_logfiles,all_roles) db_unique_name= ORCL12CDG '
Log_archive_dest_2= ' service=orcl12c lgwr async valid_for= (online_logfiles,primary_role) db_unique_name=orcl12c '
Log_archive_config= ' dg_config= (ORCL12C,ORCL12CDG,ORCL12CFS) '
Standby_file_management=auto
Db_file_name_convert= '/u01/app/oracle/oradata/orcl12c/', '/u01/app/oracle/oradata/orcl12c/'
Log_file_name_convert= '/u01/app/oracle/oradata/orcl12c/', '/u01/app/oracle/oradata/orcl12c/'
Fal_server= ' orcl12c ', ' Orcl12cfs '
6. password file
Copy the password file from the main library to the far sync instance and the standby $oracle_home/dbs (if win is in%oracle_home%/database)

7. Create far sync instance
Create a fra,adump directory that matches the parameter file
--Main Library
ALTER DATABASE CREATE FAR SYNC INSTANCE controlfile as '/tmp/controlfs01.ctl ';
Copy to far sync instance corresponding control file location

--far Sync Instance
Startup pfile= '/tmp/pfile ' mount

ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo10.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP One '/u01/app/oracle/oradata/orcl12c/std_redo11.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo12.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo13.log ' size 50m reuse;

ALTER database RECOVER MANAGED STANDBY database USING current LOGFILE DISCONNECT from session;
8. Create a standby library
Create a fra,adump directory that matches the parameter file
--Main Library backup (transfer to standby)
Backup database format '/tmp/ora12c_%u ';

--Main Library create standby CTL (transfer to standby and standby parameter file path consistent)
ALTER DATABASE create standby Controlfile as '/tmp/controlst.ctl ';

--Start the standby to mount
Startup pfile= '/tmp/pfile ' mount;

--Standby Register Backup
Catalog start with '/tmp/xifenfei/';

--Standby Restore data file and restore
Restore database;
Recover database;

--Increase standby redo
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo10.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP One '/u01/app/oracle/oradata/orcl12c/std_redo11.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo12.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo13.log ' size 50m reuse;

--Prepare the library to open the MRP process
ALTER database RECOVER MANAGED STANDBY database USING current LOGFILE DISCONNECT from session;

--Main library adds standby redo
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo10.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP One '/u01/app/oracle/oradata/orcl12c/std_redo11.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo12.log ' size 50m reuse;
ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP '/u01/app/oracle/oradata/orcl12c/std_redo13.log ' size 50m reuse;
9. Configuration Results
Sql> select * from V$dataguard_config;

Db_unique_name Parent_dbun dest_role CURRENT_SCN con_id
------------------------------ ------------------------------ ----------------- ----------- ----------
orcl12c NONE PRIMARY DATABASE 1950551 0
Orcl12cfs orcl12c FAR SYNC INSTANCE 1950390 0
ORCL12CDG Orcl12cfs physical STANDBY 1950390 0

Sql> Select group#, Status, thread#, sequence#, first_change#, next_change# from V$standby_log;

group# STATUS thread# sequence# first_change# next_change#
---------- ---------- ---------- ---------- ------------- ------------
Ten ACTIVE 1 27 1863140
One unassigned 1 0
Unassigned 1 0
Unassigned 1 0

Sql> select Protection_mode,protection_level from V$database;

Protection_mode Protection_level
-------------------- --------------------
MAXIMUM Performance MAXIMUM Performance
10. Adjust protection level
Adjust from maximum performance to maximum availability
--Main Library
sql> startup Mount;
ORACLE instance started.

Total System Global area 2516582400 bytes
Fixed Size 4585912 bytes
Variable Size 671090248 bytes
Database buffers 1828716544 bytes
Redo buffers 12189696 bytes
Database mounted.
Sql> ALTER DATABASE set standby database to maximize availability;

Database altered.

Sql> select Protection_mode,protection_level from V$database;

Protection_mode Protection_level
-------------------- --------------------
MAXIMUM availability unprotected

sql> ALTER DATABASE open;

Database altered.

Sql> select Protection_mode,protection_level from V$database;

Protection_mode Protection_level
-------------------- --------------------
MAXIMUM Availability MAXIMUM Availability

--far Sync Instance
Sql> select Protection_mode,protection_level from V$database;

Protection_mode Protection_level
-------------------- --------------------
MAXIMUM Availability MAXIMUM Availability

--Reserve Library
Sql> select Protection_mode,protection_level from V$database;

Protection_mode Protection_level
-------------------- --------------------
MAXIMUM Availability resynchronization

Original from

Title: Oracle 12C Active Data Guard Far Sync Configuration
Author: http://www.xifenfei.com/2015/11/oracle-12c-active-data-guard-far-sync-configuration. html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.