DG學習筆記(9)_備份與RAC

gdutllf2006發表於2010-03-19

DG學習筆記(9)_備份與RAC

 

1         Using a Standby Database to Back Up the Primary Database

 

1.1   Outline

 

Backups of data files and archived redo logs are fully interchangeable

 

Control file backups are not interchangeable

 

Primary database and standby database must use the same recovery catalog

 

Do not need to register the standby database

 

1.2 Restrictions and Usage Notes

 

Must be a physical standby

 

Must be connected to the recovery catalog when backing up

使用CatalogDB,只有這樣Primary才能知道備庫的備份情況

 

Cannot backup the standby control file

控制檔案不能交叉使用

 

Connect to the physical standby database with the TARGET keyword

 

 

2         Logical Database Backup

 

先不學習

 

 

3 Deploy DG in RAC

 

兩種部署方式

Can ship logs to another RAC

Each node ships its redo information to a corresponding node

Shipping and receiving is spread across nodes

Apply services are done on one node

Switchover or failover to like system

 

Can ship logs to a single instance system for standby

May impede performance

Switchover or failover to a smaller system

Make sure the number of Standby redo logs on the standby equal to the total number of online redo logs in all the instances of the RAC system.(Standby redo log的個數應等於Primary RAC中兩個節點的個數總和)

 

RAC + DG Architecture 架構

 

 

 

Switchover with RAC

For a database using RAC, only one primary instance and one standby instance can perform. the switchover operation. Shut down all other instance before the switchover operation.(SwitchOver只在一個節點上做,其餘節點要關閉)

 

RAC環境下DG 的部署過段時間做個實驗.

 

4 Using a Standby Database to Back Up the Primary Database 基本步驟

 

Step 1 Back up the standby database.

1.1 % rman target sys/change_on_install@stby nocatalog

 

1.2 RMAN> run {

allocate channel c1 type disk;

backup database;

}

 

1.3 Back up the archived redo logs.

For example, suppose there is only one thread and the sequence number at the time of the database backup is 15.

即在Backup Database後,還生成有Archivelog. Backup database時的Log Sequence號為15,所以只備份15之後的.

RMAN> run {

allocate channel c1 type disk;

backup archivelog from logseq 15;

}

 

 

Step 2 Restore the backup at the primary site.

1. Set up a recovery catalog database on the primary site.

 

2. Ensure that the primary database is in the mounted state

 

3. Move the standby control file and the backup pieces to the primary site

If the backup is on disk, the backup pieces must reside under the same directory at the primary site as they do at the standby site.

Backup Piece的路徑應與原路徑一致

 

4. Resynchronize the catalog database with the standby control file.

這樣,Primary就知道備份集的東西了

% rman target sys/change_on_install@prmy catalog rman/rman@rcat

RMAN> resync catalog from controlfilecopy ’scf3.ctl’;

 

5. List the backup set obtained by the catalog database after the resynchronization:

RMAN> list backup;

檢視有沒有同步成功.

 

6 Restore the primary database:

RMAN> run {

allocate channel c1 type disk;

restore database;

}

 

7. Restore the archived log.

SQL> RECOVER DATABASE;

 

Step 3 open database

 

SQL> Alter database open;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10248702/viewspace-629928/,如需轉載,請註明出處,否則將追究法律責任。

相關文章