Home Database Mysql Tutorial Oracle日常巡检

Oracle日常巡检

Jun 07, 2016 pm 05:39 PM
oracle Inspection daily

所有企业的业务数据库系统都是重中之重,如何来保证系统安全性与稳定性,需要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 of this Website
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

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How long will Oracle database logs be kept? How long will Oracle database logs be kept? May 10, 2024 am 03:27 AM

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

Function to calculate the number of days between two dates in oracle Function to calculate the number of days between two dates in oracle May 08, 2024 pm 07:45 PM

The function in Oracle to calculate the number of days between two dates is DATEDIFF(). The specific usage is as follows: Specify the time interval unit: interval (such as day, month, year) Specify two date values: date1 and date2DATEDIFF(interval, date1, date2) Return the difference in days

The order of the oracle database startup steps is The order of the oracle database startup steps is May 10, 2024 am 01:48 AM

The Oracle database startup sequence is: 1. Check the preconditions; 2. Start the listener; 3. Start the database instance; 4. Wait for the database to open; 5. Connect to the database; 6. Verify the database status; 7. Enable the service (if necessary ); 8. Test the connection.

How much memory does oracle require? How much memory does oracle require? May 10, 2024 am 04:12 AM

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

How to use interval in oracle How to use interval in oracle May 08, 2024 pm 07:54 PM

The INTERVAL data type in Oracle is used to represent time intervals. The syntax is INTERVAL <precision> <unit>. You can use addition, subtraction, multiplication and division operations to operate INTERVAL, which is suitable for scenarios such as storing time data and calculating date differences.

How to see the number of occurrences of a certain character in Oracle How to see the number of occurrences of a certain character in Oracle May 09, 2024 pm 09:33 PM

To find the number of occurrences of a character in Oracle, perform the following steps: Get the total length of a string; Get the length of the substring in which a character occurs; Count the number of occurrences of a character by subtracting the substring length from the total length.

How to replace string in oracle How to replace string in oracle May 08, 2024 pm 07:24 PM

The method of replacing strings in Oracle is to use the REPLACE function. The syntax of this function is: REPLACE(string, search_string, replace_string). Usage steps: 1. Identify the substring to be replaced; 2. Determine the new string to replace the substring; 3. Use the REPLACE function to replace. Advanced usage includes: multiple replacements, case sensitivity, special character replacement, etc.

Oracle database server hardware configuration requirements Oracle database server hardware configuration requirements May 10, 2024 am 04:00 AM

Oracle database server hardware configuration requirements: Processor: multi-core, with a main frequency of at least 2.5 GHz. For large databases, 32 cores or more are recommended. Memory: At least 8GB for small databases, 16-64GB for medium sizes, up to 512GB or more for large databases or heavy workloads. Storage: SSD or NVMe disks, RAID arrays for redundancy and performance. Network: High-speed network (10GbE or higher), dedicated network card, low-latency network. Others: Stable power supply, redundant components, compatible operating system and software, heat dissipation and cooling system.

See all articles