首頁 資料庫 mysql教程 NotesfromDataGuard

NotesfromDataGuard

Jun 07, 2016 pm 03:57 PM
t

There are two types of Standby databases: 1, Physical standby database block-for-block basis the physically identical with the primary database user recovery technology 2, Logical standby database shares the same schema definition withe th

There are two types of Standby databases:
1, Physical standby database
block-for-block basis
the physically identical with the primary database
user recovery technology
2, Logical standby database
shares the same schema definition withe the primary database
executing sql statements on the standby database
use logMiner technology

There are three types of services provided with Data Guard:
1, redo transport services
2, log apply service: including redo apply and SQL apply
3, Role-management services

Oracle Data Guard supports two role-transition operations:
1, Switchover
2, Failover

Oracle Data Guard Data Protection Modes:
1,Maximum Protection
2,Maximum Availability
3,Maximum Performance

Benefits of Implementing Oracle Data Guard:
1,You can use a logical standby for real-time reporting and the physical standby database for point-in-time reporting.
2,Logical standby database is open and ready for reporting at all times.


Note:Standby database can use a different directory structure from the primary database.


On the primary database,Data Guard redo transport services use the following processes:
1,Log Writer(LGWR) process
2,Archiver(ARCn) Process
3,Fetch archive log(FAL)

Note:You can configure a primary database to ship redo information to a single standby database by using either LGWR or ARCn,but not both.


On the standby database,Data Guard log apply services use the following processes:
1,Remote file server(RFS) process
2,Archiver(ARCn) process
3,Managed recovery process(MRP)
4,Logical standby process(LSP)

Standby Redo Logs:
A standby redo log is required to implement:
1, The maximum protection and maximum availability levels of data protection.
2,Real-time apply
3,Cascaded redo log destinations

Standby redo logs are recommended for maximum performance data protection mode
Unless you are using the real-time apply feature,standby redo logs must be archived before the data can be applied to the standby database.
The standby archival operation occurs automatically.

The Data Guard physical standby Redo Apply architecture consists of:
A production(primary) database,which is linked to one or more standby databases(up to nine) that are identical copies of the production database.
--The limit of nine standby databases is imposed by the LOG_ARCHIVE_DEST_n parameter.In Oracle Database 10g,the maximum number of destinations is 10. One is used as the local archive destination,leaving the other nine for uses such as the standby database.
Note: You can use the Cascaded Redo Log Destination feature to incorporate more than nine standby databases in your configuration.
--The primary database is open and active.The standby databases are either in recovery mode or open in read-only mode,but not both.
--Redo is applied to each standby database by using standard Oracle recovery techniques.


Logical Standby Database: SQL Apply Architecture
Instead of using media recovery to apply changes(as in the physical standby database configuration),archived redo log information is transformed
into equivalent SQL statements by using LogMiner technology.These SQL statements are then applied to the logical standby database.The logical
standby database is open in read/write mode and is available for reporting capabilities.

The RECOVERY_MODE column of the V$ARCHIVE_DEST_STATUS view contains the value MANAGED REAL TIME APPLY when log apply services are running in
real-time mode.
For physical standby database,the managed recovery process(MRP) applies the redo from the standby redo log files after the remote file server(RFS) process finishes writing.To start real-time apply for a physical standby database,issue the following command:
alter database recover managed standby database using current logfile;
For logical standby database,the logical standby process(MRP) applies the redo from the standby redo log files after the remote file server(RFS) process finishes writing.To start real-time apply for a logical standby database,issue the following command:
alter database start logical standby apply immediate;


VALID_FOR : ALL_LOGFILES,ALL_ROLES is not recommended setting for a logical standby for any destination.Because a logical standby is an open
database that is creating its own redo, there is a real possibility of having the log files overwrite each other.This gives you a system that is
unrecoverabl and/or unable to keep synchronized with the primary database.

There is only one invalid combination: STANDBY_LOGFILE,PRIMARY_ROLE.
SELECT dest_id,valid_type,valid_role,valid_now from v$archive_dest;

select * from v$standby_log;
select * from v$logfile where type='STANDBY';


Although standby redo logs are used only when the database is operating in the standby role,you should create standby redo logs on the primary
database so that switching roles does not require additional DBA intervention.


