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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/leo__1990/article/details/90057200

概念

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

猜你喜欢

转载自blog.csdn.net/leo__1990/article/details/90057200