1## 查看当前数据库实例
2[oracle@oracle11g:/home/oracle/check]$ ps -ef|grep smon
3oracle 28684 1 0 Oct30 ? 00:00:23 ora_smon_lucifer
4## 如果一台主机上有多个实例,可以通过参数 -o 来指定,例如:
5sh oscheck.sh -o orcl,lucifer,test
6## 如果当前主机只有一个数据库实例,并且 ORACLE_SID 环境变量设置正确,则可以不需要指定 -o 参数
7[oracle@oracle11g:/home/oracle/check]$ echo $ORACLE_SID
8lucifer
9## 确保 ORACLE_SID 正确后,执行脚本开始巡检
10[oracle@oracle11g:/home/oracle/check]$ sh oscheck.sh
11
12 ███████ ██ ██ ██ ██ ██ ██ ██████ ██ ██
13 ██░░░░░██ ░██ ░██ ░██ ░██ ░██ ░██ ██░░░░██░██ ░██
14 ██ ░░██ ██████ ██████ █████ ░██ █████ ░██ ░██ █████ ██████ ░██ ██████░██ ██ ░░ ░██ █████ █████ ░██ ██
15░██ ░██░░██░░█ ░░░░░░██ ██░░░██ ░██ ██░░░██░██████████ ██░░░██ ░░░░░░██ ░██░░░██░ ░██████ ░██ ░██████ ██░░░██ ██░░░██░██ ██
16░██ ░██ ░██ ░ ███████ ░██ ░░ ░██░███████░██░░░░░░██░███████ ███████ ░██ ░██ ░██░░░██░██ ░██░░░██░███████░██ ░░ ░████
17░░██ ██ ░██ ██░░░░██ ░██ ██ ░██░██░░░░ ░██ ░██░██░░░░ ██░░░░██ ░██ ░██ ░██ ░██░░██ ██░██ ░██░██░░░░ ░██ ██░██░██
18 ░░███████ ░███ ░░████████░░█████ ███░░██████░██ ░██░░██████░░████████ ███ ░░██ ░██ ░██ ░░██████ ░██ ░██░░██████░░█████ ░██░░██
19 ░░░░░░░ ░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░░ ░░ ░░ ░░░░░░ ░░░░░░░░ ░░░ ░░ ░░ ░░ ░░░░░░ ░░ ░░ ░░░░░░ ░░░░░ ░░ ░░
20
21
22#==============================================================#
23Oracle数据库主机检查
24#==============================================================#
25
26收集主机 OS 层信息 ...
27
28收集数据库补丁信息 ...
29
30收集数据库监听信息 ...
31
32
33#==============================================================#
34检查数据库实例:lucifer
35#==============================================================#
36
37收集数据库 ALERT 日志 ...
38
39收集数据库 AWR 报告 ...
40
41Note1: Information about Instance
42
43 INST_ID DBID NAME DATABASE_ROLE CREATED LOG_MODE OPEN_MODE VERSION SESSIONID
44---------- ---------- ---------- -------------------- -------------------- ------------- -------------------- ---------- --------------------
45 1 4034009431 LUCIFER PRIMARY 2024-08-27 17:16:07 NOARCHIVELOG READ WRITE 11.2.0.4.0 2271,4705,50171
46
47
48Note2: Information about Recyclebin
49
50+------------------------------------------------------------------------------------------------------------+
51| Oracle Database health Check script |
52|------------------------------------------------------------------------------------------------------------+
53| Copyright (c) 2022-2100 lpc. All rights reserved. |
54+------------------------------------------------------------------------------------------------------------+
55
56DBHealthCheck Author: Lucifer
57
58+----------------------------------------------------------------------------+
59Now DBCheck staring, the time cost depending on size of database.
60Begining ......
61+----------------------------------------------------------------------------+
62
63-----Oracle Database Check STRAT, Starting Collect Data Dictionary Information----
64start...Set Environment Variables, Configure html headers.....
65start collect...Database Informaion...
66start collect......Overview of Instance Informaion...
67start collect......Overview of Database Informaion...
68start collect......Database Version Informaion...
69start collect......Database Component and Patch Informaion...
70start collect......Database Parameter Informaion...
71start collect......Database Resource Informaion...
72start collect......Database ControlFile Informaion...
73start collect......Database LogFile Informaion...
74start collect......Archive Log Size in last 10 Days...
75start collect......Invalid Object Informaion...
76start collect......Tablespace Usage Informaion...
77start collect......Top10 Index Informaion...
78start collect......Range Partition Extend Check Informaion...
79start collect......Object in System TableSpace Informaion...
80start collect......BitCoin Attack Check...
81start collect......SYSAUX Objects Informaion...
82start collect......Flashback Database Parameters...
83start...OverView Database User Information...
84start collect......System Manager Role Informaion...
85start collect......Schema Informaion...
86start collect......Profile Informaion...
87start collect......Directory Informaion...
88start collect......Job Informaion...
89start collect......Database Link Informaion...
90start collect......Autotask Informaion...
91start...OverView Database of Backup and Recover Information...
92start collect......Dataguard Parameter...
93start collect......Dataguard Applied Status...
94start collect......Dataguard Status...
95start collect......RMAN Backup Info...
96start collect......Orphaned DataPump Jobs...
97start collect......Instacne Alert Log...
98start...OverView Database of ASM Information...
99start collect......ASM Instance Informaion...
100start collect......ASM Diskgroup Attribute...
101start collect......ASM Disk Group...
102start...OverView Database Performace Information...
103start collect......AWR Configure Informaion...
104start collect......Awrrpt Snap Informaion...
105start collect......Awrrpt Load Profile Informaion...
106start collect......Instance Efficiency Percentages...
107start collect......TOP 10 Wait Event...
108start collect......System Time Model...
109start collect......TOP 10 SQL Order by Elapsed Time...
110start collect......Awrcrt Informaion...
111Database script execution ends....
112
113压缩包位置: /home/oracle/check/dbcheck_oracle11g_20241107.tar.gz