【天哥OCP系列视频】052新题库(2018年)知识点讲解及真题详解 第1讲

052新题库(2018年)知识点讲解及真题详解1(天哥讲解视频)


 

 

 

Exam Objectives:

• 052.1.1 Explain the Memory Structures解释内存结构

• 052.1.2 Describe the Process Structures描述进程结构

• 052.1.3 Identify the Storage Structures识别存储结构

本章知识点:

Single-Instance Architecture单实例体系结构

• An Oracle server isan instance connected to a database. Oracle服务器是指连接到数据库的实例(数据库服务器由数据库和实例组成)。

• An instance is ablock of shared memory and a set of background processes. 实例包括共享内存块(系统全局区的内存结构SGA memory structure)以及一组后台进程。

• A database is a setof files on disk. 数据库是磁盘上的一组文件.

• A user session is auser process connected to a server process. 用户会话是由服务器进程和用户进程连接而成。

Instance Memory Structures实例内存结构

• The instance sharedmemory is the system global area (the SGA). 实例共享内存是系统全局区(SGA) 。

• A session’s privatememory is its program global area (the PGA). 会话的专用区域是程序全局区(PGA)

• The SGA consists of a number ofsubstructures, some of which are required (the database buffer cache, the log buffer,and the shared pool) and some of which are optional (the large pool, the Javapool, and the Streams pool). SGA由一组子结构组成, 其中一些是必需的(数据库缓冲区缓存、日志缓冲区和共享池),而另一些是可选的(大池、Java池和流池) 。

1.数据库缓冲区缓存buffer cache

2.日志缓冲区log buffer

3.共享池shared pool

      3.1库缓存library cache:缓存sql

      3.2数据字典缓存data dictionary cache:缓存最近使用的对象(表\索引\用户)定义

      3.3PL/SQL区

      3.4SQL查询和PL/SQL函数结果缓存

4.大池

 作用: 1)共享服务器进程使用 2)I/O缓存 3)RMAN备份

5.java池

6.流池

 

• The SGA structurescan be dynamically resized and automatically managed,with the exception of thelog buffer. 可以动态重调SGA结构的大小,也可对其进行自动化管理,但日志缓冲区却不可以。

Instance Process Structures实例进程结构

• Session serverprocesses are launched on demand when users connect. 当用户连接时,将根据需要启动会话服务器进程。

• Background processesare launched at instance startup and persist until shutdown. 后台进程在启动实例时启动,在关闭实例前一直存在。

• Server processesread from the database; background processes write to the database. 服务器进程对数据库进行读取操作,后台进程对数据库执行写操作.

• Some backgroundprocesses will always be present (in particular SMON,PMON, DBWn, LGWR, CKPT, andMMON); others will run depending on what options have been enabled. 某些后台进程始终存在(特别是SMON 、PMON 、DBWn 、LGWR 、CKPT 和MMON). 而其它进程则根据启用的选项运行。

后台进程包括

1.系统监视器(System Monitor, SMON)

   作用: 负责系统恢复与清理工作

1)实例mount时验证controlfile,open时验证datafiles and online log files,对于不一致的进行恢复。

2)启动时清理临时表空间中的临时段,或者一些异常操作过程遗留下来的临时段

2. 进程监视(Proccss Monitor.PMON)

作用:1)监测会话,当会话异常终止时,PMON销毁服务器进程,将PGA内存释放

     2)回滚未完成事务.

     3)实例启动时,PMON进程根据初始化参数定位监听器,实现实例的动态注册.

3. 数据库写入器(Database Writer , DBWn)

以下4种情况下,DBWn将执行数据文件写操作

1)没有任何可用的缓冲区

2)脏缓冲区占比过多

3)遇到三秒超时

4)遇到检查点

4. 日志写入器(log Writer, LGWR)

在以下3种情况下:LGWR将内存中日志缓冲区的内容写入到磁盘上的联机重做日志文件。

1)会话发出commit命令,执行提交操作

2)日志缓冲区占用率达到1/3

3) DBWn要将脏缓冲区写入到数据文件前

5. 检查点进程(Checkpoint Process , CKPT)

在2种情况下出现完全检查点:

1)应DBA要求执行 alter systemcheckpoint;

