Oracle 11.2.0.4.0 Dataguard部署和日常维护(3)-Datauard监控篇
1. v$database 查看当前数据库的角色和保护模式
- primary库查看
column NAME format a10
column PROTECTION_MODE format a20
column PROTECTION_LEVEL format a20
column DATABASE_ROLE format a20
select NAME,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE from v$database; NAME PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE
---------- -------------------- -------------------- --------------------
USERDATA MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PRIMARY
- standby库查看
column NAME format a10
column PROTECTION_MODE format a20
column PROTECTION_LEVEL format a20
column DATABASE_ROLE format a20
select NAME,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE from v$database; NAME PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE
---------- -------------------- -------------------- --------------------
USERDATA MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
2. v$archive_dest 对于当前实例,显示Data Guard配置中的所有目标,包括每个目标的当前值,模式和状态.
- primay库查看
column DEST_ID format 99
column DEST_NAME format a20
column STATUS format a10
column TARGET format a10
column ARCHIVER format a10
column SCHEDULE format a10
column DESTINATION format a30
column LOG_SEQUENCE format 999999
column PROCESS format a10
column TRANSMIT_MODE format a15
column VALID_TYPE format a15
column DB_UNIQUE_NAME format a15
select DEST_ID,DEST_NAME,STATUS,TARGET,ARCHIVER,SCHEDULE,DESTINATION,LOG_SEQUENCE,PROCESS,TRANSMIT_MODE,VALID_TYPE,DB_UNIQUE_NAME from v$archive_dest where dest_id in (1,2);
DEST_ID DEST_NAME STATUS TARGET ARCHIVER SCHEDULE DESTINATION LOG_SEQUENCE PROCESS TRANSMIT_MODE VALID_TYPE DB_UNIQUE_NAME
------- -------------------- ---------- ---------- ---------- ---------- ------------------------------ ------------ ---------- --------------- --------------- ---------------
1 LOG_ARCHIVE_DEST_1 VALID PRIMARY ARCH ACTIVE /u01/app/oracle/arch 13 ARCH SYNCHRONOUS ALL_LOGFILES NONE
2 LOG_ARCHIVE_DEST_2 VALID STANDBY LGWR ACTIVE userdata2 14 LGWR ASYNCHRONOUS ONLINE_LOGFILE userdata2
- standby库查看
column DEST_ID format 99
column DEST_NAME format a20
column STATUS format a10
column TARGET format a10
column ARCHIVER format a10
column SCHEDULE format a10
column DESTINATION format a30
column LOG_SEQUENCE format 999999
column PROCESS format a10
column TRANSMIT_MODE format a15
column VALID_TYPE format a15
column DB_UNIQUE_NAME format a15
select DEST_ID,DEST_NAME,STATUS,TARGET,ARCHIVER,SCHEDULE,DESTINATION,LOG_SEQUENCE,PROCESS,TRANSMIT_MODE,VALID_TYPE,DB_UNIQUE_NAME from v$archive_dest where dest_id in (1,2); DEST_ID DEST_NAME STATUS TARGET ARCHIVER SCHEDULE DESTINATION LOG_SEQUENCE PROCESS TRANSMIT_MODE VALID_TYPE DB_UNIQUE_NAME
------- -------------------- ---------- ---------- ---------- ---------- ------------------------------ ------------ ---------- --------------- --------------- ---------------
1 LOG_ARCHIVE_DEST_1 VALID LOCAL ARCH ACTIVE /u01/app/oracle/arch 13 ARCH SYNCHRONOUS ALL_LOGFILES NONE
2 LOG_ARCHIVE_DEST_2 VALID REMOTE LGWR PENDING userdata1 0 LGWR ASYNCHRONOUS ONLINE_LOGFILE userdata1
3. v$archive_dest_status 显示归档重做日志目标的运行环境和配置信息,此视图中的信息不会在实例关闭时持续存在
- primay库查看
column DEST_NAME format a20
column STATUS format a10
column TYPE format a10
column DATABASE_MODE format a18
column RECOVERY_MODE format a25
column DESTINATION format a20
column STANDBY_LOGFILE_COUNT format 999999
column STANDBY_LOGFILE_ACTIVE format 999999
column ARCHIVED_SEQ# format 9999999
column APPLIED_SEQ# format 999999
column DB_UNIQUE_NAME format a15
column GAP_STATUS format a10
select DEST_NAME,STATUS,TYPE,DATABASE_MODE,RECOVERY_MODE,DESTINATION,STANDBY_LOGFILE_COUNT,STANDBY_LOGFILE_ACTIVE,ARCHIVED_SEQ#,APPLIED_SEQ#,GAP_STATUS from v$archive_dest_status where DEST_ID in(1,2); DEST_NAME STATUS TYPE DATABASE_MODE RECOVERY_MODE DESTINATION STANDBY_LOGFILE_COUNT STANDBY_LOGFILE_ACTIVE ARCHIVED_SEQ# APPLIED_SEQ# GAP_STATUS
-------------------- ---------- ---------- ------------------ ------------------------- -------------------- --------------------- ---------------------- ------------- ------------ ----------
LOG_ARCHIVE_DEST_1 VALID LOCAL OPEN IDLE /u01/app/oracle/arch 0 0 13 0
LOG_ARCHIVE_DEST_2 VALID PHYSICAL MOUNTED-STANDBY MANAGED REAL TIME APPLY userdata2 4 1 13 12 NO GAP
- standby库查看
column DEST_NAME format a20
column STATUS format a10
column TYPE format a10
column DATABASE_MODE format a18
column RECOVERY_MODE format a25
column DESTINATION format a20
column STANDBY_LOGFILE_COUNT format 999999
column STANDBY_LOGFILE_ACTIVE format 999999
column ARCHIVED_SEQ# format 9999999
column APPLIED_SEQ# format 999999
column DB_UNIQUE_NAME format a15
column GAP_STATUS format a10
select DEST_NAME,STATUS,TYPE,DATABASE_MODE,RECOVERY_MODE,DESTINATION,STANDBY_LOGFILE_COUNT,STANDBY_LOGFILE_ACTIVE,ARCHIVED_SEQ#,APPLIED_SEQ#,GAP_STATUS from v$archive_dest_status where DEST_ID in(1,2); DEST_NAME STATUS TYPE DATABASE_MODE RECOVERY_MODE DESTINATION STANDBY_LOGFILE_COUNT STANDBY_LOGFILE_ACTIVE ARCHIVED_SEQ# APPLIED_SEQ# GAP_STATUS
-------------------- ---------- ---------- ------------------ ------------------------- -------------------- --------------------- ---------------------- ------------- ------------ ----------
LOG_ARCHIVE_DEST_1 VALID LOCAL MOUNTED-STANDBY MANAGED REAL TIME APPLY /u01/app/oracle/arch 0 0 13 0
LOG_ARCHIVE_DEST_2 VALID UNKNOWN UNKNOWN IDLE userdata1 0 0 0 0
4. v$archived_log 从控制文件显示归档日志信息,包括归档日志名称。 在联机重做日志成功归档或清除之后插入存档日志记录(如果日志被清除,则名称列为NULL)。 如果日志被存档两次,将存在两个具有相同THREAD#,SEQUENCE#和FIRST_CHANGE#的归档日志记录,但使用不同的名称。 当从备份集或副本还原归档日志并且每当使用RMAN COPY命令创建日志的副本时,还会插入存档日志记录。
- primary库查看
column name format a60
select DEST_ID,NAME,SEQUENCE#,ARCHIVED,APPLIED,FIRST_CHANGE#,NEXT_CHANGE# from v$archived_log order by SEQUENCE#; DEST_ID NAME SEQUENCE# ARCHIVED APPLIED FIRST_CHANGE# NEXT_CHANGE#
------- ------------------------------------------------------------ ---------- --------- --------------------------- ------------- ------------
1 /u01/app/oracle/arch/1_4_947274260.dbf 4 YES NO 990659 998756
1 /u01/app/oracle/arch/1_5_947274260.dbf 5 YES NO 998756 999037
1 /u01/app/oracle/arch/1_6_947274260.dbf 6 YES NO 999037 1078164
1 /u01/app/oracle/arch/1_7_947274260.dbf 7 YES NO 1078164 1078294
1 /u01/app/oracle/arch/1_8_947274260.dbf 8 YES NO 1078294 1082109
2 userdata2 8 YES YES 1078294 1082109
2 userdata2 9 YES YES 1082109 1092150
1 /u01/app/oracle/arch/1_9_947274260.dbf 9 YES NO 1082109 1092150
1 /u01/app/oracle/arch/1_10_947274260.dbf 10 YES NO 1092150 1092157
2 userdata2 10 YES YES 1092150 1092157
2 userdata2 11 YES YES 1092157 1092306
1 /u01/app/oracle/arch/1_11_947274260.dbf 11 YES NO 1092157 1092306
2 userdata2 12 YES YES 1092306 1177894
1 /u01/app/oracle/arch/1_12_947274260.dbf 12 YES NO 1092306 1177894
2 userdata2 13 YES NO 1177894 1237022
1 /u01/app/oracle/arch/1_13_947274260.dbf 13 YES NO 1177894 1237022 16 rows selected.
- standby库查看
column name format a60
select DEST_ID,NAME,SEQUENCE#,ARCHIVED,APPLIED,FIRST_CHANGE#,NEXT_CHANGE# from v$archived_log order by SEQUENCE#; DEST_ID NAME SEQUENCE# ARCHIVED APPLIED FIRST_CHANGE# NEXT_CHANGE#
------- -------------------------------------------------- ---------- --------- --------------------------- ------------- ------------
1 /u01/app/oracle/arch/1_7_947274260.dbf 7 YES YES 1078164 1078294
2 /u01/app/oracle/arch/1_8_947274260.dbf 8 YES YES 1078294 1082109
2 /u01/app/oracle/arch/1_9_947274260.dbf 9 YES YES 1082109 1092150
1 /u01/app/oracle/arch/1_10_947274260.dbf 10 YES YES 1092150 1092157
1 /u01/app/oracle/arch/1_11_947274260.dbf 11 YES YES 1092157 1092306
1 /u01/app/oracle/arch/1_12_947274260.dbf 12 YES YES 1092306 1177894
1 /u01/app/oracle/arch/1_13_947274260.dbf 13 YES IN-MEMORY 1177894 1237022
5. v$log 显示控制文件中的日志文件信息
- primay库查看
column STATUS format a10
column NEXT_CHANGE# format 9999999999999999999999
select * from v$log order by GROUP#; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --------- ---------- ------------- ------------------- ----------------------- -------------------
1 1 13 104857600 512 1 YES INACTIVE 1177894 2017-06-24 05:06:02 1237022 2017-06-24 18:09:11
2 1 14 104857600 512 1 NO CURRENT 1237022 2017-06-24 18:09:11 281474976710655
3 1 12 104857600 512 1 YES INACTIVE 1092306 2017-06-23 08:01:31 1177894 2017-06-24 05:06:02
- standby库查看
select * from v$log order by GROUP#; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --------- ---------- ------------- ------------------- ------------ -------------------
1 1 13 104857600 512 1 YES CLEARING 1177894 2017-06-24 05:06:02 1237022 2017-06-24 18:09:11
2 1 14 104857600 512 1 YES CURRENT 1237022 2017-06-24 18:09:11 1092306 2017-06-23 08:01:31
3 1 12 104857600 512 1 YES CLEARING 1092306 2017-06-23 08:01:31 1177894 2017-06-24 05:06:02
6. v$managered_standby 显示与Data Guard环境中的物理备用数据库相关的某些Oracle数据库进程的当前状态信息。 实例关闭后,此视图不会持续。
- primary库查看
select process,pid,status,thread#,sequence#,block#,blocks from v$managed_standby; PROCESS PID STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
--------------------- ------ ---------- ------------------------------------ ---------- ---------- ----------
ARCH 3149 CLOSING 1 13 176128 122
ARCH 3153 CLOSING 1 7 1 143
ARCH 3157 CONNECTED 0 0 0 0
ARCH 3161 CLOSING 1 12 161792 1250
LNS 3165 WRITING 1 14 136743 1
- standby库查看
select process,pid,status,thread#,sequence#,block#,blocks from v$managed_standby; PROCESS PID STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
---------- ---------- -------------------- ---------- ---------- ---------- ----------
ARCH 22035 CLOSING 1 11 2048 350
ARCH 22039 CLOSING 1 13 176128 122
ARCH 22043 CONNECTED 0 0 0 0
ARCH 22047 CLOSING 1 12 161792 1250
RFS 22100 IDLE 0 0 0 0
RFS 22082 IDLE 1 14 137051 1
RFS 22086 IDLE 0 0 0 0
MRP0 28028 APPLYING_LOG 1 14 137051 204800
7. v$dataguard_stats 显示主数据库生成的重做数据在备用数据库上尚不可用,显示如果主数据库在查询此视图时崩溃,可能会丢失多少重做数据。 您可以在Data Guard配置中的备用数据库的任何实例上查询此视图。 如果在主数据库上查询此视图,则列值将被清除。
- standby库查看
select * from v$dataguard_stats; NAME VALUE UNIT TIME_COMPUTED DATUM_TIME
------------------------- -------------------- ------------------------------ -------------------- --------------------
transport lag +00 00:00:00 day(2) to second(0) interval 06/25/2017 07:03:30 06/25/2017 07:03:29
apply lag +00 00:00:00 day(2) to second(0) interval 06/25/2017 07:03:30 06/25/2017 07:03:29
apply finish time +00 00:00:00.000 day(2) to second(3) interval 06/25/2017 07:03:30
estimated startup time 12 second 06/25/2017 07:03:30
8. v$dataguard_config 显示使用DB_UNIQUE_NAME和LOG_ARCHIVE_CONFIG初始化参数定义的唯一数据库名称,从配置中的任何数据库提供的Data Guard视图都可以看到
- primay/standby库查看
select * from v$dataguard_config; DB_UNIQUE_NAME
------------------------------------------------------------------------------------------
userdata1
userdata2
9. x$logbuf_readhist 记录LNS从redo log buffer里面读取redo数据的历史信息并将其传输到备库端的命中率
- primary库查看
column ADDR format a20
column INDX format 99
column INST_ID format 99
column BUFSIZE format a15
column RDMEMBLKS format a15
column RDDISKBLKS format a15
column HITRATE format 999
column BUFINFO format a30
select * from x$logbuf_readhist; ADDR INDX INST_ID BUFSIZE RDMEMBLKS RDDISKBLKS HITRATE BUFINFO
-------------------- ---- ------- --------------- --------------- --------------- ------- ------------------------------
00007FC98CEAC358 0 1 3592K 470667 25688 94 TARGET-90
00007FC98CEAC358 1 1 4310K 475699 20656 95
00007FC98CEAC358 2 1 5029K 480267 16088 96
00007FC98CEAC358 3 1 5747K 485401 10954 97
00007FC98CEAC358 4 1 6466K 491368 4987 98
00007FC98CEAC358 5 1 7184K 496314 41 99 CURRENT
00007FC98CEAC358 6 1 7902K 496314 41 99
00007FC98CEAC358 7 1 8621K 496314 41 99
00007FC98CEAC358 8 1 9339K 496314 41 99
00007FC98CEAC358 9 1 10058K 496314 41 99
00007FC98CEAC358 10 1 10776K 496314 41 99
00007FC98CEAC358 11 1 11494K 496314 41 99
00007FC98CEAC358 12 1 12213K 496314 41 99
00007FC98CEAC358 13 1 12931K 496314 41 99
00007FC98CEAC358 14 1 13650K 496314 41 99
00007FC98CEAC358 15 1 14368K 496314 41 99
Oracle 11.2.0.4.0 Dataguard部署和日常维护(3)-Datauard监控篇的更多相关文章
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(2)-Datauard部署篇
1. primary库设置dataguard相关参数 1.1. 强制primay库在任何状态下必须记录日志 SYS@userdata>select FORCE_LOGGING from v$ ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(1)-数据库安装篇
本次测试环境 系统版本 CentOS release 6.8 主机名 ec2t-userdata-01 ec2t-userdata-01 IP地址 10.189.102.118 10.189.100. ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(4)-Datauard Gap事件解决篇
Oracle dataguard主库删除备库需要的归档时,会导致gap事情的产生,或者备库由于网络或物理故障原因,倒是备库远远落后于主库,都会产生gap事件,本例模拟gap事件的产生以及处理. 1. ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(5)-Datauard 主备切换和故障转移篇
1. dataguard主备切换 1.1. 查看当前主备库是否具备切换条件 on slave select sequence#,first_time,next_time,archived,appl ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(6)-Active Dataguard篇
1. 检查主备库的状态 on primary column DATABASE_ROLE format a20 column OPEN_MODE format a15 column PROTECTION ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(7) - Dataguard Flashback篇
1. 设置备库的闪回目录 show parameter db_recovery_file; NAME TYPE VALUE ------------------------------------ - ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(6)-Dataguard Snapshot篇
1. 检查当前主备库同步状态 on primary select ads.dest_id,max(sequence#) "Current Sequence", max(log_se ...
- Gitlab 快速部署及日常维护 (二)
一.概述 上一篇我们将Gitlab的安装部署和初始化设置部分全部讲解完成了,接下来我们介绍Gitlab在日常工作中常遇见的问题进行梳理说明. 二.Gitlab的安装和维护过程中常见问题 1.Gitla ...
- Gitlab 快速部署及日常维护 (一)
一.GitLab简介GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务 二.GitLab系统架构git用户的主目录通常是/home/git(~ ...
随机推荐
- python Exception raise
异常是指程序中的例外,违例情况.异常机制是指程序出现错误后,程序的处理方法.当出现错误后,程序的执行流程发生改变,程序的控制权转移到异常处理.Exception类是常用的异常类,该类包括Standar ...
- QT使用QJson生成解析Json数据的方法
QT中使用json还是比较方便的,下面用例子直接说明 举例子之前首先推荐一个在线解析json格式的网站,具体格式用法如下图所示: 之后根据这个格式进行json数据解析. QT使用json需要包含的头文 ...
- 解決 Android Studio 不停 Indexing 的問題(Updating Indices: Indexing paused due to batch update)
遇到這個問題通常是 IDE 更新後,或是反覆使用 Android Studio 開啟其他專案所導致,解決方法其實非常簡單喔! 点击 這個選項的功用是「清除 IDE 暫存並重啟」,沒錯,會出現上述情形的 ...
- JavaSE习题 第七章 常用实用类
问答题 1.怎样实例化一个Calendar对象? Calendar ca=Calendar.getInstance(); 2.Calendar对象调用set(1949,9,1)设置的年月日分别是多少? ...
- JDBC连接数据库的简单介绍
休息10天后重新看了下jdbc,开始振作继续学习(休息10天主要是因为驾照考试太累,2333),希望自己能够调整好心态,继续对程序有着一如既往的喜爱(加油) Connection con=null; ...
- rm
rm [选项]... 目录... 删除指定的<文件>(即解除链接). -d --directory 删除可能仍有数据的目录 (只限超级用户)-f --force ...
- leecode第一百零四题(二叉树的最大深度)
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
- 学习笔记42—Win7下安装Linux双系统
1.下载Linux镜像:http://mirrors.163.com/ubuntu-releases/18.04.1/ 方法一: 1.用软通牒软件将Linux的镜像写入空的优盘中, 具体如下: 1) ...
- python + lisp hy的新手注记1
想在python里用lisp方言hy的目的: 1 用lisp去parse 包含 “数据+简单if控制流(代码.AST)”的配置文件,或者说用包含s-exp的.hy文件作为这类配置文件的实现(而不是用y ...
- MySQL中如何建立主从复制
## 1 概述 ## MySQL内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves) ...