Introduction to dataguard
Dataguard is a database-level HA solution. Its primary functions include redundancy, data protection, and fault recovery.
Transaction uard is the "transaction consistency copy" of the production database. during creation, the physical copy of the production database is used. after the backup database is created, it automatically maintains the backup database through the archive logs (or redo entries) transmitted from the production database. Apply the redo data to the slave database.
Dataguard
Dataguard is divided into "physical standby" and "logical standby"
Physical Standby:
The physical structure and logical structure of the master and slave databases are consistent. Generally, the slave database recovers from the archive logs transmitted from the master database.
Based on the "block-to-block" method. Same as the primary database. Physical standby is equivalent to the production database. Physical standby can be opened in read-only mode (or in the flashback database in read-write mode ").
Once the physical standby is opened in "read/write" mode, the Standby database will not accept redo data from the primary database. Only when the slave database flashback reaches the past point and the slave database flashback goes to the "read/write" status before the start time point, the slave uard automatically synchronizes the slave database and the master database. In order to reply to the standby role.
Logical Standby:
Only ensure that the logical structure is consistent with that of the master database. The slave database must be open and restored by using the SQL statements extracted from the archive log files of the master database.
The master database copy is used as the physical standby during creation.
The logical standby database is updated by executing SQL statements. Dataguard converts the data in the log file to an SQL statement, and then executes the SQL statement on the logical standby. because logical standby uses SQL statements to synchronize data, it must be enabled during synchronization.
Dataguard service:
1. Redo the transmission service
Controls the transmission of redo data from the production machine to one or more slave databases.
2. Log Application Service
2.1 generate an archive log file through the arch process on the production database and transmit it to the slave database. Then, the slave database Recovers Data from the archive log.
2.2 In real-time mode, operations on the production database are reflected in the backup log file of the slave database in real time through the lgwr process, and the slave database restores data from the backup log file in real time.
3. Role Switching
Switch the User Role of the Master/Slave database.
Dataguard three Protection modes:
1. maximum protection
In this mode, data is synchronized between the master and slave databases. That is, when the master database is submitted, the slave database recovers accordingly. Data integrity is ensured to the maximum extent. Data loss is not allowed.
If the network between the master and slave databases or the slave database fails, the operations on the master database are directly affected. This causes the master database to become a machine.
2. maximum availability
This mode is similar to "maximum protection. Normally, the master and slave databases are synchronized.
When a problem occurs in the network or slave database, the master database is not affected, and the master database is automatically converted to the "maximum performance" mode. When the slave database is available, transfers the archive file to the slave database for recovery.
This mode can be understood as an intermediate between "maximum protection" and "maximum performance.
3. maximum performance
This mode maximizes the performance of the master database and asynchronously transmits data between the master and slave databases. That is, the master and slave logs are archived before they are transmitted to the slave database. archive log files are used on the slave database for recovery.