[Oracle] Data Guard 系列(3)
在上一节《Data Guard 系列(2) - 日志传输》中,我们介绍了DG的日志传输服务,当日志从主库传输至备库后,备库需要应用日志来保持和主库的同步,本节就来介绍日志应用服务。 Redo应用 or SQL应用? 我们知道有两种类型的备库,分别是物理备库和逻辑备库,
在上一节《Data Guard 系列(2) - 日志传输》中,我们介绍了DG的日志传输服务,当日志从主库传输至备库后,备库需要应用日志来保持和主库的同步,本节就来介绍日志应用服务。
Redo应用 or SQL应用?
我们知道有两种类型的备库,分别是物理备库和逻辑备库,物理备库的日志应用叫做Redo应用,而逻辑备库的日志应用叫做SQL应用。
所谓的Redo应用是指备库采用介质恢复的方式应用主库传输过来的日志,因此物理备库就像是主库的一面镜子,不但数据一样,物理结构(如数据块、数据文件等)都一样,这样的好处是同步速度快。
所谓的SQL应用是指备库通过Log Miner从日志中解析出SQL语句,然后应用这些SQL语句,很显然,SQL应用的性能比不上Redo应用,但它更灵活。逻辑备库采用SQL应用。
实时日志应用
默认情况下,只有等Standby日志文件归档后才进行日志应用,如果你想一接收到从主库传输过来的日志,马上进行日志应用,则必须打开实时应用,这样只要RFS进程接收到日志并写入Standby日志文件后,MRP/LSP 进程能在备库第一时间应用日志,从而实现主备库的实时同步。
物理备库通过以下语句开启实时应用: SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT; 逻辑备库通过以下语句开启实时应用: SQL> ALTER DATABASE START LOGICAL STANDBYAPPLY IMMEDIATE;
查看是否已开启了实时应用,在standby端执行如下SQL:
SQL> select recovery_mode from v$archive_dest_status where dest_id=1; RECOVERY_MODE ----------------------- MANAGED REAL TIME APPLY
开启/关闭日志应用服务
物理备库:
--开启 SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT; --关闭 SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
--开启 SQL> ALTER DATABASE START LOGICAL STANDBY APPLY; --关闭 SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;
《[Oracle] Data Guard 系列(1) - 三种保护模式》
《[Oracle] Data Guard 系列(2) - 日志传输》
《[Oracle] Data Guard 系列(3) - 日志应用》
《[Oracle] Data Guard 系列(4) - 在不停主库的情况下创建物理备库》
《[Oracle] Data Guard 系列(5) - 创建逻辑备库》
《[Oracle] Data Guard 系列(6) - 角色转换》

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

AI Hentai Generator
Generate AI Hentai for free.

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

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

The Oracle database startup sequence is: 1. Check the preconditions; 2. Start the listener; 3. Start the database instance; 4. Wait for the database to open; 5. Connect to the database; 6. Verify the database status; 7. Enable the service (if necessary ); 8. Test the connection.

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

To find the number of occurrences of a character in Oracle, perform the following steps: Get the total length of a string; Get the length of the substring in which a character occurs; Count the number of occurrences of a character by subtracting the substring length from the total length.

Oracle database server hardware configuration requirements: Processor: multi-core, with a main frequency of at least 2.5 GHz. For large databases, 32 cores or more are recommended. Memory: At least 8GB for small databases, 16-64GB for medium sizes, up to 512GB or more for large databases or heavy workloads. Storage: SSD or NVMe disks, RAID arrays for redundancy and performance. Network: High-speed network (10GbE or higher), dedicated network card, low-latency network. Others: Stable power supply, redundant components, compatible operating system and software, heat dissipation and cooling system.

The Xiaomi Mi 15 series is expected to be officially released in October, and its full series codenames have been exposed in the foreign media MiCode code base. Among them, the flagship Xiaomi Mi 15 Ultra is codenamed "Xuanyuan" (meaning "Xuanyuan"). This name comes from the Yellow Emperor in Chinese mythology, which symbolizes nobility. Xiaomi 15 is codenamed "Dada", while Xiaomi 15Pro is named "Haotian" (meaning "Haotian"). The internal code name of Xiaomi Mi 15S Pro is "dijun", which alludes to Emperor Jun, the creator god of "The Classic of Mountains and Seas". Xiaomi 15Ultra series covers

Oracle can read dbf files through the following steps: create an external table and reference the dbf file; query the external table to retrieve data; import the data into the Oracle table.

Since the Huawei Mate60 series went on sale last year, I personally have been using the Mate60Pro as my main phone. In nearly a year, Huawei Mate60Pro has undergone multiple OTA upgrades, and the overall experience has been significantly improved, giving people a feeling of being constantly new. For example, recently, the Huawei Mate60 series has once again received a major upgrade in imaging capabilities. The first is the new AI elimination function, which can intelligently eliminate passers-by and debris and automatically fill in the blank areas; secondly, the color accuracy and telephoto clarity of the main camera have been significantly upgraded. Considering that it is the back-to-school season, Huawei Mate60 series has also launched an autumn promotion: you can enjoy a discount of up to 800 yuan when purchasing the phone, and the starting price is as low as 4,999 yuan. Commonly used and often new products with great value
