Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ About DataGuard three protected mode test     - How to disable IPv6 in the CentOS 7 (Linux)

- CentOS 6.6 install JDK7 (Linux)

- W and uptime command (Linux)

- Learning C language pointer essays (Programming)

- Tecplot Installation under Linux (Linux)

- MySQL Data Types (Database)

- apt-get install openstack pkg Troubleshooting (Linux)

- CentOS 6.6 install Oracle 11gR2 database (Database)

- C # asynchronous delegates (Programming)

- Linux password file security issues detailed usage (Linux)

- Docker deployment practices in Ubuntu (Server)

- CentOS / Debian configuration Gitlab 7.1x to build self Git repository (Linux)

- Use HttpClient remote interface testing (Programming)

- RPM package management under Linux (Linux)

- CentOS yum source configuration (Linux)

- Oracle Data Pump Example (Database)

- Java regular expression syntax (Programming)

- Linux use iptables ban Ping (Linux)

- Install OpenGL development environment in Fedora and Ubuntu (Linux)

- CentOS 6.7 install Nagios Tutorials (Server)

 
         
  About DataGuard three protected mode test
     
  Add Date : 2017-08-31      
         
         
         
  Data Guard is Oracle HA HA important solutions. Protection against different system requirements, DG offers three different types of protection mode (Protection Mode), are as follows: Maximum Protection (Maximum Protection), the maximum available (Maximum Availability) and maximum performance (Maximum performance). In practical application scenario, we need to different business scenarios and data availability needs to set the type of protection DG Environment.

1, three protection modes Protection Mode

Three protection modes is the core concept of DG. DG is essentially a data synchronization mechanism Redo Log on. Undo and Redo are Oracle laid early position in the industry's core technology. Undo responsible for recording the transaction operations before the mirror, and the mirror after Redo responsible for recording the transaction operations. In Oracle transaction commit operation, the write log files are required to complete a certain action. After writing to the log file, even if the instance is terminated immediately appear serious events, when restarting the instance instance recovery operation will be carried out, the implementation of the transaction.

In DG environment, regardless of the initialization method adopted is to ensure a Primary and Standby initialization data consistent transaction type operation after receiving the Primary end, all will be archived logs delivered to the Standby mode tandem end and standby redo log archive log list, and finally repeated application of these logs, to achieve consistent Primary and Standby side.

Primary and Standby are mutually redundant structure is backed up, follow the situation Primary Standby, reflecting the level of availability HA structure. In theory, the safest strategy is to ensure that a transaction in the Primary and Standby are submitted, only returned to the user said to have been completed. So can ensure that the same main library equipment safest approach. At the other extreme, the main library is "self-serving" for transaction processing, transmission logs will be independent, they do not control whether the transmission log or to apply to.

For different transmission case, DG protected area is divided into three types:

maximum available modes Maximum Availability

In an official document, the description of this model are as follows:

"This protection mode provides the highest level of data protection that is possible without compromising the availability of a primary database. Transactions do not commit until all redo data needed to recover those transactions has been written to the online redo log and to the standby redo log on at least one synchronized standby database. If the primary database can not write its redo stream to at least one synchronized standby database, it operates as if it were in maximum performance mode to preserve primary database availability until it is again able to write its redo stream to a synchronized standby database. "

Under Maximum Availability mode, the transaction only if all the relevant logs are transmitted to at least one end of the log Standby time before making a formal submission. However, if the Primary during the transmission of the log, it was found that all standby side can not be transmitted, the mode will be degraded to the maximum performance mode (Maximum Performance) work. It should be said, Maximum Availability is an adaptive protection mode, when problems arise, DG will be the next best thing, make sure Primary main library affairs.

maximum performance mode (Maximum Performance)

Official documents as follows:. "This protection mode provides the highest level of data protection that is possible without affecting the performance of a primary database This is accomplished by allowing transactions to commit as soon as all redo data generated by those transactions has been written to the online log. Redo data is also written to one or more standby databases, but this is done asynchronously with respect to transaction commitment, so primary database performance is unaffected by delays in writing redo data to the standby database (s).

This protection mode offers slightly less data protection than maximum availability mode and has minimal impact on primary database performance.

This is the default protection mode. "

Maximum performance mode does not affect the work of the main library, the data can provide the highest level of protection. When the transaction were submitted to the main library will not confirm whether the log is written to the standby database, but will not confirm whether apply. In this way, performance is the main library will not receive the impact of the application submitted by the library. Of course, this protection mode there will be some transaction data is lost, but the case never submitted data error occurs.

