Oracle 11g Data Guard: How to Change Data Guard Protection M
How to Change Data Protection Mode ofa Primary Database Step 1Select a dataprotection mode that meets your availability, performance, and data protectionrequirements. Maximum Availability This protection mode provides the highest level of
How to Change Data Protection Mode ofa Primary Database
Step 1 Select a dataprotection mode that meets your availability, performance, and data protectionrequirements.
Maximum Availability
This protection mode provides the highest level of data protectionthat is possible without compromising the availability of a primary database.Transactions do not commit until all redo data needed to recover thosetransactions has been written to the online redo log and to the standby redolog on at least one synchronized standby database. If the primary databasecannot write its redo stream to at least one synchronized standby database, itoperates as if it were in maximum performance mode to preserve primary databaseavailability until it is again able to write its redo stream to a synchronizedstandby database.
This mode ensures that no data loss will occur if the primarydatabase fails, but only if a second fault does not prevent a complete set ofredo data from being sent from the primary database to at least one standbydatabase.
Maximum Performance
This protection mode provides the highest level of data protectionthat is possible without affecting the performance of a primary database. Thisis accomplished by allowing transactions to commit as soon as all redo datagenerated by those transactions has been written to the online log. Redo datais also written to one or more standby databases, but this is doneasynchronously with respect to transaction commitment, so primary databaseperformance is unaffected by delays in writing redo data to the standbydatabase(s).
This protection mode offers slightly less data protection thanmaximum availability mode and has minimal impact on primary databaseperformance.
This is the default protection mode.
Maximum Protection
This protection mode ensures that no data loss will occur if theprimary database fails. To provide this level of protection, the redo dataneeded to recover a transaction must be written to both the online redo log andto the standby redo log on at least one synchronized standby database beforethe transaction commits. To ensure that data loss cannot occur, the primarydatabase will shut down, rather than continue processing transactions, if itcannot write its redo stream to at least one synchronized standby database.
Transactions on the primary are considered protected as soon as DataGuard has written the redo data to persistent storage in a standby redo logfile. Once that is done, acknowledgment is quickly made back to the primarydatabase so that it can proceed to the next transaction. This minimizes theimpact of synchronous transport on primary database throughput and responsetime. To fully benefit from complete Data Guard validation at the standbydatabase, be sure to operate in real-time apply mode so that redo changes areapplied to the standby database as fast as they are received. Data Guardsignals any corruptions that are detected so that immediate corrective actioncan be taken.
Because this data protection mode prioritizes data protection overprimary database availability, Oracle recommends that a minimum of two standbydatabases be used to protect a primary database that runs in maximum protectionmode to prevent a single standby database failure from causing the primarydatabase to shut down.
Note:
Asynchronously committed transactions are not protected by DataGuard against loss until the redo generated by those transactions has beenwritten to the standby redo log of at least one synchronized standby database.
For more information about the asynchronous commit feature, see:
- Oracle Database Concepts
- Oracle Database SQL Language Reference
- Oracle Database Advanced Application Developer's Guide
- Oracle Database PL/SQL Language Reference
Step 2 Verify thatat least one standby database meets the redo transport requirements for thedesired data protection mode.
The LOG_ARCHIVE_DEST_n database initializationparameter that corresponds to at least one standby database must include theredo transport attributes listed inTable5-1 for the desired data protection mode.
Table 5-1 RequiredRedo Transport Attributes for Data Protection Modes
Maximum Availability |
Maximum Performance |
Maximum Protection |
AFFIRM |
NOAFFIRM |
AFFIRM |
SYNC |
ASYNC |
SYNC |
DB_UNIQUE_NAME |
DB_UNIQUE_NAME |
DB_UNIQUE_NAME |
Step 3 Verify thatthe DB_UNIQUE_NAME database initialization parameter has been set to a uniquevalue on the primary database and on each standby database.
Step 4 Verify thatthe LOG_ARCHIVE_CONFIG database initialization parameter has been defined onthe primary database and on each standby database, and that its value includesa DG_CONFIG list that includes the DB_UNIQUE_NAME of the primary database andeach standby database.
For example, the following SQL statement might be used to configurethe LOG_ARCHIVE_CONFIG parameter:
SQL> showparameter log_archive_config
NAME TYPE VALUE
----------------------------------------------- ------------------------------
log_archive_config string DG_CONFIG=(prod,standby)
Step 5 Set the dataprotection mode.
Execute the following SQL statement on the primary database:
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE{AVAILABILITY | PERFORMANCE | PROTECTION};
SQL> ALTERDATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;
Database altered.
SQL> selectLOG_MODE,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUSfrom v$database;
LOG_MODE OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS
-------------------------------- -------------------- -------------------- ------------------------------------
ARCHIVELOG READ WRITE MAXIMUM AVAILABILITY MAXIMUMAVAILABILITY PRIMARY TO STANDBY
Note that the data protection mode can be set to MAXIMUM PROTECTIONon an open database only if the current data protection mode is MAXIMUMAVAILABILITY and if there is at least one synchronized standby database.
You can change the protection mode from MAXIMUM AVAILABILITY to MAXIMUM PROTECTION when the database is open:
SQL> ALTERDATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;
Database altered.
SQL> selectLOG_MODE,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUSfrom v$database;
LOG_MODE OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS
-------------------------------- -------------------- -------------------- ------------------------------------
ARCHIVELOG READ WRITE MAXIMUM PROTECTION MAXIMUM PROTECTION PRIMARY TO STANDBY
But you cannot change the protection mode from MAXIMUM PERFORCEMANCE to MAXIMUM PROTECTION when the database is open
SQL> selectLOG_MODE,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUSfrom v$database;
LOG_MODE OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS
-------------------------------- -------------------- -------------------- ------------------------------------
ARCHIVELOG READ WRITE MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PRIMARY FAILED DESTINATION
SQL> ALTERDATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;
ALTER DATABASE SETSTANDBY DATABASE TO MAXIMIZE PROTECTION
*
ERROR at line 1:
ORA-01126: databasemust be mounted in this instance and not open in any instance
To change the data protection mode from MAXIMUMPERFORMANCE to MAXIMUM PROTECTION , the database must be mounted, not open.
SQL> shutdownimmediate
SQL> startupmount;
SQL> selectLOG_MODE,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUSfrom v$database;
LOG_MODE OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS
-------------------------------- -------------------- -------------------- ------------------------------------
ARCHIVELOG MOUNTED MAXIMUM PERFORMANCE UNPROTECTED PRIMARY NOT ALLOWED
SQL> ALTERDATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;
Database altered.
SQL> selectLOG_MODE,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUSfrom v$database;
LOG_MODE OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS
-------------------------------- -------------------- -------------------- ------------------------------------
ARCHIVELOG MOUNTED MAXIMUM PROTECTION UNPROTECTED PRIMARY NOT ALLOWED
Pls Note, If the listener of the standby is notstarted, the switchover status here shows "FAILED DESTINATION" .Afteryou start the standby's listener
, the status will change to "TO STANDBY".
SQL> selectLOG_MODE,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUSfrom v$database;
LOG_MODE OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS
-------------------------------- -------------------- -------------------- ------------------------------------
ARCHIVELOG READ WRITE MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PRIMARY TO STANDBY
作者:xiangsir
QQ:444367417
MSN:xiangsir@hotmail.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.
