首页 > 数据库 >Oracle集群RAC DG日常检查指令

Oracle集群RAC DG日常检查指令

时间:2023-11-10 11:22:04浏览次数:44  
标签:094456.733 20 RAC DG Oracle 094246.295 00.00 root 0.000

目录

操作系统进程检查

Pmon检查

  • pmon(Process Monitor process)用于监控其他后台进程。负责在连接出现异常中止后进行清理工作。例如,一个专用服务器进程崩溃或者出于某种原因被结束掉,就要由PMON进程负责善后(恢复或者撤销工作),并释放资源。PMON会回滚未提交的工作,释放锁,并释放之前为失败进程分配的SGA资源。
    PMON还负责监视其他Oracle后台进程,并在必要时重启这些后台进程。
  • 因此在操作系统侧,可以首先检查pmon进程
092755.221: [oracle ~ ]$ ps -ef |grep -i pmon
092755.266: oracle   22589 22483  0 09:27 pts/1    00:00:00 grep --color=auto -i pmon
092755.271: grid     41673     1  0 Nov03 ?        00:00:19 asm_pmon_+ASM1
092755.271: oracle   43062     1  0 Nov03 ?        00:00:55 ora_pmon_oracle1

负载检查

[oracle@ ~ ]$ top 
094246.285: top - 09:42:46 up 3 days, 13:45,  2 users,  load average: 0.44, 0.49, 0.60
094246.290: Tasks: 1179 total,   2 running, 1177 sleeping,   0 stopped,   0 zombie
094246.290: %Cpu(s):  2.7 us,  0.6 sy,  0.0 ni, 96.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
094246.290: KiB Mem:  26347395+total, 24792364+used, 15550296 free,  1356312 buffers
094246.290: KiB Swap: 33554428 total,     8960 used, 33545468 free. 71150048 cached Mem
094246.295: 
094246.295:   PID USER      PR  NI    VIRT    RES    SHR S   %CPU  %MEM     TIME+ COMMAND                                                                                                                      
094246.295: 35858 oracle    20   0  0.148t  88408  83244 R 100.00 0.034   0:21.06 oracle_35858_or                                                                                                              
094246.295: 36340 oracle    20   0  0.148t  85412  80980 S 11.111 0.032   0:00.04 oracle_36340_or                                                                                                              
094246.295: 36341 oracle    20   0   16348   3500   2224 R 11.111 0.001   0:00.05 top                                                                                                                          
094246.295: 35766 root      20   0 5509468 156808  31652 S  5.556 0.060  23:24.58 java                                                                                                                         
094246.295: 36338 oracle    20   0  0.148t  85392  80960 S  5.556 0.032   0:00.04 oracle_36338_or                                                                                                              
094246.295:     1 root      20   0  181660   6184   4180 S  0.000 0.002   2:08.17 systemd                                                                                                                      
094246.295:     2 root      20   0       0      0      0 S  0.000 0.000   0:00.12 kthreadd                                                                                                                     
094246.295:     4 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/0:0H                                                                                                                 
094246.295:     6 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 mm_percpu_wq                                                                                                                 
094246.295:     7 root      20   0       0      0      0 S  0.000 0.000   0:13.67 ksoftirqd/0                                                                                                                  
094246.295:     8 root      20   0       0      0      0 S  0.000 0.000   6:47.36 rcu_sched                                                                                                                    
094246.295:     9 root      20   0       0      0      0 S  0.000 0.000   0:00.00 rcu_bh                                                                                                                       
094246.295:    10 root      rt   0       0      0      0 S  0.000 0.000   0:00.00 migration/0                                                                                                                  
094246.295:    11 root      rt   0       0      0      0 S  0.000 0.000   0:00.37 watchdog/0                                                                                                                   
094246.295:    12 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/0                                                                                                                      
094246.295:    13 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/1                                                                                                                      
094246.295:    14 root      rt   0       0      0      0 S  0.000 0.000   0:00.36 watchdog/1                                                                                                                   
094246.295:    15 root      rt   0       0      0      0 S  0.000 0.000   0:00.01 migration/1                                                                                                                  
094246.295:    16 root      20   0       0      0      0 S  0.000 0.000   0:03.20 ksoftirqd/1                                                                                                                  
094246.295:    18 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/1:0H                                                                                                                 
094246.295:    19 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/2                                                                                                                      
094246.295:    20 root      rt   0       0      0      0 S  0.000 0.000   0:00.37 watchdog/2                                                                                                                   
094246.295:    21 root      rt   0       0      0      0 S  0.000 0.000   0:00.01 migration/2                                                                                                                  
094246.300:    22 root      20   0       0      0      0 S  0.000 0.000   0:02.63 ksoftirqd/2                                                                                                                  
094246.300:    24 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/2:0H                                                                                                                 
094246.300:    25 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/3                                                                                                                      
094246.300:    26 root      rt   0       0      0      0 S  0.000 0.000   0:00.38 watchdog/3                                                                                                                   
094246.300:    27 root      rt   0       0      0      0 S  0.000 0.000   0:00.01 migration/3                                                                                                                  
094246.300:    28 root      20   0       0      0      0 S  0.000 0.000   0:01.19 ksoftirqd/3                                                                                                                  
094246.300:    30 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/3:0H                                                                                                                 
094246.320:    31 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/4                                                                                                                      
094246.320:    32 root      rt   0       0      0      0 S  0.000 0.000   0:00.39 watchdog/4                                                                                                                   
094246.320:    33 root      rt   0       0      0      0 S  0.000 0.000   0:00.00 migration/4                                                                                                                  
094246.320:    34 root      20   0       0      0      0 S  0.000 0.000   0:02.01 ksoftirqd/4                                                                                                                  
094246.320:    36 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/4:0H                                                                                                                 
094246.320:    37 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/5                                                                                                                      
094246.320:    38 root      rt   0       0      0      0 S  0.000 0.000   0:00.40 watchdog/5                                                                                                                   
094246.320:    39 root      rt   0       0      0      0 S  0.000 0.000   0:00.00 migration/5                                                                                                                  
094246.320:    40 root      20   0       0      0      0 S  0.000 0.000   0:03.99 ksoftirqd/5                                                                                                                  
094246.320:    42 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/5:0H                                                                                                                 
094246.320:    43 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/6                                                                                                                      
094246.325:    44 root      rt   0       0      0      0 S  0.000 0.000   0:00.39 watchdog/6                                                                                                                   
094246.325:    45 root      rt   0       0      0      0 S  0.000 0.000   0:00.00 migration/6                                                                                                                  
094246.325:    46 root      20   0       0      0      0 S  0.000 0.000   0:02.34 ksoftirqd/6                                                                                                                  
094246.325:    48 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/6:0H                                                                                                                 
094246.325:    49 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/7                                                                                                                      
094246.325:    50 root      rt   0       0      0      0 S  0.000 0.000   0:00.40 watchdog/7                                                                                                                   
094246.325:    51 root      rt   0       0      0      0 S  0.000 0.000   0:00.00 migration/7                                                                                                                  
094246.325:    52 root      20   0       0      0      0 S  0.000 0.000   0:01.66 ksoftirqd/7                                                                                                                  
094246.325:    54 root       0 -20       0      0      0 S  0.000 0.000   0:00.00 kworker/7:0H                                                                                                                 
094246.325:    55 root      20   0       0      0      0 S  0.000 0.000   0:00.00 cpuhp/8                                                                                                                      
094246.325:    56 root      rt   0       0      0      0 S  0.000 0.000   0:00.37 watchdog/8             