The DG, the maximum performance mode is the default protection mode. Once we have completed the installation of the DG, it will automatically enter the Maximum Performance mode.

maximum protection mode (Maximum Protection)

Maximum protection mode is described in the official:

"This protection mode ensures that no data loss will occur if the primary database fails. To provide this level of protection, the redo data needed to recover a transaction must be written to both the online redo log and to the standby redo log on at least one synchronized standby database before the transaction commits. to ensure that data loss can not occur, the primary database will shut down, rather than continue processing transactions, if it can not write its redo stream to at least one synchronized standby database.

Transactions on the primary are considered protected as soon as Data Guard has written the redo data to persistent storage in a standby redo log file. Once that is done, acknowledgment is quickly made back to the primary database so that it can proceed to the next transaction . This minimizes the impact of synchronous transport on primary database throughput and response time. to fully benefit from complete Data Guard validation at the standby database, be sure to operate in real-time apply mode so that redo changes are applied to the standby database as fast as they are received. Data Guard signals any corruptions that are detected so that immediate corrective action can be taken. "

Maximum protection mode is entirely HA architecture ideal transaction mode. If the Primary database transaction, joint Standby database must operate simultaneously. If due to network, execution mode and other reasons, Standby not be able to keep up with the operation of the main library, the main library will abandon the transaction, and forced to stop library.

Between protected mode and three transmission mechanisms database logs are closely related. Mainly whether synchronous transmission Redo logs and logs confirm two aspects. We configure three logging mode, the parameters must take Log_Archive_Config basis.


Maximum Availability

Maximum Performance

Maximum Protection

AFFIRM

NOAFFIRM

AFFIRM

SYNC

ASYNC

SYNC

DB_UNIQUE_NAME

DB_UNIQUE_NAME

DB_UNIQUE_NAME

Following a series of tests to analyze the work of the three protection modes of behavior.

2, Environment Introduction

I use the environment for Oracle 11gR2, specific version 11.2.0.4. Standby database environment has been set up is complete, the synchronization protection mode is the default mode.

Main library information:

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ WRITE PRIMARY MAXIMUM PERFORMANCE

SQL> select instance_name from v $ instance;

INSTANCE_NAME

----------------

vlife

Main library and library equipment connection, using the default asynchronous unacknowledged mode.

SQL> select dest_id, dest_name, TRANSMIT_MODE, ASYNC_BLOCKS, AFFIRM TYPE, VALID_NOW, VALID_TYPE, VALID_ROLE, DB_UNIQUE_NAME from v $ archive_dest where status <> 'INACTIVE';

  DEST_ID DEST_NAME TRANSMIT_MODE ASYNC_BLOCKS TYPE VALID_NOW VALID_TYPE VALID_ROLE DB_UNIQUE_NAME

---------- -------------------- ------------- ------- ----- ---- ---------------- --------------- ---------- - ---------------

        1 LOG_ARCHIVE_DEST_1 SYNCHRONOUS 0 NO YES ALL_LOGFILES ALL_ROLES NONE

        2 LOG_ARCHIVE_DEST_2 ASYNCHRONOUS 61440 NO YES ONLINE_LOGFILE PRIMARY_ROLE vlifesb

At this time, the transmission channel configuration.

SQL> show parameter LOG_ARCHIVE_DEST_2;

NAME TYPE VALUE

------------------------------------ ----------- --- ---------------------------

log_archive_dest_2 string SERVICE = vlifesb valid_for = (online_logfiles, primary_role) db_unique_name = vlifesb

log_archive_dest_20 string

log_archive_dest_21 string

Prepared by the library information is as follows:

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ ONLY WITH APPLY PHYSICAL STANDBY MAXIMUM PERFORMANCE

SQL> select instance_name from v $ instance;

INSTANCE_NAME

----------------

vlifesb

SQL> col dest_name for a20;

SQL> select dest_id, dest_name, TRANSMIT_MODE, ASYNC_BLOCKS, AFFIRM TYPE, VALID_NOW, VALID_TYPE, VALID_ROLE, DB_UNIQUE_NAME from v $ archive_dest where status <> 'INACTIVE';

  DEST_ID DEST_NAME TRANSMIT_MODE ASYNC_BLOCKS TYPE VALID_NOW VALID_TYPE VALID_ROLE DB_UNIQUE_NAME

