search
HomeDatabaseMysql TutorialOracle 工具后台进程

配置了作业队列:CJQ0进程是作业队列协调器(job queue coordinator).配置了Oracle AQ,从Q000(AQ队列进程,AQ queue process)和QMN

这些后台进程都是可选的,可以根据你的需要来选用。它们提供了一些工具,不过这些工具并不是每天运行数据库所必需要的,除非你自己要使用(如作业队列),

或者你要利用使用了这些工具的特性(如新增加的Oracle 10g诊断功能).

在UNIX中,这些进程可以像其他后台进程一样可见,如果你执行ps命令,就能看到这些进程。在介绍中心后台进程那一节的开始,我列出了ps命令的执行的执行结果

(这里列出其中一部分),可以看到,,我有以下进程:

配置了作业队列:CJQ0进程是作业队列协调器(job queue coordinator).

配置了Oracle AQ,从Q000(AQ队列进程,AQ queue process)和QMNC(AQ 监视器进程,AQ monistor process)可以看出。

启用了自设置SGA大小,由内存管理器(memory manager,MMAN)进程可以看出。

启用了Oracle 10g可管理性/诊断性,由可管理性监视器(manageability monitor,MMON)和可管理性监视器灯(manageability monitor light,MMNL)进程可以看出:

1.CJQ0和Jnnn进程:作业队列

在第一个7.0版本中,Oracle通过一种称为快照(snapshot)的数据库对象来提供复制特性。作业队列就是刷新快照(或将快照置为当前快照)进使用的内部机制。

作业队列进程监视一个作业表,这个作业表告诉它何时需要刷新系统中的各个快照。

作业队列进程监视一个作业表,这个作业表告诉它何时需要刷新系统中的各个快照。在Oracle 7.1中,Oracle公司通过一个名为DBMS_JOB的数据库包提供这个功能。

所以,原告7.0中与快照相关的进程到了7.1及以后版本中变马了"作业队列".后来,控制作业队列行为的参数(检查的频度,以及应该有多少个队列进程)名字也发生了变化

,从SNAPSHOT_REFRESH_INTERVAL和SNAPSHOT_REFRESH_PROCESSES变成了JOB_QUEUE_INTERVAL和JOB_QUEUE_PROCESS。在当前版本中,只有JOB_QUEUE_PROCESS参数的设置是用户可调的。

最多可以有1000个作业队列进程。名字分别是J000,J001,...,J999。这些进程在复制中大量使用,并作为物化视图刷新进程的一部分。基于流的复制使用AQ来完成复制,因此

不使用作业队列进程。开发人员还经常使用作业队列来高度一次性(后台)作来或反复出现的作业,例如,在后台发送一封电子邮件,或者在后台完成一个长时间运行的批处理。

通过在后台做这些工作,就能达到这种一种效果:尽管一个任务耗时很长,但在性急的最终用户看来所花费的时间并不多(他会认为任务运行得快多了,但事实上可能并非如此).

这与Oracle用LGWR和DBWn进程所做的工作类似,他们在后台做大量工作,所以你不必实时地等待它们完成所有任务。

Jnnn进程与共享服务器很相似,但是也有专用服务器中的某些方面。它们处理完一个作业之后再处理下一个作业,从这个意义上讲是共享的,但是它们管理内存的方式更像一个专用服务器(其UGA内存在PGA中,而不是在SGA中).每个作业队列进程一次只运行一个作业,一个接一个地运行,直至完成。正因为如此,如果我们想同时运行多个作业,就需要多个进程。这里不存在多纯种或作来的抢占。一旦运行一个作业,就会一直运行到完成(或失败).

你会注意到,经过一段时间,Jnnn进程会不断地来来去去,也就是说,如果配置了最多1000个Jnnn进程,并不会看到真的有1000进程随便数据库启动。相反,开始时只会启动

一个进程,即作业队列协调器(CJQ0),它在作业队列中看到需要运行的作业时,会启动Jnnn进程。如果Jnnn进程完成其工作,并发现没有要处理的新作业,此时Jnnn进程就会退出,也就是说,会消失。因此,如果将大多数作业都调度为凌晨2:00运行(没有人在场),你可能永远也看不到这些Jnnn进程。

2、QMNC  和 Qnnn:高级队列

QMNC进程对于AQ表来说就相当于CJQ0进程之于作业表。QMNC进程会监视高级队列,并警告从队列中删除等待消息的"出队进程"(dequeuer):已经有一个消息变成可用。QMNC和Qnnn还要负责队列传播(propagation),也就是说,能够将在一个数据库入队(增加)的消息移动另一个数据库的队列中,从而实现出队(dequeueing).

