搜尋
首頁資料庫mysql教程Oracle Data Guard_ 备库以只读或读写方式打开访问

Oracle Data Guard_ 备库以只读或读写方式打开访问

Opening a Standby Database for Read-Only or Read/Write Access

8.2以只读或者可读写方式打开备库来访问

 

When a standby database is open for read-only access, users can query the standby database but cannot update it. Thus, you can reduce the load on the primary database by using the standby database for reporting purposes. You can periodically open the standby database for read-only access and perform ad hoc queries to verify Redo Apply is updating the standby database correctly. (Note that for distributed queries, you must first issue theALTER DATABASE SET TRANSACTION READ ONLYstatement before you can issue a query on the read-only database.)

当备库是以只读方式打开时,用户只能在备库上查询而不能更新它。那么你可以为主库减轻负载而在备库上出报表,你可以定期的以只读方式打开备库,查询验证重做应用是否正确的更新到备库。针对分布式查询,你必须在只读数据库查询之前发出ALTER DATABASE SET TRANSACTION READ ONLY语句。

shows a standby database open for read-only access.

Figure 8-1 Standby Database Open for Read-Only Access

Description of "Figure 8-1 Standby Database Open for Read-Only Access"

 

See Also:

A physical standby database can be opened temporarily in read/write mode for development, reporting, or testing purposes, and then flashed back to a point in the past to be reverted back to a physical standby database. When the database is flashed back, Data Guard automatically synchronizes the standby database with the primary database, without the need to re-create the physical standby database from a backup copy of the primary database.

物理备库可以暂时打开以读/写模式用来开发,报告或测试的目的,然后闪回到

See Also:

for a scenario that describes activating a physical standby database as a read/write reporting database, and then resynchronizing the database with the primary database

 

第12.6节的场景,描述活动的物理备用数据库为读/写报告数据库,然后与主数据库重新同步数据库。

8.2.1Assessing Whether or Not to Open a Standby Database

8.2.1 评估是否要打开备库

 

As you decide whether or not to open a physical standby database for read-only or read/write access, consider the following:

决定是否要以只读方式或者读写方式打开物理备库,可以考虑如下:

  • Opening the physical standby database read-only may lengthen the time it takes to recover from a failure or outage, because the database must be restarted after a failover.

    以只读方式打开物理备库可以延长失败或中断恢复的时间,因为数据库必须在故障切换后重新启动。

  • As long as the physical standby database has not been opened read-only since the last time it was started, a restart is unnecessary after failover, thus increasing system availability.

    只要物理备库自从上次启动没有以只读方式打开,在故障切换后,,重启是必须的,那么就会增加系统的可用性。

  • While a standby database is open for read-only or read/write access, it does not apply redo data received from the primary database, thus it is not kept transactionally consistent with the primary database.

    当备库是以只读方式打开或者读写方式打开,就不会应用来自主库的重做数据,那么就不能与主库保持一致性的事务。

  • When a physical standby database is open, redo data from the primary database is received by the standby database, but the log files are not applied. At some point, you need to resume Redo Apply on the standby database, and apply the archived redo log files to resynchronize the standby database with the primary database. Because of the additional time required to apply any accumulated archived redo log files, having a standby database open for read-only access can increase the time required to complete failovers or switchovers.

    当物理备库是打开时,来自主库的重做数据被备库接收,但是不会被应用。在有点伤,你需要在备库上重新应用重做数据,应用归档日志来同步备库和主库之间的数据。因为应用任何所需的额外时间累积的归档重做日志文件,

    You can use a physical standby database for reporting purposes or as a clone database while also maintaining the ability to complete a failover or switchover quickly if you configure more than one standby database on the standby system.

    你可以使用一个物理备用数据库进行报表用途或克隆一个数据库,同时还保持了完整的故障切换或正常切换。

    For example, based on your business requirements, you might:

    例如,基于你的业务需求,你可以:

  • Configure two physical standby databases with one standby database always performing Redo Apply to be as current as possible with the primary database and the other standby database open in read-only mode during business hours for reporting purposes.

    配置两个物理备库,其中一个备库尽可能经常用来执行重做应用主库的日志,另外一个则以只读方式打开在业务期间达到出报表的目的。

  • Configure a physical standby database to maintain a copy of the primary database for disaster recovery purposes and also configure a logical standby database to off-load reporting tasks that require access to the latest data from the primary database.

    配置物理备库来维护主库的副本来达到灾难恢复的目的,配置逻辑备库来卸载报表任务,这需要访问到主库最新的数据。

  • 陳述
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
    如何使用MySQL的函數進行數據處理和計算如何使用MySQL的函數進行數據處理和計算Apr 29, 2025 pm 04:21 PM

    MySQL函數可用於數據處理和計算。 1.基本用法包括字符串處理、日期計算和數學運算。 2.高級用法涉及結合多個函數實現複雜操作。 3.性能優化需避免在WHERE子句中使用函數,並使用GROUPBY和臨時表。

    MySQL批量插入數據的高效方法MySQL批量插入數據的高效方法Apr 29, 2025 pm 04:18 PM

    MySQL批量插入数据的高效方法包括:1.使用INSERTINTO...VALUES语法,2.利用LOADDATAINFILE命令,3.使用事务处理,4.调整批量大小,5.禁用索引,6.使用INSERTIGNORE或INSERT...ONDUPLICATEKEYUPDATE,这些方法能显著提升数据库操作效率。

    給MySQL表添加和刪除字段的操作步驟給MySQL表添加和刪除字段的操作步驟Apr 29, 2025 pm 04:15 PM

    在MySQL中,添加字段使用ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column,刪除字段使用ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop。添加字段時,需指定位置以優化查詢性能和數據結構;刪除字段前需確認操作不可逆;使用在線DDL、備份數據、測試環境和低負載時間段修改表結構是性能優化和最佳實踐。

    如何分析MySQL查詢的執行計劃如何分析MySQL查詢的執行計劃Apr 29, 2025 pm 04:12 PM

    使用EXPLAIN命令可以分析MySQL查詢的執行計劃。 1.EXPLAIN命令顯示查詢的執行計劃,幫助找出性能瓶頸。 2.執行計劃包括id、select_type、table、type、possible_keys、key、key_len、ref、rows和Extra等字段。 3.根據執行計劃,可以通過添加索引、避免全表掃描、優化JOIN操作和使用覆蓋索引來優化查詢。

    如何使用MySQL的子查詢提高查詢效率如何使用MySQL的子查詢提高查詢效率Apr 29, 2025 pm 04:09 PM

    子查詢可以提升MySQL查詢效率。 1)子查詢簡化複雜查詢邏輯,如篩選數據和計算聚合值。 2)MySQL優化器可能將子查詢轉換為JOIN操作以提高性能。 3)使用EXISTS代替IN可避免多行返回錯誤。 4)優化策略包括避免相關子查詢、使用EXISTS、索引優化和避免子查詢嵌套。

    MySQL的字符集和排序規則如何配置MySQL的字符集和排序規則如何配置Apr 29, 2025 pm 04:06 PM

    在MySQL中配置字符集和排序規則的方法包括:1.設置服務器級別的字符集和排序規則:SETNAMES'utf8';SETCHARACTERSETutf8;SETCOLLATION_CONNECTION='utf8_general_ci';2.創建使用特定字符集和排序規則的數據庫:CREATEDATABASEexample_dbCHARACTERSETutf8COLLATEutf8_general_ci;3.創建表時指定字符集和排序規則:CREATETABLEexample_table(idINT

    怎樣卸載MySQL並清理殘留文件怎樣卸載MySQL並清理殘留文件Apr 29, 2025 pm 04:03 PM

    要安全、徹底地卸載MySQL並清理所有殘留文件,需遵循以下步驟:1.停止MySQL服務;2.卸載MySQL軟件包;3.清理配置文件和數據目錄;4.驗證卸載是否徹底。

    如何在MySQL中重命名數據庫如何在MySQL中重命名數據庫Apr 29, 2025 pm 04:00 PM

    MySQL中重命名數據庫需要通過間接方法實現。步驟如下:1.創建新數據庫;2.使用mysqldump導出舊數據庫;3.將數據導入新數據庫;4.刪除舊數據庫。

    See all articles

    熱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

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

    熱工具

    SublimeText3 Mac版

    SublimeText3 Mac版

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

    SAP NetWeaver Server Adapter for Eclipse

    SAP NetWeaver Server Adapter for Eclipse

    將Eclipse與SAP NetWeaver應用伺服器整合。

    Atom編輯器mac版下載

    Atom編輯器mac版下載

    最受歡迎的的開源編輯器

    SecLists

    SecLists

    SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

    SublimeText3 Linux新版

    SublimeText3 Linux新版

    SublimeText3 Linux最新版