---------- -------------------- ------------- ------- ----- ---- ---------------- --------------- ---------- - ------------------------------

        1 LOG_ARCHIVE_DEST_1 SYNCHRONOUS 0 NO YES ALL_LOGFILES ALL_ROLES NONE

        2 LOG_ARCHIVE_DEST_2 ASYNCHRONOUS 61440 NO WRONG VALID_TYPE ONLINE_LOGFILE PRIMARY_ROLE vlife

        32 STANDBY_ARCHIVE_DEST SYNCHRONOUS 0 NO YES ALL_LOGFILES ALL_ROLES NONE

SQL> show parameter LOG_ARCHIVE_DEST_2;

NAME TYPE VALUE

------------------------------------ ----------- --- ---------------------------

log_archive_dest_2 string SERVICE = vlife valid_for = (online_logfiles, primary_role) db_unique_name = vlife

log_archive_dest_20 string

log_archive_dest_21 string

3, the maximum available modes Maximum Availability Mode Testing

The current is switched from the default maximum performance to the maximum of the available modes, you first need to meet the log transport mode to be modified.

SQL> alter system set log_archive_dest_2 = 'SERVICE = vlifesb sync affirm net_timeout = 30 valid_for = (online_logfiles, primary_role) db_unique_name = vlifesb';

System altered

SQL> select dest_id, dest_name, TRANSMIT_MODE, ASYNC_BLOCKS, AFFIRM TYPE, VALID_NOW, VALID_TYPE, VALID_ROLE, DB_UNIQUE_NAME, NET_TIMEOUT from v $ archive_dest where status <> 'INACTIVE';

  DEST_ID DEST_NAME TRANSMIT_MODE ASYNC_BLOCKS TYPE VALID_NOW VALID_TYPE VALID_ROLE DB_UNIQUE_NAME NET_TIMEOUT

---------- -------------------- ------------- ------- ----- ---- ---------------- --------------- ---------- - ------------------------------ -----------

        1 LOG_ARCHIVE_DEST_1 SYNCHRONOUS 0 NO YES ALL_LOGFILES ALL_ROLES NONE 0

        2 LOG_ARCHIVE_DEST_2 PARALLELSYNC 0 YES YES ONLINE_LOGFILE PRIMARY_ROLE vlifesb 30

In this case, use alter database protection mode settings.

SQL> alter database set standby database to maximize availability;

Database altered

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ WRITE PRIMARY MAXIMUM AVAILABILITY

At the time of switching operation, the master database log as follows:

Wed Oct 21 15:13:48 2015

alter database set standby database to maximize availability

Completed: alter database set standby database to maximize availability

Wed Oct 21 15:13:49 2015

Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED - found no synchronization needed to be supplemented.

************************************************** ****************

LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2

************************************************** ****************

Wed Oct 21 15:13:49 2015

NSS2 started with pid = 34, OS id = 9186

LGWR: Standby redo logfile selected to archive thread 1 sequence 82

LGWR: Standby redo logfile selected for thread 1 sequence 82 for destination LOG_ARCHIVE_DEST_2

Thread 1 advanced to log sequence 82 (LGWR switch)

  Current log # 3 seq # 82 mem # 0: /u01/app/oracle/oradata/VLIFE/onlinelog/o1_mf_3_c1kb1c24_.log

  Current log # 3 seq # 82 mem # 1: /u01/app/oracle/fast_recovery_area/VLIFE/onlinelog/o1_mf_3_c1kb1c43_.log

Wed Oct 21 15:13:53 2015

Archived Log entry 104 added for thread 1 sequence 81 ID 0xfad4f44b dest 1:

Wed Oct 21 15:13:54 2015

ARC3: Archive log rejected (thread 1 sequence 81) at host 'vlifesb'