Qnnn 进程对于QMNC进程就相当于Jnnn进程与CJQ0进程的关系。QMNC进程要通知Qnnn进程需要完成什么工作,Qnnn进程则会处理这些工作。

QMNC和Qnnn进程是可选的后台进程。参数AQ_TM_PROCESSES可以指定最多创建10个这样的进程(分别为Q000,。。。,Q008),以及一个QMNC进程。如果AQ——TM_PROCESSES设置为0,就没有QMNC或Qnnn进程。不同于作业队列所用的Jnnn进程,Qnnn进程是持久的。如果将AQ_TM_PROCESSES设置为10,数据库启动时

可以看到10个Qnnn进程和一个QMNC 进程,而且在实例的整个生成期中这些进程都存在。

3.EMNn:事件监视器进程(Event Monitor Process)

EMNn进程是AQ体系结构的一部分,用于通知对某些消息感兴趣的队列订购者。通知会异步地完成。可以用一些Oracle调用接口(Oracle Call Interface,OCI)函数来注册消息通知

的回调。回调是OCI程序中的一个函数,只要队列中有了订购者感谢兴趣的消息,就会自动地调用这个函数。EMNn后台进程用于通知订购者,第一次向实例发出通知时会自启动EMNn进程。然后应用可以发出一个显式的message_receive(dequeue)来获得消息。

4.MMAN:内存管理器(Memory Manager)

这个进程是Oracle 10g中增加的,自动设置SGA大小特性会使用这个进程。MMAN进程用于协调共享内存中各组件(默认缓冲区池,共享池,Java池和大池) 的大小设置和大小调整。

5.MMON,MMNL和Mnnn:可管理性监视器(Manageability Monitor)

这此进程用于填充自动工作负载存储库(Automatic Workload Repository,AWR),这是Oracle 10g中新增的一个特性。MMNL进程会根据调度从SGA将统计结果刷新输出至数据库表。MMON进程用于"自动检测"数据库性能问题,并实现新增的自调整特性.Mnnn进程类似于作业队列的Jnnn和Qnnnn进程:MMON进程会请求这些从属进程代表它完成工作.Mnnn进程本质上是临时性的,它们将根据需要来来去去。

linux

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
When should you use a composite index versus multiple single-column indexes?When should you use a composite index versus multiple single-column indexes?Apr 11, 2025 am 12:06 AM

In database optimization, indexing strategies should be selected according to query requirements: 1. When the query involves multiple columns and the order of conditions is fixed, use composite indexes; 2. When the query involves multiple columns but the order of conditions is not fixed, use multiple single-column indexes. Composite indexes are suitable for optimizing multi-column queries, while single-column indexes are suitable for single-column queries.

How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)Apr 10, 2025 am 09:36 AM

To optimize MySQL slow query, slowquerylog and performance_schema need to be used: 1. Enable slowquerylog and set thresholds to record slow query; 2. Use performance_schema to analyze query execution details, find out performance bottlenecks and optimize.

MySQL and SQL: Essential Skills for DevelopersMySQL and SQL: Essential Skills for DevelopersApr 10, 2025 am 09:30 AM

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

Describe MySQL asynchronous master-slave replication process.Describe MySQL asynchronous master-slave replication process.Apr 10, 2025 am 09:30 AM

MySQL asynchronous master-slave replication enables data synchronization through binlog, improving read performance and high availability. 1) The master server record changes to binlog; 2) The slave server reads binlog through I/O threads; 3) The server SQL thread applies binlog to synchronize data.

MySQL: Simple Concepts for Easy LearningMySQL: Simple Concepts for Easy LearningApr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL: A User-Friendly Introduction to DatabasesMySQL: A User-Friendly Introduction to DatabasesApr 10, 2025 am 09:27 AM

The installation and basic operations of MySQL include: 1. Download and install MySQL, set the root user password; 2. Use SQL commands to create databases and tables, such as CREATEDATABASE and CREATETABLE; 3. Execute CRUD operations, use INSERT, SELECT, UPDATE, DELETE commands; 4. Create indexes and stored procedures to optimize performance and implement complex logic. With these steps, you can build and manage MySQL databases from scratch.

How does the InnoDB Buffer Pool work and why is it crucial for performance?How does the InnoDB Buffer Pool work and why is it crucial for performance?Apr 09, 2025 am 12:12 AM

InnoDBBufferPool improves the performance of MySQL databases by loading data and index pages into memory. 1) The data page is loaded into the BufferPool to reduce disk I/O. 2) Dirty pages are marked and refreshed to disk regularly. 3) LRU algorithm management data page elimination. 4) The read-out mechanism loads the possible data pages in advance.

MySQL: The Ease of Data Management for BeginnersMySQL: The Ease of Data Management for BeginnersApr 09, 2025 am 12:07 AM

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.

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尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use