【DataGuarad】获取standby 库的配置信息的脚本

简介:
从oracle MOS 上获得一个关于获取standby 库的配置信息的脚本
Note 241438.1 Script. to Collect Data Guard Physical Standby Diagnostic Information
set echo off 
set feedback off 
column timecol new_value timestamp 
column spool_extension new_value suffix 
select to_char(sysdate,'Mondd_hhmi') timecol, 
'.out' spool_extension from sys.dual; 
column output new_value dbname 
select value || '_' output 
from v$parameter where name = 'db_name'; 
spool dgdiag_phystby_&&dbname&×tamp&&suffix 
set lines 200 
set pagesize 35 
set trim on 
set trims on 
alter session set nls_date_format = 'MON-DD-YYYY HH24:MI:SS'; 
set feedback on 
select to_char(sysdate) time from dual; 
 
set echo on  
-- 
-- ARCHIVER can be  (STOPPED | STARTED | FAILED) FAILED means that the archiver failed 
-- to archive a -- log last time, but will try again within 5 minutes. LOG_SWITCH_WAIT 
-- The ARCHIVE LOG/CLEAR LOG/CHECKPOINT event log switching is waiting for. Note that  
-- if ALTER SYSTEM SWITCH LOGFILE is hung, but there is room in the current online  
-- redo log, then value is NULL  
column host_name format a20 tru 
column version format a9 tru 
select instance_name,host_name,version,archiver,log_switch_wait from v$instance; 
-- The following select will give us the generic information about how this standby is 
-- setup.  The database_role should be standby as that is what this script. is intended  
-- to be ran on.  If protection_level is different than protection_mode then for some 
-- reason the mode listed in protection_mode experienced a need to downgrade.  Once the 
-- error condition has been corrected the protection_level should match the protection_mode 
-- after the next log switch. 
column ROLE format a7 tru 
select name,platform_id,database_role role,log_mode,
       flashback_on flashback,protection_mode,protection_level  
from v$database;
-- Force logging is not mandatory but is recommended.  Supplemental logging should be enabled 
-- on the standby if a logical standby is in the configuration. During normal  
-- operations it is acceptable for SWITCHOVER_STATUS to be SESSIONS ACTIVE or NOT ALLOWED. 
column force_logging format a13 tru 
column remote_archive format a14 tru 
column dataguard_broker format a16 tru 
select force_logging,remote_archive,supplemental_log_data_pk,supplemental_log_data_ui, 
switchover_status,dataguard_broker from v$database;  
-- This query produces a list of all archive destinations and shows if they are enabled, 
-- what process is servicing that destination, if the destination is local or remote, 
-- and if remote what the current mount ID is. For a physical standby we should have at 
-- least one remote destination that points the primary set but it should be deferred.
COLUMN destination FORMAT A35 WRAP 
column process format a7 
column archiver format a8 
column ID format 99 
select dest_id "ID",destination,status,target, 
archiver,schedule,process,mountid  
from v$archive_dest; 
-- If the protection mode of the standby is set to anything higher than max performance
-- then we need to make sure the remote destination that points to the primary is set
-- with the correct options else we will have issues during switchover.
 
select dest_id,process,transmit_mode,async_blocks, 
net_timeout,delay_mins,reopen_secs,register,binding 
from v$archive_dest; 
 