FAL [server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed Archiver continuing.

ORACLE Instance vlife -. Archival Error Archiver continuing.

Wed Oct 21 15:14:42 2015

Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED

LGWR: Standby redo logfile selected to archive thread 1 sequence 83

LGWR: Standby redo logfile selected for thread 1 sequence 83 for destination LOG_ARCHIVE_DEST_2

Thread 1 advanced to log sequence 83 (LGWR switch)

  Current log # 1 seq # 83 mem # 0: /u01/app/oracle/oradata/VLIFE/onlinelog/o1_mf_1_c1kb19q4_.log

  Current log # 1 seq # 83 mem # 1: /u01/app/oracle/fast_recovery_area/VLIFE/onlinelog/o1_mf_1_c1kb19sb_.log

Wed Oct 21 15:14:42 2015

Archived Log entry 107 added for thread 1 sequence 82 ID 0xfad4f44b dest 1:

After the Primary end, during the handover, Oracle found that the state is not synchronized transmission case. So automatically speed up log transport and synchronized actions. In Standby side, you can also see the follow-up to catch the action.

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ ONLY WITH APPLY PHYSICAL STANDBY MAXIMUM AVAILABILITY

Log catching action Standby side.

Wed Oct 21 08:27:05 2015

Primary database is in MAXIMUM PERFORMANCE mode

Re-archiving standby log 4 thread 1 sequence 80

Wed Oct 21 08:27:05 2015

Media Recovery Waiting for thread 1 sequence 81

RFS [14]: Assigned to RFS process 31500

RFS [14]: Selected log 5 for thread 1 sequence 81 dbid -87496857 branch 892734889

Wed Oct 21 08:27:05 2015

Archived Log entry 76 added for thread 1 sequence 80 ID 0xfad4f44b dest 1:

Recovery of Online Redo Log: Thread 1 Group 5 Seq 81 Reading mem 0

  Mem # 0: /u01/app/oracle/oradata/VLIFESB/onlinelog/o1_mf_5_c265gqd8_.log

  Mem # 1: /u01/app/oracle/fast_recovery_area/VLIFESB/onlinelog/o1_mf_5_c265gqj0_.log

Wed Oct 21 15:13:52 2015

Primary database is in MAXIMUM AVAILABILITY mode

Changing standby controlfile to MAXIMUM AVAILABILITY mode

Changing standby controlfile to RESYNCHRONIZATION level

Standby controlfile consistent with primary

RFS [15]: Assigned to RFS process 969

RFS [15]: Selected log 4 for thread 1 sequence 82 dbid -87496857 branch 892734889

Wed Oct 21 15:13:53 2015

Archived Log entry 77 added for thread 1 sequence 81 ID 0xfad4f44b dest 1:

Wed Oct 21 15:13:53 2015

Media Recovery Waiting for thread 1 sequence 82 (in transit)

Recovery of Online Redo Log: Thread 1 Group 4 Seq 82 Reading mem 0

  Mem # 0: /u01/app/oracle/oradata/VLIFESB/onlinelog/o1_mf_4_c265gc9q_.log

  Mem # 1: /u01/app/oracle/fast_recovery_area/VLIFESB/onlinelog/o1_mf_4_c265gcfk_.log

Wed Oct 21 15:14:41 2015

Archived Log entry 78 added for thread 1 sequence 82 ID 0xfad4f44b dest 1:

Wed Oct 21 15:14:41 2015

Media Recovery Waiting for thread 1 sequence 83

Wed Oct 21 15:14:42 2015

Primary database is in MAXIMUM AVAILABILITY mode

Changing standby controlfile to MAXIMUM AVAILABILITY level

Standby controlfile consistent with primary

RFS [16]: Assigned to RFS process 976

RFS [16]: Selected log 4 for thread 1 sequence 83 dbid -87496857 branch 892734889

Recovery of Online Redo Log: Thread 1 Group 4 Seq 83 Reading mem 0

  Mem # 0: /u01/app/oracle/oradata/VLIFESB/onlinelog/o1_mf_4_c265gc9q_.log

  Mem # 1: /u01/app/oracle/fast_recovery_area/VLIFESB/onlinelog/o1_mf_4_c265gcfk_.log

In this case, two libraries due to the network open, normal synchronization state, the synchronization tests are normal.

(Maximium Availiablity mode use)

- At the main library

SQL> create table t_m as select * from dba_objects where rownum <10;

Table created

Under --Standby

SQL> select count (*) from t_m;

  COUNT (*)

----------

        9

If the interrupt application logs, Standby follows:

SQL> alter database recover managed standby database cancel;

Database altered

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ ONLY PHYSICAL STANDBY MAXIMUM AVAILABILITY

Log as follows:

Wed Oct 21 15:20:49 2015

alter database recover managed standby database cancel

Wed Oct 21 15:20:49 2015

MRP0: Background Media Recovery cancelled with status 16037

Errors in file /u01/app/oracle/diag/rdbms/vlifesb/vlifesb/trace/vlifesb_pr00_17539.trc:

ORA-16037: user requested cancel of managed recovery operation

Managed Standby Recovery not using Real Time Apply

Recovery interrupted!

Recovered data files to a consistent state at change 1692263

Wed Oct 21 15:20:49 2015

MRP0: Background Media Recovery process shutdown (vlifesb)

Managed Standby Recovery Canceled (vlifesb)

Completed: alter database recover managed standby database cancel

If right now interrupt listener disconnected. In this case the database can not do real-time synchronization.

[Oracle @ vLIFE-URE-OT-DB-STANDBY ~] $ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2015 15:24:17

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)))

