從大資料量主庫建立備庫
年前曾經在本機上測試搭建dataguard,看到一篇挺有意思的文章
原文:http://www.dbspecialists.com/blog/database-backups/standby-database-creation-of-vldbs/
在我之前搭建理解上翻譯了一下
The problem is that for a standby database to stay in-sync with the primary database after creation, it needs to have access to all of the redo that has been generated from the time that the files were backed up on the primary. For very large databases (ie 10Tb+), it’s not uncommon for it to take a number of days to backup/transfer datafiles from the primary to the standby database. When those datafiles are finally restored on the standby database, the redo that was generated over these days needs to be applied to the standby, before the standby can accept new redo from the primary database, and this can be a very large quantity of redo!
the primary to the standby database. When those datafiles are finally restored on the standby database, the redo that was
generated over these days needs to be applied to the standby, before the standby can accept new redo from the primary
database, and this can be a very large quantity of redo!
對於非常大的庫,通常都需要花費許多天來從主庫到備庫進行資料檔案的備份/轉移(包括redo)。當那些資料檔案最終在備庫中恢復, 而備庫在能夠接收主庫產生的新redo之前,需要應用主庫在資料檔案備份轉移這幾天過程中生成的redo,而這些redo是十分多的!
So, what’s the secret? The main secret is to create the standby incrementally, datafile by datafile, over an extended
period of time, and keeping the datafiles transferred all synced with the primary soon after they are transferred.
處理大資料量最主要的祕密是增量式地一個資料檔案接著一個資料檔案地建立備庫,在備庫擴充套件期間,在主庫的資料檔案傳送到備庫後不久即保持同步。
It turns out that Oracle physical standby databases manage controlfiles differently than primary databases. When you
issue ‘alter database drop datafile mydatafile.dbf including contents and datafiles’ on a primary database, the
controlfile is updated, and the history of that datafile is wiped clean; there really is no way to restore a datafile
after it has been dropped.
物理備庫管理控制檔案的方法有別於主庫,當主庫執行‘alter database drop datafile mydatafile.dbf including contents and datafiles’時候,控制檔案被更新,此資料檔案的歷史將被清空,並不能夠被恢復。
However, on a standby database, when you issue a ‘alter database drop datafile mydatafile.dbf’ on a standby database,
the history of that datafile actually doesn’t go away! It is simply marked with a ‘delete’ flag in memory, which
causes the Oracle recovery process on the standby database to skip that datafile.
然而備庫中當執行‘alter database drop datafile mydatafile.dbf’後,歷史仍然保留在控制檔案中,而只不過在記憶體中被標記為“已刪除”,oracle的恢復程式則會在備庫中恢復資料檔案時跳過此檔案。
Using this information, you can create a standby database datafile-by-datafile, over a period of days, weeks, or even
months, by:
1.Creating a standby controlfile from the primary and shipping it to the standby,
2.Modifying parameters on the primary database to ship logs to the standby if using Enterprise Edition,
3.Setting up a special parameter file for the standby database that will accept redo from the primary database,
4.Copy the first datafile from the primary to the standby (or restore it using RMAN)。
5.Start the standby database in ‘mount’ mode (alter database mount standby database). You will notice that in
v$datafile_header, the 1st datafile will have a status of ONLINE, and all other datafiles will have a status of ERROR.
6.For all datafiles that have a status of ERROR, issue a ‘alter database drop datafile datafile_name;’ on the standby
database.
7.Initiate standby recovery on the standby database, (recover managed standby database..)
8.Initiate redo transfer from the primary to the standby (ie set the LOG_ARCHIVE_DEST_n_ENABLE parameter in the primary)
9.Insure that the standby is applying redo from the primary database (ie v$dataguard_status in the standby).
10.This is now stable; the 1st datafile will be kept up-to-date. You can’t really use (or open) the standby database yet.
11.When you are ready for the next datafile, transfer the datafile from the primary to the standby,
12.Shut down the standby (shutdown immediate). Then, start it back up (startup nomount; alter database mount standby
database).
13.Again, note which datafiles have a status of OFFLINE in v$datafile_header. For each of those, re-issue the alter database drop datafile datafile_name.
14.Begin redo application from the standby (ie alter database recover managed standby database…).
15.The database is again ’stable’ – the 1st two datafiles will be kept in-sync from the primary.
16.Repeat the steps above (11-15) for each datafile in turn. If you like, you can copy a few files at a time; it depends on how big they are, and how much redo you can keep around.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24582392/viewspace-688041/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MacOS使用Docker建立MySQL主從資料庫MacDockerMySql資料庫
- sql 資料庫 龐大資料量 需要分表SQL資料庫大資料
- dg主庫建立檔案備庫未同步解決方法
- mysql主庫清理資料,從庫保留MySql
- Mysql 資料庫主庫,備庫實時同步配置MySql資料庫
- NoSQL 資料庫的主主備份SQL資料庫
- 大資料量高併發的資料庫優化大資料資料庫優化
- access資料庫大資料量分頁的問題資料庫大資料
- MYSQL資料庫主從同步(一主一從)MySql資料庫主從同步
- 資料庫中主庫和從庫的關係資料庫
- MacOS使用Docker建立MySQL主主資料庫MacDockerMySql資料庫
- ORACLE DATAGUARD 資料庫---建立物理備用資料庫Oracle資料庫
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫(二)
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫(一)
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫 (三)
- 資料庫主從複製資料庫
- mysql主從資料庫配置MySql資料庫
- [資料庫]MYSQL主從同步資料庫MySql主從同步
- Mysql跨庫主從熱備失效問題MySql
- 使用RMAN建立資料庫備份庫(筆記)資料庫筆記
- 【mysql】mysql的資料庫主從(一主一從)MySql資料庫
- 利用RMAN建立備用資料庫資料庫
- 資料量與資料庫選型資料庫
- Data Guard 主庫建立表空間,備庫MRP無法啟動
- BlueHost美國主機如何建立資料庫資料庫
- 8、MySQL主從資料庫配置MySql資料庫
- Mysql資料庫主從心得整理MySql資料庫
- RMAN備份 建立catalog資料庫資料庫
- 對執行中的Mysql資料庫建立從庫MySql資料庫
- MySQL 5.7 主庫崩潰切備庫MySql
- 通過現有的資料庫備份建立新的資料庫資料庫
- 【DataGuard】使用GC建立的物理DataGuard主備庫pfile比較GC
- mysql innobackupex xtrabackup 大資料量 備份 還原MySql大資料
- 資料庫主鍵、從鍵(易懂版)資料庫
- 搭建 mariadb 資料庫主從同步資料庫主從同步
- DataGaurd環境主庫崩潰後將備庫切為主庫
- oracle 之dataguard主庫系統崩潰之物理備庫切主庫Oracle
- 單節點主庫、邏輯備庫升級為RAC、物理備庫、邏輯備庫(1)