2天DBA-5 Managing the Oracle Instance

一、实例和实例管理 Overview of the Oracle Instance and Instance Management

Oracle DataBase SystemdatabaseOracle instance组成。

Database—A database consists of a set of disk files that store user data and metadata. Metadata, or "data about the data," consists of structural, configuration, and control information about the database.

Oracle instanceAn Oracle instance (also known as a database instance) contains the set of Oracle Database background processes that operate on the stored data and the shared allocated memory that those processes use to do their work.

The properties of an Oracle instance are specified using instance initialization parameters. When the instance is started, an initialization parameter file is read, and the instance is configured accordingly.

Accordingly 因而、因此

1、关于初始化参数 About Initialization Parameters

The Oracle instance reads initialization parameters from a file at startup.

修改初始化参数的两种方法:

You can make these changes using the Initialization Parameter page in Oracle Enterprise Manager Database Control (Database Control), or by using one of the advisors provided by Oracle

Database, such as the Memory Advisor. See "Using the Memory Advisors" for more information.

Advisor 以前没接触过,有必要研究一下!

初始化参数读取之后,就retain到了memory里面,有两种文件类型存放参数,使用哪种,取决于是否需要不重启oracle就修改初始化参数。

Server parameter file

The server parameter file is the preferred form of initialization parameter file, and is a binary file that can be written to and read by the database. It must not be edited manually. It is stored on the host computer on which Oracle Database is running. 需要重新启动oracle

Text initialization parameter file

This type of initialization parameter file can be read by the Oracle instance, but it is not written to by the instance. You can change a text initialization parameter file with a text editor, but changes do not take effect until you shut down and restart the Oracle instance

You can change a text initialization parameter file with a text editor, but changes do not take effect until you shut down and restart the Oracle instance.

When you start the instance with this type of file, you can still change many initialization parameters dynamically with Database Control, but only for the current instance. Unless you also edit the text initialization parameter file and make the same change, the change is lost when you shut down and restart the database.

DBCA创建数据库时,会创建 server parameter file

When you create the database with DBCA (as described in "Creating and Managing a Database with DBCA"), a server parameter file is created. This file is then used each time the database is started.

2、关于后台进程 About Background Processes

The background processes of the Oracle instance manage memory structures, asynchrony perform I/O to write data to a file on a disk, and perform general maintenance tasks. The background processes consolidate functions that would otherwise be handled by multiple Oracle Database programs running for each user process. They monitor other Oracle Database processes to provide increased parallelism for better performance and reliability.

Asynchrony异步的

Consolidate巩固

Otherwise 否则,另外,其他的

Parallelism 平行、对应

Reliability 可靠性

>> 最重要的后台进程:

Database writer (DBWn)

The database writer writes modified blocks from the database buffer cache to the files on a disk. Oracle Database allows a maximum of 20 database writer processes.

Log writer (LGWR)

The log writer process writes redo log entries to a disk. Redo log entries are generated in the redo log buffer of the System Global Area (SGA) and the log writer process writes the redo log entries sequentially into an online redo log file

Checkpoint

At specific times, all modified database buffers in the SGA are written to the datafiles by a database writer process (DBWn). This event is called a checkpoint. The checkpoint process signals DBWn, updates the datafiles and control files of the database, and records the time of this update.

System monitor (SMON)

The system monitor performs instance recovery when a failed instance is restarted.

Process monitor (PMON)

The process monitor performs a recovery when a user process fails. It cleans up the cache and frees resources that the failed process was using.

Archiver (ARCn)

Archiver processes copy the redo log files to archival storage when the log files are full or a log switch occurs. The database must be in archive log mode to run archive processes. For more information, see Chapter 9, "Performing Backup and Recovery".

Manageability monitor (MMON)

This process performs various management-related background tasks, for example:

·         Issuing alerts whenever a given metric violates its threshold value

·         Taking snapshots by spawning additional processes

·         Capturing statistical values for SQL objects that have been recently modified

3、关于Server and Client Processes

Server processes 有两种模式:

dedicated server mode each client process has its own server process. Although a dedicated server process is good for long-running queries and administrative tasks, an idle process or too many dedicated processes can result in an inefficient use of resources.

这种模式适合 long-running queries and administrative tasks

shared server mode Using shared server mode eliminates the need for a dedicated server process for each connection. In shared server mode, each client connection request is sent to a dispatcher

Shared server mode is more efficient at supporting multiple client programs making frequent short-running queries.

Dedicated 专注的、献身的

Efficient 生效的、有效率的、能干的

Inefficient 低效的、无能的

4、关于实例的内存结构 About Instance Memory Structure

内存结构的大小影响数据库的性能,由初始化参数控制。

内存结构的大小可以由数据库自动管理、或手动管理,如果选择手动管理,oracle会提供 advisor 帮你决定内存参数的取值,无论哪种方式,oracle都会给发alerts以识别内存大小是否有问题。

System Global AreaSGA)系统全局区

The System Global Area (SGA) is a shared memory area that contains data and control information for the instance. Multiple users can share data within this memory area and avoid repeated, time-consuming access from a physical disk.

SGA由以下几个部分组成:

l        Buffer cache

l        Shared pool

l        Redo log buffer

l        Large pool

l        Java pool

l        Streams pool

l        Result cache

具体的解释,请看原文。

Program Global AreaPGA)程序全局区

A Program Global Area (PGA) is a memory area used by a single Oracle Database server process

PGA用来处理SQL语句(排序)、控制会话信息

The PGA is used to process SQL statements and to hold logon and other session information. A large part of the PGA is dedicated to SQL work areas, which are working memory areas for sorts and other SQL operations.SQL排序)

什么是 instance PGA?

The total memory used by all individual PGAs is known as the total instance PGA memory, and the collection of individual PGAs is referred to as the total instance PGA, or just instance PGA. With Oracle Enterprise Manager Database Control, you set the size of the instance PGA, not individual PGAs.

5、关于实例的启动和停止

About Administration Privileges for Startup and Shutdown

About Instance Startup

About Instance Startup

二、Shutting Down and Starting Up the Oracle Instance

三、Viewing and Modifying Initialization Parameters

四、Managing Memory

五、Instances: Oracle By Example Series

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值