The command completed successfully

- Main Library

************************************************** *********************

Fatal NI connect error 12541, connecting to:

 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.19.90) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = vlifesb) (CID = (PROGRAM = oracle) (HOST = vLIFE-URE -OT-DB-PRIMARY) (USER = oracle))))

  VERSION INFORMATION:

        TNS for Linux: Version 11.2.0.4.0 - Production

        TCP / IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production

  Time: 21-OCT-2015 15:24:38

  Tracing not turned on.

  Tns error struct:

    ns main err code: 12541

   

TNS-12541: TNS: no listener

    ns secondary err code: 12560

    nt main err code: 511

   

TNS-00511: No listener

    nt secondary err code: 111

    nt OS err code: 0

Error 12541 received logging on to the standby

Check whether the listener is up and running.

PING [ARC2]: Heartbeat failed to connect to standby 'vlifesb' Error is 12541..

Forced log switch.

SQL> alter system switch logfile;

System altered

SQL> alter system switch logfile;

System altered

SQL> alter system switch logfile;

System altered

SQL> select * from v $ archive_dest_status;

  DEST_ID DEST_NAME STATUS TYPE DATABASE_MODE RECOVERY_MODE PROTECTION_MODE DESTINATION STANDBY_LOGFILE_COUNT STANDBY_LOGFILE_ACTIVE ARCHIVED_THREAD # ARCHIVED_SEQ # APPLIED_THREAD # APPLIED_SEQ # ERROR SRL DB_UNIQUE_NAME SYNCHRONIZATION_STATUS SYNCHRONIZED GAP_STATUS

---------- -------------------- --------- ----------- --- --------------- ----------------------- --------- --------------------------------------- ----------- ----------------------------------------- --------- ------------ ---------------------- ---------------- ------------- --------------- ------------ ---------- -------------------------------------------------- -------------------- --- --------------------------- --- ---------------------- ------------ ------------- -----------

        1 LOG_ARCHIVE_DEST_1 VALID LOCAL OPEN IDLE MAXIMUM PERFORMANCE /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch 0 0 1 85 0 0 NO NONE CHECK CONFIGURATION NO

        2 LOG_ARCHIVE_DEST_2 ERROR PHYSICAL OPEN_READ-ONLY IDLE RESYNCHRONIZATION vlifesb 3 0 1 82 1 82 ORA-12541: TNS: YES vlifesb CHECK CONNECTIVITY NO RESOLVABLE GAP

SQL> select recid, name, sequence # from v $ archived_log where sequence #> 82;

    RECID NAME SEQUENCE #

---------- ---------------------------------------- ---------------------------------------- ----------

      108 vlifesb 83

      109 / u01 / app / oracle / fast_recovery_area / VLIFE / archivelog / 2015_10_21 / o1_mf_1_83_c2ghkz 83

      110 / u01 / app / oracle / fast_recovery_area / VLIFE / archivelog / 2015_10_21 / o1_mf_1_84_c2ghl0 84

      111 / u01 / app / oracle / fast_recovery_area / VLIFE / archivelog / 2015_10_21 / o1_mf_1_85_c2ghl4 85

The standby side, there will be no transfer to the archive log.

SQL> select recid, name, sequence # from v $ archived_log where sequence #> 82;

    RECID NAME SEQUENCE #

---------- ---------------------------------------- ---------------------------------------- ----------

        79 / u01 / app / oracle / fast_recovery_area / VLIFESB / archivelog / 2015_10_21 / o1_mf_1_83_c2gh 83

SQL> select group #, dbid, archived from v $ standby_log;

    GROUP # DBID ARCHIVED

---------- ---------------------------------------- --------

        4 UNASSIGNED NO

        5 UNASSIGNED NO

        6 UNASSIGNED YES

