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爬虫训练——正则表达式+BeautifulSoup爬图片
这次练习爬 传送门 这贴吧里的美食图片. 如果通过img标签和class属性的话,用BeautifulSoup能很简单的解决,但是这次用一下正则表达式,我这也是参考了该博主的博文:传送门 所有图片的s ...
- phpstorm软件配置端口问题
phpstorm默认的端口号是:63342 但是我装的apache服务器的默认端口是80 网上查找资料,都说可以加listen的端口,比如这里 #Listen 12.34.56.78:80 Lis ...
- 【BZOJ】1798: [Ahoi2009]Seq 维护序列seq
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1798 大概就是维护两个标记的线段树模板题. 设定优先级,先乘后加(只是相对的),$push ...
- Codeforces 776E The Holmes Children
题目链接:http://codeforces.com/problemset/problem/776/E ${\because gcd(i,n-i)=1\Leftrightarrow gcd(i,n)= ...
- 从RGB扫描图到数字化等高线矢量图
1 用arcgis 对地形图进行校正,主要是通过判断地图的坐标系统,然后将图层的坐标系统设置正确.选择图上的经纬网交点,对原图进行校正,一般要求四角和均匀布点. 2 二值化图像.如果是RGB图像,即彩 ...
- Spark强大的函数扩展功能
在数据分析领域中,没有人能预见所有的数据运算,以至于将它们都内置好,一切准备完好,用户只需要考虑用,万事大吉.扩展性是一个平台的生存之本,一个封闭的平台如何能够拥抱变化?在对数据进行分析时,无论是算法 ...
- openvswitch vlan下的虚拟机与物理机通信
1,安装openvswitch ,图形界面显示等用到的安装包. yum install libvirt openvswitch python-virtinst xauth tigervnc -y 2, ...
- python 爬虫利器 Beautiful Soup
python 爬虫利器 Beautiful Soup Beautiful Soup 是一个可以从HTML或XML文件中提取数据的Python库.它能够通过你喜欢的转换器实现惯用的文档导航,查找,修改文 ...
- 第 7 章 多主机管理 - 045 - 安装 Docker Machine
安装 Docker Machine 先安装docker 官方安装docker-machine的文档地址:https://docs.docker.com/machine/install-machine/ ...
- js插件---bootstrap插件daterangepicker是什么
js插件---bootstrap插件daterangepicker是什么 一.总结 一句话总结:日期段选择插件,也可选择日期 日期段选择插件,也可选择日期 1.daterangepicker 控件如何 ...