oracle 03-01-2.3 数据库后台进程

[root@localhost ~]# su - oracle
上一次登录:一 5月 11 10:03:38 CST 2020
[oracle@localhost ~]$ ls
perl5
[oracle@localhost ~]$ cd /
[oracle@localhost /]$ . oraenv
ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /u01/app/oracle
[oracle@localhost /]$ sqlplus / as sysdba

 

SQL> show sga

Total System Global Area 2466248392 bytes
Fixed Size 8660680 bytes
Variable Size 536870912 bytes
Database Buffers 1912602624 bytes
Redo Buffers 8114176 bytes
SQL> exti

[oracle@localhost ~]$ sqlplus hr/hr@orcl

 

[oracle@localhost ~]$ ps -ef|grep LOCAL 查看本地进程
oracle 91390 91389 0 10:45 ? 00:00:00 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 106416 1 0 11:31 ? 00:00:00 oracleorcl (LOCAL=NO)
oracle 106510 91566 0 11:31 pts/1 00:00:00 grep --color=auto LOCAL
[oracle@localhost ~]$ ps -ef|grep LOCAL|wc -l  查看本地进程个数
3

 

Process Architecture • User process – Is the application or tool that connects to the Oracle database • Database processes – Server process: Connects to the Oracle instance and is started when a user establishes a session – Background processes: Are started when an Oracle instance is started • Daemon / Application processes – Networking listeners – Grid Infrastructure daemons

 

 

Database Writer Process (DBWn) 数据库写进程

n代表可以有多个进程

Writes modified (dirty) buffers in the database buffer cache to disk:

将灰块dirty写入data files

等待IO后才执行写操作

• Asynchronously while performing other processing
• To advance the checkpoint前进至检查点
Database buffer cache
Database Writer process
Data files

Log Writer Process (LGWR)日志写进程 

• Writes the redo log buffer to a redo log file on disk

LGWR提前写操作

实力失败修复操作
– When a user process commits a transaction
– When an online redo log switch occurs
– When the redo log buffer is one-third full or contains 1 MB of buffered data
– Before a DBWn process writes modified buffers to disk
– When three seconds have passed since the last write
• Serves as coordinator of LGnn processes and ensures
correct order for operations that must be ordered

协调多个子进程

Checkpoint Process (CKPT) 检查点进程

给每一个commit打一个时间戳
• Records checkpoint information in
– Control file
– Each data file header
• Signals DBWn to write blocks to disk

CKPT唤醒的时候才是DBWn真正写数据的时候

数据库关闭是必须运行FULL全检查点

System Monitor Process (SMON) 系统监控进程
• Performs recovery at instance startup 在实例启动时执行恢复(执行实例失败修复操作)
• Cleans up unused temporary segments 释放临时段表空间

Process Monitor Process (PMON) 用户监控进程
• Performs process recovery when a user process fails
– Cleans up the database buffer cache 当用户进程发生失败时由PMON对用户进程所占用的服务器资源进行清空
– Frees resources that are used by the user process
• Monitors sessions for idle session timeout 会话期超时时杀掉进程

Recoverer Process (RECO) 分布式数据库环境中对怀疑事物(两个不一致的数据)进行修复
• Used with the distributed database configuration
• Automatically connects to other databases involved in in-
doubt distributed transactions
• Automatically resolves all in-doubt transactions
• Removes any rows that correspond to in-doubt transactions

Listener Registration Process (LREG) 监听注册进程
Registers information about the database instance and
dispatcher processes with the Oracle Net Listener

Archiver Processes (ARCn) 将在线日志在日志切换的时候拷贝到归档日志
• Copy redo log files to a designated storage device after a log switch has occurred
• Can collect transaction redo data and transmit that data to standby destinations

ps -ef|grep orcl 查看orcl数据库的所有后台进程

 

Database Storage Architecture
Control files 控制文件 .ctl
Data files 数据文件 表、视图、索引 .dbf

Online redo log files 在线日志文件,将内存写入

Parameter file 参数文件

Archived redo log files 归档日志文件 在线日志文件满时写入 .log

Backup files 备份文件

Password file 口令文件

Alert log and trace files 日志和跟踪文件

.trc 跟踪日志文件(可归档清除)

练习

SQL> select name from v$datafile; 查看当前所有数据文件

SQL> select name from v$controfile; 查看控制文件

SQL> select * from v$logfile; 查看在线日志文件

下为如何查看参数文件

[oracle@localhost ORCL]$ cd $ORACLE_HOME/dbs 到ORACLE_HOME中查看参数文件
[oracle@localhost dbs]$ pwd
/u01/app/oracle/product/18c/dbs
[oracle@localhost dbs]$ ls

hc_orcl.dat init.ora lkORCL orapworcl spfileorcl.ora 此为参数文件

[oracle@localhost trace]$ pwd
/u01/app/oracle/diag/rdbms/orcl/orcl/trace 预警日志存储路径
[oracle@localhost trace]$ ls alert*
alert_orcl.log 此为orcl数据库的预警日志文件
[oracle@localhost trace]$

[oracle@localhost trace]$ more alert_orcl.log 打开预警日志文件

[oracle@localhost trace]$ tail -f alert_orcl.log 查询日志文件尾部

原文地址:https://www.cnblogs.com/cloud7777/p/12868727.html