数据库检查

查看数据库打开状态和相关信息

  • 确定当前库为主库
093045.590: SQL>  select inst_id,open_mode,database_role from gv$database;
093045.610: 
093045.610:    INST_ID OPEN_MODE            DATABASE_ROLE
093045.610: ---------- -------------------- ----------------
093045.610:          2 READ WRITE           PRIMARY
093045.610:          1 READ WRITE           PRIMARY

查找主库

show parameter config 
show parameter unique (主库唯一名)
show parameter log_archive_config(主库 备库唯一名都能看到,由此确认备库唯一名)

判断集群正常与否

判断会话等待

检查以下会话等待,主要最多的会话等待没有以下几项即可

 SQL> 
094456.693:   1  select inst_id,event,count(*)
094456.693:   2  from gv$session
094456.693:   3  where WAIT_CLASS!='IDLE'
094456.693:   4* group by inst_id,event
094456.698: 
094456.698:    INST_ID EVENT                                                              COUNT(*)
094456.698: ---------- ---------------------------------------------------------------- ----------
094456.698:          2 Space Manager: slave idle wait                                           52
094456.698:          2 gcs yield cpu                                                             3
094456.698:          2 Data Guard: Timer                                                         1
094456.723:          2 GCR sleep                                                                 2
094456.723:          2 wait for unread message on broadcast channel                              3
094456.723:          2 pman timer                                                                1
094456.723:          2 gcs remote message                                                        3
094456.723:          2 REPL Capture/Apply: RAC AQ qmn coordinator                                1
094456.723:          2 lreg timer                                                                1
094456.723:          1 lreg timer                                                                1
094456.723:          2 PX Deq: Execution Msg                                                     1
094456.723:          1 Space Manager: slave idle wait                                           51
094456.723:          1 pmon timer                                                                7
094456.728:          1 VKTM Logical Idle Wait                                                    1
094456.728:          1 DIAG idle wait                                                            2
094456.728:          1 SCM slave idle                                                            1
094456.728:          1 gcs remote message                                                        3
094456.728:          1 heartbeat redo informer                                                   1
094456.728:          1 smon timer                                                                1
094456.728:          2 class slave wait                                                          6
094456.728:          2 VKTM Logical Idle Wait                                                    1
094456.728:          2 Data Guard: Gap Manager                                                   1
094456.728:          2 ges remote message                                                        2
094456.728:          1 OFS idle                                                                  1
094456.728:          1 PING                                                                      1
094456.728:          1 pman timer                                                                1
094456.728:          1 ges remote message                                                        2
094456.728:          1 Streams AQ: qmn coordinator idle wait                                     1
094456.728:          2 LMS CR slave timer                                                        3
094456.733:          2 DIAG idle wait                                                            2
094456.733:          2 PING                                                                      1
094456.733:          2 smon timer                                                                1
094456.733:          1 Streams AQ: waiting for time management or cleanup tasks                  1
094456.733:          1 Data Guard: Timer                                                         1
094456.733:          2 Streams AQ: qmn coordinator idle wait                                     1
094456.733:          1 watchdog main loop                                                        5
094456.733:          1 wait for unread message on broadcast channel                              3
094456.733:          2 ASM cluster membership changes                                            1
094456.733:          2 OFS idle                                                                  1
094456.733:          2 VKRM Idle                                                                 1
094456.733:          2 Streams AQ: waiting for time management or cleanup tasks                  1
094456.733:          1 rdbms ipc message                                                        32
094456.733:          1 ASM background timer                                                      1
094456.733:          1 GCR sleep                                                                 2
094456.733:          1 class slave wait                                                          6
094456.733:          1 Data Guard: Gap Manager                                                   1
094456.733:          2 rdbms ipc message                                                        32
094456.733:          2 pmon timer                                                                7
094456.733:          2 watchdog main loop                                                        5
094456.733:          2 heartbeat redo informer                                                   1
094456.733:          2 AQPC idle                                                                 1
094456.733:          2 SQL*Net message from client                                               6
094456.733:          1 ASM cluster membership changes                                            1
094456.733:          1 LMS CR slave timer                                                        3
094456.733:          1 gcs yield cpu                                                             3
094456.733:          1 VKRM Idle                                                                 1
094456.733:          2 ASM background timer                                                      1
094456.733:          2 SCM slave idle                                                            1
094456.733:          2 Streams AQ: qmn slave idle wait                                           1
094456.733:          1 SQL*Net message from client                                             187
094456.733:          1 Streams AQ: qmn slave idle wait                                           1
094456.733:          1 PX Deq: Execution Msg                                                     1
094456.738:          1 PX Deq: Execute Reply                                                     1
094456.738:          1 AQPC idle                                                                 1
094456.738:          1 REPL Capture/Apply: RAC AQ qmn coordinator                                1
094456.738: 