In this case, the obvious connection Primary and Standby is interrupted, the log can not be transmitted, will not reach the synchronization confirmation setup requirements. But this time, Primary or transaction operations can be performed.

(Transactions can be carried out)

SQL> insert into t_m select * from dba_objects where rownum <10;

9 rows inserted

SQL> commit;

Commit complete

At this time, if the recovery two are connected, start the listener and log applications.

[Oracle @ vLIFE-URE-OT-DB-STANDBY ~] $ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2015 15:51:46

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait ...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Log messages written to

(Space reasons, have omitted .......)

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered

After the main library and archive log transfer and subsequent synchronization operation, space reasons, the log information omitted from the database log.

From the above experiments, we can see that the core of maximum availability mode even if the "available." The so-called available even ensure Primary and Standby overall available. If you can maintain tight synchronization relationship between the log transfer path smooth, both behave like maximum protection mode. However, if the connection or synchronous operation can not meet the requirements, DG, will not stop the instance is running, but the next best thing, work in a similar way the maximum performance mode.

4, the maximum protection mode Maximum Protection

Maximum Protection mode is the highest level of protection can be provided by DG, based on the log on the simultaneous transmission and confirmation. Similarly, you can use alter database method to set.

SQL> alter database set standby database to maximize protection;

Database altered

On the main library, you can view the status change and log situation.

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ WRITE PRIMARY MAXIMUM PROTECTION

Wed Oct 21 16:17:46 2015

alter database set standby database to maximize protection

Completed: alter database set standby database to maximize protection

Wed Oct 21 16:17:50 2015

Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED

************************************************** ****************

LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2

************************************************** ****************

LGWR: Standby redo logfile selected to archive thread 1 sequence 89

LGWR: Standby redo logfile selected for thread 1 sequence 89 for destination LOG_ARCHIVE_DEST_2

Thread 1 advanced to log sequence 89 (LGWR switch)

  Current log # 1 seq # 89 mem # 0: /u01/app/Oracle/oradata/VLIFE/onlinelog/o1_mf_1_c1kb19q4_.log

  Current log # 1 seq # 89 mem # 1: /u01/app/oracle/fast_recovery_area/VLIFE/onlinelog/o1_mf_1_c1kb19sb_.log

Wed Oct 21 16:17:50 2015

Archived Log entry 119 added for thread 1 sequence 88 ID 0xfad4f44b dest 1:

Information on the standby database is the same change information.

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ ONLY WITH APPLY PHYSICAL STANDBY MAXIMUM PROTECTION

Wed Oct 21 15:52:45 2015

Primary database is in MAXIMUM AVAILABILITY mode

Changing standby controlfile to MAXIMUM AVAILABILITY level

Standby controlfile consistent with primary

RFS [21]: Assigned to RFS process 1172

RFS [21]: Selected log 4 for thread 1 sequence 88 dbid -87496857 branch 892734889

Recovery of Online Redo Log: Thread 1 Group 4 Seq 88 Reading mem 0

  Mem # 0: /u01/app/oracle/oradata/VLIFESB/onlinelog/o1_mf_4_c265gc9q_.log

  Mem # 1: /u01/app/oracle/fast_recovery_area/VLIFESB/onlinelog/o1_mf_4_c265gcfk_.log

Wed Oct 21 16:17:49 2015

Archived Log entry 84 added for thread 1 sequence 88 ID 0xfad4f44b dest 1:

Wed Oct 21 16:17:49 2015

Media Recovery Waiting for thread 1 sequence 89

Wed Oct 21 16:17:50 2015

Primary database is in MAXIMUM PROTECTION mode

Changing standby controlfile to MAXIMUM PROTECTION mode

Standby controlfile consistent with primary

RFS [22]: Assigned to RFS process 1358

RFS [22]: Selected log 4 for thread 1 sequence 89 dbid -87496857 branch 892734889

Recovery of Online Redo Log: Thread 1 Group 4 Seq 89 Reading mem 0

  Mem # 0: /u01/app/oracle/oradata/VLIFESB/onlinelog/o1_mf_4_c265gc9q_.log

  Mem # 1: /u01/app/oracle/fast_recovery_area/VLIFESB/onlinelog/o1_mf_4_c265gcfk_.log

If at this time, we terminate the Standby side synchronous action.

SQL> alter database recover managed standby database cancel;

Database altered

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ ONLY PHYSICAL STANDBY MAXIMUM PROTECTION

