Oracle 12c 新特性 --- Oracle Data Guard Broker DGMGRL接口 支持塊比較

概念

The new database comparison tool, introduced in this release, is also supported by Oracle Data Guard broker. The PL/SQL package that compares blocks across primary and standby databases can also be executed from the Oracle Data Guard broker DGMGRL command-line interface.
這個版本中引入的新的數據庫比較工具也由Oracle Data Guard broker支持。在主數據庫和備用數據庫中比較塊的PL/SQL包也可以從Oracle數據保護代理DGMGRL命令行界面執行。
This support enables database administrators, who use the standard interface to Oracle Data Guard (DGMGRL) in their broker configurations, to perform block comparisons between the primary database and any physical standby database.
這種支持使數據庫管理員能夠在代理配置中使用標準接口到Oracle Data Guard(DGMGRL),從而在主數據庫和任何物理備用數據庫之間執行塊比較。

The Data Guard Broker is enhanced to take advantage of this feature too. The new command VALIDATE DATABASE DATAFILE, provides the same feature as the DBCOMP procedure. Just like the DBCOMP procedure, we can validate the database at the datafile level or at the database level. Below are options for the VALIDATE DATABASE DATAFILE command with the Data Guard Broker:
數據保護代理這一特性。新的命令驗證數據庫DATAFILE,提供與DBCOMP過程相同的特性。就像DBCOMP過程一樣,我們可以在datafile級別或數據庫級別驗證數據庫。以下是與數據保護代理的驗證數據庫DATAFILE命令的選項:

語法:
VALIDATE DATABASE [database-name | ALL] DATAFILE [datafile-name | datafilenumber | ALL] OUTPUT="output-file-name";

 

命令行參數

database-name

The name of the database for which you want to display information. The VERBOSE keyword, if used, must come before the database-name or an error is returned.
If the database to be validated is either the primary or ALL, then the data files for all standby databases are compared with data files of the primary.
If the database to be validated is a standby database, then its data files are compared with the data files of the primary.
datafile-name | datafile-number
You can specify a data file to be compared by name (datafile-name) or by number (datafile-number). 
The datafile-name is the name of a specific date file that you want validated.
The datafile-number is the file identification number of a data file (as shown in the FILE# column of the V$DATAFILE view).
output-file-name
A file generated on the server that you must check to determine if block comparison is completed and whether there were any lost writes. Output files are created in the diagnostics trace directory of the database being compared.
The output file is generated in the trace directory. Similar to the DBCOMP procedure, we can specify the datafile name, datafile number or the ALL option for all the database files. Below is an usage example:
輸出文件在跟蹤目錄中生成。與DBCOMP過程類似,我們可以指定datafile名稱、datafile號或所有數據庫文件的所有選項。

VALIDATE DATABASE命令顯示數據庫的簡要摘要,並報告檢測到的任何錯誤或警告。
當驗證數據庫命令發出時,它會立即返回一個消息,數據文件比較已經從數據庫開始,但這並不意味着數據文件比較已經完成,也不意味着數據文件之間不存在丟失。您必須檢查生成的輸出文件,以確定是否完成了數據文件比較,或者是否丟失了寫入。

 

實驗

1)下面的命令比較備庫的數據文件和主庫的數據文件 ,並將比較信息輸出到BlockCompareFULL_prod.out的文件
[[email protected] u01]$ dgmgrl sys/oracle@cndba
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 16 13:54:32 2017

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "pdbcndba_p"
Connected as SYSDBA.
DGMGRL> VALIDATE DATABASE pdbcndba_p DATAFILE ALL OUTPUT=BlockCompareFULL_prod.out;
Operation requires a connection to database "pdbcndba_p"
Connecting ...
Connected to "pdbcndba_p"
Output files are created in /u01/app/oracle/diag/rdbms/pdbcndba_p/cndba/trace on host "www.cndba.cn"