查看连接数 并与数据库配置对比

select inst_id,status,count(*) from gv$session
group by inst_id,status order by 1,3; 
show parameter process

判断集群和DG状态

RAC

su - grid
crsctl check crs 判断几个核心任务是否online
crsctl stat res -t 查看所有资源是否online
crsctl query css votedisk 看所有投票盘是否在线 
asmcmd lsdg  看freeMB 和 offline disk

DG

select * from gv$dataguard_stats order by inst_id 查看应用时间和传输时间
select process,status form v$managed_standby; 看是否有MRO0进程(该进程负责同步日志)
select database_role,to_char(current_scn) from gv$database; 查看两个库的scn

标签:094456.733,20,RAC,DG,Oracle,094246.295,00.00,root,0.000
From: https://www.cnblogs.com/AllenWongFly/p/17815516.html

相关文章

  • Oracle找出所有表字段中值包含中文并生成扩充字段的SQL脚本
     Oracle找出所有表字段中值包含中文并生成扩充字段的SQL脚本 背景后续计划将Oracle的某个库迁移到云上的达梦库,Oracle字符集为ZHS16GBK,达梦库字符集为UTF-8。我们知道,中文汉字在UTF8中一个汉字占3个字节,而在GBK中则是占2个字节,测试过程发现若字段中存有中文的行,有可能在达......
  • Oracle怎样查看某个表的约束名和约束的字段名、plsql怎样不提交执行的update
    要查看某个表的约束名和约束的字段名,你可以使用以下的SQL查询:SELECTconstraint_name,column_nameFROMuser_cons_columnsWHEREtable_name='YourTableName';在这个查询中,'YourTableName'是你要查询的表名。这条SQL语句将返回指定表的约束名称和对应的字段名。如果你没有......
  • Oracle工具类
    Oracle工具类publicabstractclassDbHelperOra{//数据库连接字符串(web.config来配置),可以动态更改connectionString支持多数据库.publicstaticstringconnectionString=PubConstant.Conn;publicDbHelperOra(){......
  • 百度Uidgenerator
    UidGenerator是Java实现的,提供了两种生成器:DefaultUidGenerator、CachedUidGenerator。如对UID生成性能有要求,请使用CachedUidGenerator,支持缓存生成的id。DefaultUidGenerator的原理是基于Snowflake算法,它使用了时间戳、机器ID和序列号来生成唯一的ID。其中,时间戳用于保证ID......
  • Cisco Packet Tracer and Wireshark
    协议时序图一、客户端:58592;服务器:4431、Src:172.29.70.74,Dst:14.119.104.189客户端生成公、私钥,将公钥放在key_share中发送给服务端。标识符:Identification:0x6a2a(27178)TransmissionControlProtocol,SrcPort:58592,DstPort:443,Seq:1,Ack:1,Len:517......
  • Oracle之控制文件管理
    一、什么是控制文件?  您可以创建、备份和删除控制文件。  每个Oracle数据库都有一个控制文件,它是一个小的二进制文件,记录数据库的物理结构。控制文件内容包括:数据库名称相关的数据文件和重做日志文件的名称和位置数据库创建的时间戳当前日志序列号检查点信息  每当数据库......
  • oraclelinuxJDK安装
    JDK下载Oracle官网从此处点击进入来到Oracle官网,点击Products(产品)找到Java并点击进去点击DownloadJava该按钮往下翻,找到Java8选择Linux系统,找到适合自己系统的安装包,我的是CentOS8x64点击下载,勾选1,点击2 接下来需要登陆Oracle账户才能下载,无账户的可......
  • 数据库(Oracle)序列(Sequence)的基本使用
    1.Sequence定义在Oracle中可以用SEQUENCE生成自增字段。Sequence序列是Oracle中用于生成数字序列的对象,可以创建一个唯一的数字作为主键。2.为什么要用Sequence你可能有疑问为什么要使用序列?不能使用一个存储主键的表并每次递增吗?或者将列设置为AUTOINCREMENT?如果使用一......
  • KubeEdge部署 完美运行 附问题解决方法
    云端部署环境准备一、部署前工作(k8s、docker安装及配置、初始化集群、golang安装、keadm安装)配置网络参数cat>>/etc/hosts<<EOF#GitHubStart52.74.223.119github.com192.30.253.119gist.github.com54.169.195.247api.github.com185.199.111.153assets-cdn.gith......
  • 2023NOIP A层联测26 T4 abstract
    2023NOIPA层联测26T4abstract乱证明求性质的光速幂优化题。思路对于每一个节点,到该节点的子树内的叶子节点的路径中(包括路径上的点),出现的值只有\(k\times(\logV+\logV)\)个。那么在以该点为终点,以子树内节点为起点的路径中,取值只有\(k\times(\logV+\logV)\)。这是......