You can maintain the standby database in one of the following modes:
For physical standby databases
1,Redo Apply
2,Open read-only mode
For Logical standby databases
Open read/write mode


Data Guard Broker:Requirments
1,Enterprise Edition of Oracle Databae 10g
2,LOCAL_LISTERNER on each instance must resolve to an address that is reachable by all members
3,GLOABL_DBNAME attribute must be set to a concatenation of: db_unique_name_DGMGRL.db_domain

The Data Guard monitor comprises two components: the DMON process and the configuration file.
Data Guard configuration file:
1,default names are dr1.dat and dr2.dat
2,default location for unix and linux:$ORACLE_HOME/dbs. for windows:ORACLE_HOME\database

startup mount;
alter database force logging; The default value is No.


ARCHIVE_LAG_TARGET: It defines the mean time to failover in the event your primary database fails and you must fail over to the standby.
It likes the parameter of "fast_start_mttr_target" mttr:mean time to recovery target


The standby_archive_dest initialization parameter overrides the directory locaition that is specified with the LOG_ARCHVIE_DEST_n parameter
if both the parameters are specified. So you should set standby_archive_dest to the same location as the local archvive destination for the
physical standby database so that all necessary archvied redo log files for the standby database are in the same location.

Defining the Redo Transport Mode
Use the attributes of LOG_ARCHIVE_DEST_n
1,ARCH and LGWR
2,SYNC and ASYNC(LGWR only)
3,AFFIRM and NOAFFIRM
(primary)(修改成MAXIMUM PROTECTION)
SQL> alter system set log_archive_dest_2='SERVICE=orcldg LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldg NODELAY MAX_CONNECTIONS=2 REOPEN=300 NOMAX_FAILURE';


(standby)
SQL> alter system set log_archive_dest_2='SERVICE=orclpri LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl NODELAY MAX_CONNECTIONS=2 REOPEN=300 NOMAX_FAILURE';


Redo Transport Mode: ARCH|SYNC|ASYNC
ARCH: You do not need standby redo log files for this mode. This mode enables the lowest grade of protection to the primary database as well as
the lowest performance impact.
ASYNC: (LGWR,ASYNC,NOAFFIRM) This mode,along with standby redo log files,enables a moderate grade of protection to the primary database and incurs a lower performance impact.
SYNC:(LGWR,SYNC,AFFIRM) This mode, along with standby redo log files,is required for the maximum protection or maximum availability protection
modes.This redo transport mode enables the highest grade of data protection to the primary database,but it also incurs the highest performance
impact.

Data Protection Mode:
1,Maximum protection
2,Maximum availability
3,Maximum performance


Logical Standby Database features:
alter database guard all|standby|none; The default value is all,which means only the SYS can modify the data.

Preparing to create a logical standby database:
1,check for unsupported data types
2,Be aware of unspported DDL commands
3,Ensure row uniqueness
4,Verify that the primary database is configured for archivelog mode
5,Enable supplemental logging

Unsupported objects:
1,Tables and sequences in the SYS schema
2,Tables using table compression
3,Tables used to support materialized views
4,Global temporary tables
5,Tables with unsupported data types(BFILE,ROWID and UROWID,User-defiened types,object types REFs,Varrays,Nested tables,XMLtype)

Query DBA_LOGSTDBY_UNSUPPORTED on the primary database for tables with unsupported data types:
Query DBA_LOGSTDB_NOT_UNIQUE on the primary database to find tables without a unique identifier.
Add a primary key or unique index to ensure that SQL apply can efficiently apply data updates.

Preparing to create a logical standby database.Be sure to check that the initialization parameters have the following values:
PARALLEL_MAX_SERVERS>5
LOG_PARALLELISM=1
SHARED_POOL_SIZE:160M or higher(recommended)


Creating a logical Standby database:
1,create a physical standby database
2,stop redo apply on the physical standby database
3,prepare the primary database to support a logical standby database
4,Build a logMiner Dictionary in the redo data
5,convert to a logical standby database
6,open the logical standby database
7,Verify that the logical standby database is performing properly.

Fast-start failover can be enabled for automatic failover