[[email protected] trace]$ ll
total 13616
-rw-r-----. 1 oracle oinstall  406383 Aug 16 13:42 alert_cndba.log
-rw-r-----. 1 oracle oinstall    3842 Aug 16 13:59 blockcomparefull_prod.out
-rw-r--r--. 1 oracle oinstall    2394 Aug 16 13:55 blockcomparefull_prod.out_pdbcndba_s_1
-rw-r--r--. 1 oracle oinstall    2326 Aug 16 13:56 blockcomparefull_prod.out_pdbcndba_s_10
-rw-r--r--. 1 oracle oinstall    6430 Aug 16 13:56 blockcomparefull_prod.out_pdbcndba_s_11
-rw-r--r--. 1 oracle oinstall    1623 Aug 16 13:57 blockcomparefull_prod.out_pdbcndba_s_12
-rw-r--r--. 1 oracle oinstall    2394 Aug 16 13:55 blockcomparefull_prod.out_pdbcndba_s_3
-rw-r--r--. 1 oracle oinstall    2327 Aug 16 13:57 blockcomparefull_prod.out_pdbcndba_s_37
-rw-r--r--. 1 oracle oinstall    2327 Aug 16 13:57 blockcomparefull_prod.out_pdbcndba_s_38
-rw-r--r--. 1 oracle oinstall    1782 Aug 16 13:57 blockcomparefull_prod.out_pdbcndba_s_39
-rw-r--r--. 1 oracle oinstall   38634 Aug 16 13:55 blockcomparefull_prod.out_pdbcndba_s_4
-rw-r--r--. 1 oracle oinstall    2327 Aug 16 13:57 blockcomparefull_prod.out_pdbcndba_s_40
-rw-r--r--. 1 oracle oinstall    2327 Aug 16 13:58 blockcomparefull_prod.out_pdbcndba_s_41
-rw-r--r--. 1 oracle oinstall    1782 Aug 16 13:58 blockcomparefull_prod.out_pdbcndba_s_42
-rw-r--r--. 1 oracle oinstall     177 Aug 16 13:58 blockcomparefull_prod.out_pdbcndba_s_43
-rw-r--r--. 1 oracle oinstall     177 Aug 16 13:58 blockcomparefull_prod.out_pdbcndba_s_44
-rw-r--r--. 1 oracle oinstall     177 Aug 16 13:58 blockcomparefull_prod.out_pdbcndba_s_45
-rw-r--r--. 1 oracle oinstall    2324 Aug 16 13:55 blockcomparefull_prod.out_pdbcndba_s_5
-rw-r--r--. 1 oracle oinstall    2327 Aug 16 13:58 blockcomparefull_prod.out_pdbcndba_s_55
-rw-r--r--. 1 oracle oinstall    2327 Aug 16 13:59 blockcomparefull_prod.out_pdbcndba_s_56
-rw-r--r--. 1 oracle oinstall    1782 Aug 16 13:59 blockcomparefull_prod.out_pdbcndba_s_57
-rw-r--r--. 1 oracle oinstall    2324 Aug 16 13:56 blockcomparefull_prod.out_pdbcndba_s_6
-rw-r--r--. 1 oracle oinstall    1613 Aug 16 13:56 blockcomparefull_prod.out_pdbcndba_s_7
-rw-r--r--. 1 oracle oinstall    1779 Aug 16 13:56 blockcomparefull_prod.out_pdbcndba_s_8
-rw-r--r--. 1 oracle oinstall    2532 Aug 16 13:56 blockcomparefull_prod.out_pdbcndba_s_9
2)展示其中數據文件40 的輸出信息
[[email protected] trace]$ cat blockcomparefull_prod.out_pdbcndba_s_40
Client is connected to database pdbcndba_p, the role is primary database.
Remote database is pdbcndba_s, the role is physical standby

Datafile No: 40 /u01/app/oracle/oradata/cndba/pdbcndba3/system01.dbf
 
*******************************************************************************
                       TOTAL: total no. of blocks found
                         |
   +--------+------------+-------+---------+---------+
   |        |                    |         |         |
   |      DIFFV:             LOST_WRITE    |       CORR: corrupted blocks
 SAMEV     diff ver              |       SKIPPED:
   |       block pairs        +--+--+      direct load, empty blocks,
+--+--+--+                    |     |      RMAN optimized blocks,
|  |  |  |                    |     |      flashback optimized blocks
|  |  | SAMEV&C:              |     |
|  |  |  same ver &           |   LWLOC: lost writes at local db
|  |  |  same checksum &     LWRMT: lost writes at remote db
|  |  |  same contents
|  |  |
|  | SAMEV_NO_CHKSUM: same ver & same contents but diff checksum
|  |                  (checksum can be diff but identical contents)
|  |
| DIFFPAIR: same ver but differrent contents (data inconsistency)
|
ENCERR: undecided block pairs due to encryption related issue
        (e.g. when Wallet is not open)


ID TOTAL   CORR SKIPPED DIFFV   SAMEV   SAMEV&C ENCERR  LWLOC  LWRMT DIFFPAIR
00 0007344 0000 0007344 0000000 0000000 0000000 0000000 000000 000000 0000000
02 0000023 0000 0000000 0000000 0000023 0000023 0000000 000000 000000 0000000
06 0023291 0000 0000165 0000000 0023126 0023126 0000000 000000 000000 0000000
14 0000001 0000 0000000 0000000 0000001 0000001 0000000 000000 000000 0000000
16 0000736 0000 0000000 0000000 0000736 0000736 0000000 000000 000000 0000000
23 0000045 0000 0000000 0000000 0000045 0000045 0000000 000000 000000 0000000
25 0000045 0000 0000000 0000000 0000045 0000045 0000000 000000 000000 0000000
26 0000003 0000 0000000 0000000 0000003 0000003 0000000 000000 000000 0000000
27 0000352 0000 0000000 0000000 0000352 0000352 0000000 000000 000000 0000000
29 0000001 0000 0000000 0000000 0000001 0000001 0000000 000000 000000 0000000
30 0000125 0000 0000000 0000000 0000125 0000125 0000000 000000 000000 0000000
70 0000032 0000 0000032 0000000 0000000 0000000 0000000 000000 000000 0000000

參考文檔:

http://docs.oracle.com/database/122/NEWFT/new-features.htm#NEWFT-GUID-A6211BAC-0534-44B9-B988-A7CC2B97044F

http://docs.oracle.com/database/122/DGBKR/oracle-data-guard-broker-commands.htm#DGBKR3877

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章