search
HomeDatabaseMysql Tutorial Oracle日常巡检

所有企业的业务数据库系统都是重中之重,如何来保证系统安全性与稳定性,需要DBA每日来通过相应的巡检指标进行相关记录,今天我们就来简单说一下OS健康检测将CPU

所有企业的业务数据库系统都是重中之重,如何来保证系统安全性与稳定性,需要DBA每日来通过相应的巡检指标进行相关记录,今天我们就来简单说一下

OS健康检测

将CPU、内存、磁盘I/O状况、网络状况等填到上午高峰期检查情况和下午高峰期检查情况栏里。对于CPU和内存、磁盘IO记录数值,对于网络状况,记录正常或不正常。

检测CPU情况

可以看到,1分钟,5分钟,15分钟的负载都为0,系统很健康的说

检测内存状况

可以看到,内存虽然占用了90%以上,但是SWAP交换分区并没有被占用,所以属于业务正常情况

检测硬盘状况

可以看到,文件系统只用到了不足10%,还有很大的磁盘空间,很健康

通过vmstat命令检测系统

clip_image004

Linux 内存监控vmstat命令输出分成六个部分:(参考资料:)

1、进程procs:

r:在运行队列中等待的进程数 。

b:在等待io的进程数 。

2、Linux 内存监控内存memoy:

swpd:现时可用的交换内存(单位KB)。

free:空闲的内存(单位KB)。

buff: 缓冲去中的内存数(单位:KB)。

cache:被用来做为高速缓存的内存数(单位:KB)。

3、Linux 内存监控swap交换页面

si: 从磁盘交换到内存的交换页数量,单位:KB/秒。

so: 从内存交换到磁盘的交换页数量,单位:KB/秒。

4、Linux 内存监控 io块设备:

bi: 发送到块设备的块数,单位:块/秒。

bo: 从块设备接收到的块数,单位:块/秒。

5、Linux 内存监控system系统:

in: 每秒的中断数,包括时钟中断。

cs: 每秒的环境(上下文)转换次数。

6、Linux 内存监控cpu中央处理器:

cs:用户进程使用的时间。以百分比表示。

sy:系统进程使用的时间。以百分比表示。

id:中央处理器的空闲时间。以百分比表示。

假如r经常大于4,且id经常小于40,表示中央处理器的负荷很重。 假如bi,bo 长期不等于0,表示物理内存容量太小。

通过iostat命令检测系统

clip_image005

比较重要的参数(参考资料: )

%util: 一秒中有百分之多少的时间用于 I/O 操作,或者说一秒中有多少时间 I/O 队列是非空的

svctm: 平均每次设备I/O操作的服务时间

await: 平均每次设备I/O操作的等待时间

avgqu-sz: 平均I/O队列长度

如果%util接近100%,表明i/o请求太多,i/o系统已经满负荷,磁盘可能存在瓶颈,一般%util大于70%,i/o压力就比较大,读取速度有较多的wait.同时可以结合vmstat查看查看b参数(等待资源的进程数)和wa参数(IO等待所占用的CPU时间的百分比,高过30%时IO压力高)。

await 的大小一般取决于服务时间(svctm) 以及 I/O 队列的长度和 I/O 请求的发出模式。如果 svctm 比较接近 await,说明 I/O 几乎没有等待时间;如果 await 远大于 svctm,说明 I/O 队列太长,应用得到的响应时间变慢。

通过sar命令检测系统

clip_image006

sar命令较为复杂,牵扯参数较多,这里就不再详解了

检测Oralce进程

clip_image007

Oracle后台进程是oracle实例的重要组成部分,美国空间,后台进程是否正常工作直接决定了Oracle运行的正常与否。如果Oracle后台进程停止,将导致Oracle实例的崩溃。(最少应该有dbwr、lgwr、smon、pmon、ckpt等几个主要进程)

检测Oracle监听

clip_image008

Oracle监听进程侦听从客户端(如应用服务器)发来的对数据库的连接请求,然后为该请求建立一个连接。如果监听进程关闭,则无法建立起应用服务器与数据库服务器之间的连接。(SID最少应该有一个为READY状态)

检测Oracle死锁

死锁是由于2个session互相交叉阻塞对方而产生的,Oracle会自动探测到死锁并回滚其中的一个事务。死锁一般是由于应用逻辑造成的,发生死锁时,需要将导致死锁的SQL反馈给开发人员,以进一步解决。(也应该时常检测alert日志,看看有没有严重的或者频繁出现的ORA-错误并解决)

Oracle检测

检查Oracle实例状态

正常情况下,Oracle实例状态处于OPEN状态,通过检查此项,可以确定Oracle实例是否正常。

检查Oracle数据库状态

通过查看Oracle数据库状态,可以检查数据库名称、数据库归档模式、数据库打开模式,从而确定数据库是否处于正常的状态。(测试库未开启归档,属于正常)

检查Oracle会话状态

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
oracle怎么查询所有索引oracle怎么查询所有索引May 13, 2022 pm 05:23 PM

方法:1、利用“select*from user_indexes where table_name=表名”语句查询表中索引;2、利用“select*from all_indexes where table_name=表名”语句查询所有索引。

什么是oracle asm什么是oracle asmApr 18, 2022 pm 04:16 PM

oracle asm指的是“自动存储管理”,是一种卷管理器,可自动管理磁盘组并提供有效的数据冗余功能;它是做为单独的Oracle实例实施和部署。asm的优势:1、配置简单、可最大化推动数据库合并的存储资源利用;2、支持BIGFILE文件等。

oracle全角怎么转半角oracle全角怎么转半角May 13, 2022 pm 03:21 PM

在oracle中,可以利用“TO_SINGLE_BYTE(String)”将全角转换为半角;“TO_SINGLE_BYTE”函数可以将参数中所有多字节字符都替换为等价的单字节字符,只有当数据库字符集同时包含多字节和单字节字符的时候有效。

Oracle怎么查询端口号Oracle怎么查询端口号May 13, 2022 am 10:10 AM

在Oracle中,可利用lsnrctl命令查询端口号,该命令是Oracle的监听命令;在启动、关闭或重启oracle监听器之前可使用该命令检查oracle监听器的状态,语法为“lsnrctl status”,结果PORT后的内容就是端口号。

oracle怎么删除sequenceoracle怎么删除sequenceMay 13, 2022 pm 03:35 PM

在oracle中,可以利用“drop sequence sequence名”来删除sequence;sequence是自动增加数字序列的意思,也就是序列号,序列号自动增加不能重置,因此需要利用drop sequence语句来删除序列。

oracle怎么查询数据类型oracle怎么查询数据类型May 13, 2022 pm 04:19 PM

在oracle中,可以利用“select ... From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名');”语句查询数据库表的数据类型。

oracle查询怎么不区分大小写oracle查询怎么不区分大小写May 10, 2022 pm 05:45 PM

方法:1、利用“LOWER(字段值)”将字段转为小写,或者利用“UPPER(字段值)”将字段转为大写;2、利用“REGEXP_LIKE(字符串,正则表达式,'i')”,当参数设置为“i”时,说明进行匹配不区分大小写。

Oracle怎么修改sessionOracle怎么修改sessionMay 13, 2022 pm 05:06 PM

方法:1、利用“alter system set sessions=修改后的数值 scope=spfile”语句修改session参数;2、修改参数之后利用“shutdown immediate – startup”语句重启服务器即可生效。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),