In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to open physics Standby in DG-READ ONLY mode. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
Physical Standby concept
DG maintains the physical Standby database through REDO applications.
Usually, when the physical Standby does not perform the REDO application operation, the physical Standby database can be opened in READ ONLY mode. If Flashback Area is specified in the database, it can even be temporarily set to READ WRITE mode. After the operation, it can be restored to the state before READ WRITE through the Flashback Database feature, so that it can continue to receive the REDO sent by Primacy and apply it.
REDO application. Physical Standby maintains consistency with Primary database through REDO application. The so-called REDO application essentially applies REDO data in archived files (or Standby Redologs files) through the recovery mechanism of Oracle. The restore operation belongs to the block-to-block application. If the REDO application operation is being performed, the Oracle database cannot be Open.
READ ONLY mode is on. When opened in READ ONLY mode, you can perform operations such as queries or backups in the Standby database (disguised to reduce the pressure on the Primary database). At this point, the Standby database can still receive REDO data sent by the Primary database, but it will not be applied until the Standby database resumes the REDO application.
In other words, the REDO application cannot be executed in READ ONLY mode, and the database must not be open when REDO is applied. If necessary, you can switch between the two states, for example, apply REDO first, then set the database to READ ONLY state, execute the REDO application command again when you need to synchronize with Primary, and switch back to REDO application state. Oh, life is a cycle, and so is the database.
Note: the application function of physical Standby is enhanced in Oracle 11g version. In 11g version, physical Standby can continue to apply REDO data in OPEN READ ONLY mode, which greatly improves the application of physical Standby database.
READ WRITE mode is on. If opened in READ WRITE mode, the Standby database suspends receiving REDO data from the Primary database and temporarily loses disaster protection. Of course, opening in READ WRITE mode is not useless. For example, you may need to temporarily debug some data, but it is not convenient to operate in the official library, then you can temporarily set the Standby database to READ WRITE mode, and after the operation, the database will be flashed back to the state before operation (after flashback, Data Guard will automatically synchronize, there is no need to rebuild the physical Standby, but if viewed from another direction, flashback is not started. Then you can't go back to the state you were before READ WRITE.
-- =
Generally, physical standby is in mounted mode.
When standby applies redo data normally, its open mode is in mounted mode.
SQL > select open_mode from v$database
OPEN_MODE
-
MOUNTED
In order to start the physical Standby database from the REDO application state to the READ ONLY state, you cannot directly open the database by ALTER DATABASE OPEN. You must first cancel the redo application.
SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
Then open the database:
SQL > alter database open
Query open mode
SQL > select open_mode from v$database
OPEN_MODE
-
READ ONLY
To switch from the OPEN state to the REDO application state, you do not need to restart the SHUTDOWN database, just execute the statement that enables the REDO application.
SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION
-- =
Simulation process: modify master database data-> submit, switch log-> log master / standby transfer-> standby redo application-> open backup database in read-only mode-- > read data
DG maximum performance mode
Main library
SQL > update scott.emp set sal=2000 where empno=7369
1 row updated.
SQL > commit
Commit complete.
SQL > alter system switch logfile
System altered.
SQL > select max (sequence#) from v$archived_log
MAX (SEQUENCE#)
-
fourteen
Physical repository
SQL > select open_mode from v$database
OPEN_MODE
-
MOUNTED
SQL > select max (sequence#) from v$archived_log
MAX (SEQUENCE#)
-
fourteen
SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
Database altered.
SQL > alter database open
Database altered.
SQL > select sal from scott.emp where empno=7369
SAL
-
2000
-- =
This is how DG-READ ONLY mode opens physical Standby. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.