1.主库执行
(1)解压
[oracle@oracle11gdg ~]$ unzip DGDiagnostic.zip -d DGDiagnostic1
Archive: DGDiagnostic.zip
inflating: DGDiagnostic1/DGDiagnostic.sh
inflating: DGDiagnostic1/srdc_DGlogicalStby_diag.sql
inflating: DGDiagnostic1/srdc_DGPhyStby_diag.sql
inflating: DGDiagnostic1/srdc_DGPrimary_diag.sql
[oracle@oracle11gdg ~]$ cd DGDiagnostic1
[oracle@oracle11gdg DGDiagnostic1]$ ll
total 76
-rw-r--r-- 1 oracle oinstall 23913 Oct 6 2020 DGDiagnostic.sh
-rw-r--r-- 1 oracle oinstall 14698 Nov 1 2020 srdc_DGlogicalStby_diag.sql
-rw-r--r-- 1 oracle oinstall 12311 Nov 1 2020 srdc_DGPhyStby_diag.sql
-rw-r--r-- 1 oracle oinstall 18892 Nov 1 2020 srdc_DGPrimary_diag.sql
(2)执行脚本
[oracle@oracle11g DGDiagnostic]$ sh DGDiagnostic.sh
... Generating diagnostic output ...
... Collecting more info ...
... Getting tnsping ...
....Copying the alert log (and broker log if broker configured) to current directory ......
....Collecting the applied patch details.....
....Collecting Broker configuration in current directory ...
....Copying the tnsnames.ora to current directory ......
....Gathering the listener details to current directory ......
cat: /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora: No such file or directory
....Preparing the tar of all the files generated ......
Please upload the following file to Oracle support:
/home/oracle/DGDiagnostic/SRDC_PRIMARY_Details_2023.12.04-15.31.58.tar.gz
(3)生成文件如下
[oracle@oracle11g DGDiagnostic]$ ll
total 320
-rw-r----- 1 oracle oinstall 133621 Dec 4 15:32 alert_fermdb_PRIMARY.log
-rw-r--r-- 1 oracle oinstall 508 Dec 4 15:32 dataguard_REDO_transport_check.out
-rw-r--r-- 1 oracle oinstall 1509 Dec 4 15:32 listener_details_PRIMARY.log
-rw-r--r-- 1 oracle oinstall 11978 Dec 4 15:32 lsinventory_fermdb_PRIMARY.log
-rw-r--r-- 1 oracle oinstall 1366 Dec 4 15:32 script-trace.log
-rw-r--r-- 1 oracle oinstall 56137 Dec 4 15:32 SRDC_DG_PRIM_DIAG_FERMDB_20231204_153158.htm
-rw-r--r-- 1 oracle oinstall 24602 Dec 4 15:32 SRDC_PRIMARY_Details_2023.12.04-15.31.58.tar.gz
-rw-r----- 1 oracle oinstall 389 Dec 4 15:32 tnsnames_fermdb_PRIMARY.ora
如下文件是自动打包后的文件:
SRDC_PRIMARY_Details_2023.12.04-15.31.58.tar.gz
解压:
tar xvf SRDC_PRIMARY_Details_2023.12.04-15.31.58.tar.gz
[oracle@oracle11g SRDC_PRIMARY_Details]$ ll
total 216
-rw-r----- 1 oracle oinstall 133621 Dec 4 15:32 alert_fermdb_PRIMARY.log
-rw-r--r-- 1 oracle oinstall 508 Dec 4 15:32 dataguard_REDO_transport_check.out
-rw-r--r-- 1 oracle oinstall 1509 Dec 4 15:32 listener_details_PRIMARY.log
-rw-r--r-- 1 oracle oinstall 11978 Dec 4 15:32 lsinventory_fermdb_PRIMARY.log
-rw-r--r-- 1 oracle oinstall 1366 Dec 4 15:32 script-trace.log
-rw-r--r-- 1 oracle oinstall 56137 Dec 4 15:32 SRDC_DG_PRIM_DIAG_FERMDB_20231204_153158.htm
-rw-r----- 1 oracle oinstall 389 Dec 4 15:32 tnsnames_fermdb_PRIMARY.ora
--最重要的是这个文件,这个是主库的相关信息:
SRDC_DG_PRIM_DIAG_FERMDB_20231204_153158.htm
2.相同的方式 ,从库数据收集
从库执行生成文件:
SRDC_PHYSICAL_Details_2023.12.04-15.49.37.tar.gz
解压后最重要的文件:
[oracle@oracle11gdg SRDC_PHYSICAL_Details]$ ll
total 200
-rw-r----- 1 oracle oinstall 132843 Dec 4 15:49 alert_fermdg_PHYSICAL.log
-rw-r--r-- 1 oracle oinstall 2066 Dec 4 15:49 listener_details_PHYSICAL.log
-rw-r--r-- 1 oracle oinstall 11978 Dec 4 15:49 lsinventory_fermdg_PHYSICAL.log
-rw-r--r-- 1 oracle oinstall 1346 Dec 4 15:49 script-trace.log
-rw-r--r-- 1 oracle oinstall 42177 Dec 4 15:49 SRDC_DG_PHYSTBY_DIAG_FERMDG_20231204_154937.htm
-rw-r----- 1 oracle oinstall 542 Dec 4 15:49 tnsnames_fermdg_PHYSICAL.ora
HTML文件中列出登录从库的日志文件,数据文件,参数等信息,从而可以知道从库的状态。
SRDC_DG_PHYSTBY_DIAG_FERMDG_20231204_154937.htm
3.生成的HTML样例展示
数据库版本信息查看,当前事件戳。
数据库dg状态检查,是否可以切换,保护模式等。
线程,密码文件,数据库对应物查看。
日志查看