2)有序关闭数据库 shutdown [normal|transactional|immediate;

6. 可管理性监视器(Manageability Monitor. MMON)

作用:负责数据库自我监视和自我调整,通过SQL查询获得SGA中的统计信息,默认每小时获取一次快照,并存入数据字典(默认存8天,也可长期保存),此外,MMON 还持续监视数据库和实例,来确定是否应该发出任何警报(alert),某些警报条件(例如:存储空间达到上限时发发出警告)会默认启动。

MMON根据调度程序的安排,定期将内存中的统计信息转存到数据库。默认定期间隔时间为1小时,如果在此期间用于收集统计信息的内存满了,另一个进程MMNL将负责数据转储。

7. 内存管理器(Memory Manager, MMAN)

8. Archiver(ARCn)进程 用于日志文件归档

9. Recoverer(RECO)进程。

 

 

Database Storage Structures数据库存储结构

• There are threerequired file types in a database: the controlfile, the online redo log files,and the datafiles. 数据库中有三类必需的文件: 控制文件、联机重做日志文件和数据文件.

• The controlfilestores integrity information and pointers to the rest of the database. 控制文件存储完整信息以及指针,这些指针指向数据库其余的部分。

• The online redo logsstore recent change vectors applied to the database. 联机重做日志存储应用于数据库的最新变更向量。

• The datafiles storethe data. 数据文件用于存储数据.

• External filesinclude the parameter file, the password file, archive redo logs, and the logand trace files. 外部文件包括: 参数文件、口令文件、归挡重做日志以及告警日志和跟踪文件。

• Logical data storage(segments) is abstracted from physical data storage (datafiles) by tablespaces. 表空间将逻辑数据存储(段)从物理数据存储(数据文件)中抽象出来.

• A tablespace canconsist of multiple datafiles. 表空间可由多个数据文件组成。

• Segments consist ofmultiple extents, which consist of multiple Oracle blocks, which consist of oneor more operating system blocks. 一个段包含多个区间, 一个区间包含多个Oracle块,一个Oracle块也含多个操作系统块。

• A segment can haveextents in several datafiles. 一个段可以包含位于多个数据文件的区间。

 

本章真题解析

28.

 When does an incremental checkpoint occur?

A. when DBWn writes dirty buffers as part of its normalprocessing

B. whenan online redo log switch occurs

C. whena user tablespace is taken offline

D. whenthe alter system checkpoint statement is executed

Answer: A

 

翻译

何时发生增量检查点?

A. 通过DBWn进入将脏缓冲区的部分内容进行写操作时

B.发生在线重做日志切换时

C.当用户表空间offline时

D.当alter system checkpoint语句执行时

解析

 

 

 

练习:

1.手工执行全量检查点

altersystemcheckpoint;

2. 在线重做日志切换

select group#,sequence#,status from v$log;

altersystemswitchlogfile;

select group#,sequence#,status from v$log;

 

3.表空间的脱机与联机

select tablespace_name,status from dba_tablespaces ;

 

altertablespace AUTOSEGS   offlinenormal;

altertablespace MYTS    offlinetemporary;

altertablespace NONCRIT offlineimmediate;

 

altertablespace AUTOSEGS   online;

altertablespace MYTS       online;

 

SQL> alter tablespace NONCRIT   online;

alter tablespace NONCRIT        online

*

1 行出现错误:

ORA-01113: 文件 16 需要介质恢复

ORA-01110: 数据文件 16:

'D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\NONCRIT.DBF'

SQL> recover datafile 16

完成介质恢复。

 

53.

Whichtwo events always request the LGWR to write?

A. when DBwn writes dirty buffers

B. whenLGWR is notified by a server process that performs a COMMIT or ROLLBACK

C. when a checkpoint occurs

D. whena log switch occurs

E. WhenPMON restarts a server process

Answer: AC

 

翻译

哪两个事件总是要求LGWR写入?

A.DBwn写入脏缓冲区时

B.当LGWR被执行COMMIT或ROLLBACK的服务器进程通知时

C.当检查点发生时

D.当发生日志切换时

E.当PMON重新启动服务器进程时

解析

Ckpt发生时,会触发DBWn执行,而DBWn写入数据前会触发LGWR执行。

 

85.

Whichtwo are true about the Archive (ARCn) processes?

A.They archive redo directly from the redo log buffer.

B.They are used during instance recovery.

C.They automatically delete obsolete archive logs to make space for new archivelogs.

D. They are enabled only when thedatabase is in ARCHIVELOG mode.

E. They create archivelogs after everylog switch.

Answer:DE

 

翻译

关于归档进程(ARCn),哪两项是正确的?

A. 他们直接对redo log buffer执行归档操作。

B.在实例恢复期间使用它们。

C.他们自动删除过时的归档日志,为新的归档日志腾出空间。

D.只有当数据库处于ARCHIVELOG模式时才启用它们。

E.他们在每次日志切换后创建归档日志。

解析

 

--开启或关闭归档模式

alter database archivelog;

alter database noarchivelog;

--查看当前归档模式,是归档还是非归档

SQL> Archive log list;

数据库日志模式            存档模式

自动存档             启用

存档终点            USE_DB_RECOVERY_FILE_DEST

最早的联机日志序列     18

下一个存档日志序列   20

当前日志序列           20

 

SQL> select log_mode from v$database;

 

LOG_MODE

------------

ARCHIVELOG

 

Alter system switch logfile;

观察归档日志文件的生成

更多2019年oracle认证OCP考试071新题解析讨论请加入QQ群:479384490

更多2019年oracle认证OCP考试052新题解析讨论请加入QQ群:479384490

更多2019年oracle认证OCP考试053新题解析讨论请加入QQ群:479384490

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值