At this time, if the main library has executed the transaction, if it can be executed successfully?

Main Library Services:

SQL> delete t_m;

9 rows deleted

SQL> commit;

Commit complete

Library equipment

SQL> select count (*) from t_m;

  COUNT (*)

----------

        9

Transactional operations have not been able to pass on the standby database. Current log transport mechanism is normal, if we cut this connection, in the Primary side maximum protection mode how.

[Oracle @ vLIFE-URE-OT-DB-STANDBY ~] $ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2015 16:25:30

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)))

The command completed successfully

Main library on immediately interrupt information is displayed:

************************************************** *********************

Fatal NI connect error 12541, connecting to:

 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.19.90) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = vlifesb) (CID = (PROGRAM = oracle) (HOST = vLIFE-URE -OT-DB-PRIMARY) (USER = oracle))))

  VERSION INFORMATION:

        TNS for Linux: Version 11.2.0.4.0 - Production

        TCP / IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production

  Time: 21-OCT-2015 16:25:41

  Tracing not turned on.

  Tns error struct:

    ns main err code: 12541

   

TNS-12541: TNS: no listener

    ns secondary err code: 12560

    nt main err code: 511

   

TNS-00511: No listener

    nt secondary err code: 111

    nt OS err code: 0

Error 12541 received logging on to the standby

Check whether the listener is up and running.

PING [ARC2]: Heartbeat failed to connect to standby 'vlifesb' Error is 12541..

At this time, we operate on the transaction Primary.

SQL> insert into t_m select * from dba_objects where rownum <100;

99 rows inserted

SQL> commit;

Commit complete

SQL> select group #, sequence #, status from v $ log;

    GROUP # SEQUENCE # STATUS

---------- ---------- ----------------

        1 89 CURRENT

        2 87 INACTIVE

        3 88 INACTIVE

Successful transaction operations. If we try to re-start standby, it is not allowed.

SQL> SQL> shutdown immediate

ORA-01154: database busy Open, close, mount, and dismount not allowed now.

Log:

Wed Oct 21 16:34:41 2015

Attempt to shut down Standby Database

Standby Database operating in NO DATA LOSS mode

Detected primary database alive, shutdown primary first, shutdown aborted

However, forced to switch log archiving process, the database immediately found Standby problem, stop the library.

SQL> alter system switch logfile;

alter system switch logfile

ORA-03113: end of the communication channel file

Process ID: 9478

Session ID: 394 SEQ ID NO: 33

Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED

LGWR: All standby destinations have failed

************************************************** ****

WARNING: All standby database destinations have failed

WARNING: Instance shutdown required to protect primary

************************************************** ****

LGWR (ospid: 30597): terminating the instance due to error 16098

Wed Oct 21 16:43:44 2015

System state dump requested by (instance = 1, osid = 30597 (LGWR)), summary = [abnormal instance termination].

System State dumped to trace file /u01/app/oracle/diag/rdbms/vlife/vlife/trace/vlife_diag_30587_20151021164344.trc

Dumping diagnostic data in directory = [cdmp_20151021164344], requested by (instance = 1, osid = 30597 (LGWR)), summary = [abnormal instance termination].

Instance terminated by LGWR, pid = 30597

At this time, standby-side log information:

--Standby End

Wed Oct 21 16:43:42 2015

Archived Log entry 85 added for thread 1 sequence 89 ID 0xfad4f44b dest 1:

Wed Oct 21 16:43:43 2015

Wed Oct 21 16:43:43 2015

RFS [20]: Possible network disconnect with primary databaseRFS [17]: Possible network disconnect with primary database

Description: In the state of maximum protection, if found by the library Primary transfer logs in question, for the protection of the essential, it will automatically shut down.

The following can be operated recovery, prepared by the library first recovery application log states:

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered

Wed Oct 21 16:46:19 2015

alter database recover managed standby database using current logfile disconnect from session

Attempt to start background Managed Standby Recovery process (vlifesb)

Wed Oct 21 16:46:19 2015

MRP0 started with pid = 25, OS id = 1495

MRP0: Background Managed Standby Recovery process started (vlifesb)

 started logmerger process

Wed Oct 21 16:46:24 2015

Managed Standby Recovery starting Real Time Apply

Parallel Media Recovery started with 4 slaves

Waiting for all non-current ORLs to be archived ...

All non-current ORLs have been archived.

