RMAN Catalog 學習與測試

gdutllf2006發表於2010-03-06

RMAN Catalog 學習與測試

 

目錄

1 Catalog Overview

2 Catalog 安裝與御載Catalog 安裝與御載

3 Resetting a Database Incarnation in the Recovery Catalog

4 Resynchronizing the Recovery Catalog

5 Catalog Restored Script

6 只能在配置了Catalog環境下使用的命令

 

 

1 Catalog Overview

The RMAN repository is a set of metadata that RMAN uses to sotre information about the target database and its backup and recovery operations.  You can either create a recovery catalog in which to store the repository, or let RMAN store the repository exclusively in the target database control file. (確認當使用Catalog,備份資訊是否同時寫到控制檔案和Catalog database? 確定,但控制檔案中儲存的資訊容量有限,會很快被Overrided.)

 

Content of Catalog:

The recovery catalog contains information about RMAN operations, including:

Datafile and archived redo log backup sets and backup pieces.

Datafile copies

Archived redo logs and their copies

Tablespace and datafiles on the target database

Stored scripts

Persistent RMAN configuration settings

 

2 Catalog 安裝與御載

<< RMAN學習筆記_Catalog 安裝與御載>>

 

3 Resetting a Database Incarnation in the Recovery Catalog

測試恢復到以前的Incarnation.(有哪些限制呢?)

 

區別RMAN: ALTER DATABASE OPEN RESETLOGSSQL: ALTER DATABASE OPEN RESETLOGS.

RMAN中執行完RESETLOGS後會自動執行RESET DATABASE 語句,指定新的incarnation為當前的incarnation, SQL,不會自動執行RESET DATABASE,而必須手動執行RESET DATABASE語句.

 

4 Resynchronizing the Recovery Catalog

 

1) When resynchronizing, RMAN does the following:

1. Creates a snapshot control file.

2. Compares the recovery catalog to the snapshot.

3. Updates the catalog with information that is missing or changed.

 

2) Catalog的同步分為兩種: 完全同步,部分同步, 分別對應Control File中的兩部分資訊.

 

3) BACKUP, COPY, DELETE等操作會自動執行同步,Log Switch and Log Archive 不會自動同步, RESYNC CATALOG command to force a full resynchronization.

 

4) Catalog同步過程中會把當前控制檔案的資訊同步到Catalog, 同時也會把備份的控制檔案中的資訊同步過去.

 

5) 同步資訊的型別有: Log History, Archived redo logs, Backup history, Physical schema.

 

6) 設定CONTROL_FILE_RECORD_KEEP_TIME值長點,以保證控制檔案資訊被Override之前被同步到了Catalog.

 

7) Snapshot control file

RMAN generates a snapshot control file, which is a temporary backup control file, each time it performs a full resynchronization.This snapshot control file ensures that RMAN has a consistent viwe of the control file.( oracle同步catalog時,會先建立個snapshot controlfile並且比較這個檔案和catalog,完成比較後,oracle根據這個snapshot controlfile來同步catalog,並使它們保持一致)

 

5 Catalog Restored Script

Storing the script. in the recovery catalog instead of in an operating system text file has the advantage that it is accessible to any DBA that uses RMAN, regardless of which machine RMAN is executed on.

1 建立/替換指令碼

CREATE SCRIPT. b_whole

{

BACKUP DATABASE PLUS ARCHIVELOG;

DELETE OBSOLETE;

}

 

REPLACE SCRIPT. b_whole

{

BACKUP DATABASE PLUS ARCHIVELOG;

DELETE OBSOLETE;

}

 

2 執行指令碼

run { execute script. b_whole;}

 

3 Deleting Stored Scripts

DELETE SCRIPT. 'b_whole';

6 只能在配置了Catalog環境下使用的命令

The following commands are only available when you use a recovery catalog:

CREATE CATALOG, UPGRADE CATALOG, DROP CATALOG

CREATE SCRIPT, DELETE SCRIPT, REPLACE SCRIPT, PRINT SCRIPT

LIST INCARNATION

REGISTER DATABASE

REPORT SCHEMA AT TIME

RESET DATABASE

RESYNC CATALOG

 

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

相關文章