select thread#,low_sequence#,high_sequence# from v$archive_gap;
alter database register physical logfile 'filespec1';

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆樹的耳語 - 如何解鎖抓鉤
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1664
14
CakePHP 教程
1423
52
Laravel 教程
1321
25
PHP教程
1269
29
C# 教程
1249
24
MySQL的角色:Web應用程序中的數據庫 MySQL的角色:Web應用程序中的數據庫 Apr 17, 2025 am 12:23 AM

MySQL在Web應用中的主要作用是存儲和管理數據。 1.MySQL高效處理用戶信息、產品目錄和交易記錄等數據。 2.通過SQL查詢,開發者能從數據庫提取信息生成動態內容。 3.MySQL基於客戶端-服務器模型工作,確保查詢速度可接受。

說明InnoDB重做日誌和撤消日誌的作用。 說明InnoDB重做日誌和撤消日誌的作用。 Apr 15, 2025 am 12:16 AM

InnoDB使用redologs和undologs確保數據一致性和可靠性。 1.redologs記錄數據頁修改,確保崩潰恢復和事務持久性。 2.undologs記錄數據原始值,支持事務回滾和MVCC。

MySQL:世界上最受歡迎的數據庫的簡介 MySQL:世界上最受歡迎的數據庫的簡介 Apr 12, 2025 am 12:18 AM

MySQL是一種開源的關係型數據庫管理系統,主要用於快速、可靠地存儲和檢索數據。其工作原理包括客戶端請求、查詢解析、執行查詢和返回結果。使用示例包括創建表、插入和查詢數據,以及高級功能如JOIN操作。常見錯誤涉及SQL語法、數據類型和權限問題,優化建議包括使用索引、優化查詢和分錶分區。

MySQL的位置:數據庫和編程 MySQL的位置:數據庫和編程 Apr 13, 2025 am 12:18 AM

MySQL在數據庫和編程中的地位非常重要,它是一個開源的關係型數據庫管理系統,廣泛應用於各種應用場景。 1)MySQL提供高效的數據存儲、組織和檢索功能,支持Web、移動和企業級系統。 2)它使用客戶端-服務器架構,支持多種存儲引擎和索引優化。 3)基本用法包括創建表和插入數據,高級用法涉及多表JOIN和復雜查詢。 4)常見問題如SQL語法錯誤和性能問題可以通過EXPLAIN命令和慢查詢日誌調試。 5)性能優化方法包括合理使用索引、優化查詢和使用緩存,最佳實踐包括使用事務和PreparedStatemen

為什麼要使用mysql?利益和優勢 為什麼要使用mysql?利益和優勢 Apr 12, 2025 am 12:17 AM

選擇MySQL的原因是其性能、可靠性、易用性和社區支持。 1.MySQL提供高效的數據存儲和檢索功能,支持多種數據類型和高級查詢操作。 2.採用客戶端-服務器架構和多種存儲引擎,支持事務和查詢優化。 3.易於使用,支持多種操作系統和編程語言。 4.擁有強大的社區支持,提供豐富的資源和解決方案。

MySQL與其他編程語言:一種比較 MySQL與其他編程語言:一種比較 Apr 19, 2025 am 12:22 AM

MySQL与其他编程语言相比,主要用于存储和管理数据,而其他语言如Python、Java、C 则用于逻辑处理和应用开发。MySQL以其高性能、可扩展性和跨平台支持著称,适合数据管理需求,而其他语言在各自领域如数据分析、企业应用和系统编程中各有优势。

MySQL:從小型企業到大型企業 MySQL:從小型企業到大型企業 Apr 13, 2025 am 12:17 AM

MySQL適合小型和大型企業。 1)小型企業可使用MySQL進行基本數據管理,如存儲客戶信息。 2)大型企業可利用MySQL處理海量數據和復雜業務邏輯,優化查詢性能和事務處理。

MySQL索引基數如何影響查詢性能? MySQL索引基數如何影響查詢性能? Apr 14, 2025 am 12:18 AM

MySQL索引基数对查询性能有显著影响:1.高基数索引能更有效地缩小数据范围,提高查询效率;2.低基数索引可能导致全表扫描,降低查询性能;3.在联合索引中,应将高基数列放在前面以优化查询。

See all articles