Media Recovery Log /u01/app/oracle/fast_recovery_area/VLIFESB/archivelog/2015_10_21/o1_mf_1_89_c2gn1ylm_.arc

Media Recovery Waiting for thread 1 sequence 90

Completed: alter database recover managed standby database using current logfile disconnect from session

Note that the second transaction corresponding data table t_m data has changed. This shows that although before has stopped listening activities, but dependent on a previous connection has been established, or the log transmission in the past.

SQL> select count (*) from t_m;

  COUNT (*)

----------

        99

Try to start the main library:

[Oracle @ vLIFE-URE-OT-DB-PRIMARY trace] $ sqlplus / nolog

SQL * Plus: Release 11.2.0.4.0 Production on Wed Oct 21 16:48:23 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 2471931904 bytes

Fixed Size 2255752 bytes

Variable Size 738198648 bytes

Database Buffers 1711276032 bytes

Redo Buffers 20201472 bytes

Database mounted.

ORA-03113: end-of-file on communication channel

Process ID: 9617

Session ID: 580 Serial number: 5

Error 12541 received logging on to the standby

Check whether the listener is up and running.

LGWR: Error 12541 creating archivelog file 'vlifesb'

Crash Recovery Foreground: All standby destinations have failed

************************************************** ****

WARNING: All standby database destinations have failed

WARNING: Instance shutdown required to protect primary

************************************************** ****

USER (ospid: 9617): terminating the instance due to error 16098

System state dump requested by (instance = 1, osid = 9617), summary = [abnormal instance termination].

System State dumped to trace file /u01/app/oracle/diag/rdbms/vlife/vlife/trace/vlife_diag_9581_20151021164839.trc

Dumping diagnostic data in directory = [cdmp_20151021164839], requested by (instance = 1, osid = 9617), summary = [abnormal instance termination].

Instance terminated by USER, pid = 9617

In the mount to open the process to start is terminated. This is understandable, at Standby end, the listener does not start.

[Oracle @ vLIFE-URE-OT-DB-STANDBY ~] $ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2015 16:50:20

Copyright (c) 1991, 2013, Oracle. All rights reserved.

(Space reasons, have omitted ......)

Service "vlifesb" has 1 instance (s).

  Instance "vlifesb", status UNKNOWN, has 1 handler (s) for this service ...

The command completed successfully

At this time, the main library to start the database again, the operation was successful.

SQL> startup

ORACLE instance started.

Total System Global Area 2471931904 bytes

Fixed Size 2255752 bytes

Variable Size 738198648 bytes

Database Buffers 1711276032 bytes

Redo Buffers 20201472 bytes

Database mounted.

Database opened.

Finally, from the maximum protection "degraded" to the maximum performance mode.

SQL> alter database set standby database to maximize performance

  2 ;

Database altered

SQL> select name, open_mode, database_role, protection_mode from v $ database;

NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE

--------- -------------------- ---------------- ----- ---------------

VLIFE READ WRITE PRIMARY MAXIMUM PERFORMANCE

5 Conclusion

Oracle DG of the three modes, and archive log transport mechanism is closely related. Archive logs to determine the basic premise transmission protection mode by alter database set operations define the database behavior, especially the behavior of the main library work.
     
         
         
         
  More:      
 
- Ubuntu rights management common commands (Linux)
- Java Network Programming Internet address lookup (Programming)
- Linux Learning --- disk partition / relational representation + mount (Linux)
- 4 lvcreate example commonly used commands (Linux)
- Spacewalk Linux system configuration and installation (Linux)
- Java, hashcode, equals and == (Programming)
- Spring MVC Exception Handling (Programming)
- CentOS 6.4 installation and configuration LNMP build PHP server runtime environment (Server)
- Oracle DataGuard principles and basic configuration (Database)
- Remote installation of Net-SNMP whole process (Linux)
- Analyzing Linux server architecture is 32-bit / 64-bit (Server)
- FileZilla 3.10.1.1 install on Ubuntu 14.10 (Linux)
- Linux platform Oracle MySQL connection (Database)
- Ubuntu users install the video driver Nvidia Driver 334.21 (Linux)
- Linux system file directory structure Introduction (Linux)
- Linux system security mechanisms to share (Linux)
- Fun music library in Linux using command line (Linux)
- Ubuntu 10.10 install Oracle 10g Installation Guide (Database)
- php performance monitoring module XHProf (Linux)
- The difference Docker save and export commands (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.