小布老师oracle视频讲座笔记(二)
Oracle Process Structure
Oracle takes advantage of various types of processes:
—User process: Started at the time a database user requests connection to the Oracle server
—Server process: Connects to the Oracle instance and is started when a user establishes a session
—Background processes: Started when an Oracle instance is started
User Process: A progrm that requests interaction with the Oracle server, Must first establish a connection, Does not interact directly with the Oracle server.
Server Process: A program that directly interacts with the Oracle Server
—Fulfills calls generated and returns results
—Can be deficated or shared server
IPC: Inter Process Communication, 包括共享内存、队列、信号量等几种形式。
Background Process
Maintains and enforces relationships between physical and memory structures:
—Mandatory background processes
DBWn PMON CKPT LGWR SMON
—Optional background processes
ARCn LMDn QMNn CJQ0 LMON RECO Dnnn LMS Snnn
LCKn Pnnn
DBWn(Database Writer), DBWn writes when:
—Checkpoint occurs
—Dirty buffers reach threshold
—There are no free buffers
—Timeout occurs
—RAC ping request is made
—Tablespace OFFLINE
—Tablespace READ ONLY
—Table DROP or TRUNCATE
—Tablespace BEGIN BACKUP
Log Witer(LGWN), LGWR writes:
—At commit
—When one-third full
—When there is 1MB of redo
--Every three seconds
--Before DBWn writes
System Monitor(SMON)
Responsibilities
—Instance recovery
—Rolls forward changes in noline redo log files
—Opens database fo
相关文档:
我在http://zhidao.baidu.com/question/123262452.html?fr=msg 提的问题,整理到这里 非常感谢 zjwssg
的回答
排序内存涉及到PGA。
什么时候使用自动PGA内存管理?什么时候使用手动PGA内存管理?
白天系统正常运行时适合使用自动PGA内存管理,让Oracle根据当前负载自动管理、分配PGA内存。
夜里用户数 ......
前段时间,新公司的面试官问了一个问题,临时表的作用,以前我们用缓存中间数据时候,都是自己建一个临时表。其实oracle本身在这方面就已经考虑很全了,除非有些高级应用,我再考虑自己创建临时表。由于本人对临时表的了解不是很多,于是回来搜集下这方面的资料,弥补下这块的不足。
1、前言
......
IN和EXISTS区别
in 是把外表和内表作hash join,而exists是对外表作loop,每次loop再对内表进行查询。
一直以来认为exists比in效率高的说法是不准确的。
如果查询的两个表大小相当,那么用in和exists差别不大。
如果两个表中一个较小,一个是大表,则子查询表大的用exists,子查询表小的用in:
例如:表A(小表),表B ......
1. round(Num,n) : 四舍五入数字Num,保留n位小数,不写N默认不要小数,四舍五入到整数个位
select ROUND(21.237,2) from dual;
结果: 21.24
2. trunc(Num,n) : 截取数字Num,保留n位小数,不写N默认是0,即不要小数
select TRUNC(21.237,2) from dual;
结果:21.2 ......