-- The following select will show any errors that occured the last time an attempt to 
-- archive to the destination was attempted.  If ERROR is blank and status is VALID then 
-- the archive completed correctly. 
column error format a55 tru 
select dest_id,status,error from v$archive_dest;
-- Determine if any error conditions have been reached by querying thev$dataguard_status 
-- view (view only available in 9.2.0 and above): 
column message format a80 
select message, timestamp 
from v$dataguard_status 
where severity in ('Error','Fatal') 
order by timestamp; 
-- The following query is ran to get the status of the SRL's on the standby.  If the
-- primary is archiving with the LGWR process and SRL's are present (in the correct
-- number and size) then we should see a group# active.
select group#,sequence#,bytes,used,archived,status from v$standby_log;
-- The above SRL's should match in number and in size with the ORL's returned below: 
select group#,thread#,sequence#,bytes,archived,status from v$log; 
-- Query v$managed_standby to see the status of processes involved in the 
-- configuration.
select process,status,client_process,sequence#,block#,active_agents,known_agents
from v$managed_standby;
-- Verify that the last sequence# received and the last sequence# applied to standby 
-- database.
select al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied"
from (select thread# thrd, max(sequence#) almax
      from v$archived_log
      where resetlogs_change#=(select resetlogs_change# from v$database)
      group by thread#) al,
     (select thread# thrd, max(sequence#) lhmax
      from v$log_history
      where first_time=(select max(first_time) from v$log_history)
      group by thread#) lh
where al.thrd = lh.thrd;
-- The V$ARCHIVE_GAP fixed view on a physical standby database only returns the next 
-- gap that is currently blocking redo apply from continuing. After resolving the
-- identified gap and starting redo apply, query the V$ARCHIVE_GAP fixed view again 
-- on the physical standby database to determine the next gap sequence, if there is
-- one. 
select * from v$archive_gap; 
-- Non-default init parameters. 
set numwidth 5 
column name format a30 tru 
column value format a50 wra 
select name, value 
from v$parameter 
where isdefault = 'FALSE';
spool off
相关文章
|
9月前
|
缓存 网络协议 Linux
PCIe 以太网芯片 RTL8125B 的 spec 和 Linux driver 分析备忘
本文详细介绍了 Realtek RTL8125B PCIe 以太网芯片的规格以及在 Linux 中的驱动安装和配置方法。通过深入分析驱动源码,可以更好地理解其工作原理和优化方法。在实际应用中,合理配置和优化驱动程序可以显著提升网络性能和稳定性。希望本文能帮助您更好地使用和管理 RTL8125B,以满足各种网络应用需求。
954 33
|
5月前
|
关系型数据库 MySQL
MySQL数据表添加字段(三种方式)
本文解析了数据表的基本概念及字段添加方法。在数据表中,字段是纵向列结构,记录为横向行数据。MySQL通过`ALTER TABLE`指令支持三种字段添加方式:1) 末尾追加字段,直接使用`ADD`语句;2) 首列插入字段,通过`FIRST`关键字实现;3) 指定位置插入字段,利用`AFTER`指定目标字段。文内结合`student`表实例详细演示了每种方法的操作步骤与结构验证,便于理解与实践。
|
域名解析 存储 缓存
在Linux中,DNS进行域名解析的过程是什么?
在Linux中,DNS进行域名解析的过程是什么?
QT项目实战(视频播放器)
QT项目实战(视频播放器)
637 0
|
机器学习/深度学习 人工智能 自然语言处理
注意力机制详解(一)
注意力机制是受人类认知过程启发的一种深度学习技术,它允许模型动态地聚焦于输入的不同部分,根据上下文分配“注意力”。这种机制最早在序列到序列模型中提出,解决了长距离依赖问题,增强了模型理解和处理复杂数据的能力。基本的注意力计算涉及查询(Q)、键(K)和值(V),通过不同方式(如点积、拼接等)计算相关性并应用softmax归一化,得到注意力权重,最后加权组合值向量得到输出。自注意力是注意力机制的一种形式,其中Q、K和V通常是相同的。在自然语言处理(NLP)中,注意力机制广泛应用在Transformer和预训练模型如BERT中,显著提升了模型的表现。
|
SQL 关系型数据库 MySQL
文本----Navicat的快捷键,Navicate如何快速添加资料,选中整体一行,复制,文本排序可以在添加数据时,用一个qingge01简写就行
文本----Navicat的快捷键,Navicate如何快速添加资料,选中整体一行,复制,文本排序可以在添加数据时,用一个qingge01简写就行
|
Linux Docker 容器
Centos安装docker(linux安装docker)——超详细小白可操作手把手教程,包好用!!!
本篇博客重在讲解Centos安装docker,经博主多次在不同服务器上测试,极其的稳定,尤其是阿里的服务器,一路复制命令畅通无阻。
20917 5
Centos安装docker(linux安装docker)——超详细小白可操作手把手教程,包好用!!!
精准记录:使用 Playwright 实现屏幕截图
Playwright是用于自动化浏览器的库,提供简洁的API进行屏幕截图。要截屏,调用`page.screenshot()`方法,指定保存路径。若需全页截图,设置`full_page=True`。还能捕获图片数据流,不写入文件,以及截取特定元素,如`.header`。Playwright的截图功能比Selenium更强大,便于开发和测试人员分析应用界面。
|
JavaScript
Echarts主题构建工具的使用
Echarts主题构建工具的使用
310 0
HLS开发学习-15- HLS优化指令汇总
HLS开发学习-15- HLS优化指令汇总
496 0
HLS开发学习-15- HLS优化指令汇总

热门文章

最新文章