Oracle Architecture Study Notes

Source: Internet
Author: User
Oracle architecture learning notes: the most important thing for oracledatabase is onlineredolog, ldquo; write rdquo;: Checkpoint Process computing workload to set checkpoints,

Oracle architecture learning notes, the most important of oracle database is online redo log, ldquo; write rdquo;: Checkpoint Process computing workload, to determine the checkpoint,

Architecture and Backup recovery principles
1. The most important thing about Oracle database is online redo log.
Analogy
Controlfile: corporate executives
Datafile: Production Workshop
Online redo log: Finance Department
Note:
System tablespace is the first production workshop;
When the company's executives change, the finance department also needs to change;

2 shared pool mainly includes:
Library cache: Code (SQL, pl/SQL, java)
Data dictionary cache: store data dictionaries
Note:
In space allocation, the data dictionary is a boy, the Code is a girl, and the oracle server has a very simple idea. If the cache hit rate is low, it depends on girls, not boys. Because the boy will be given milk first.
At least recently, the code will be hidden from the pin. Otherwise, the shared pool will be out of memory when the Code comes in.

3 large pool
Large pool is required in the following scenarios:
Use rman for backup and recovery;
Parallel SQL;
Asynchronous I/O;
Shared Server mode;
Note:
Large pool is the assistant of the shared pool. If there is no large pool, the pool will be migrated to the shared pool.

4 java pool
It's a horse race, not where java code is stored.

5 database buffer cache and redo log buffer
1) relationship:
Redo log buffer painter (description)
Database buffer cache model (described)
2) Only one LGWR can be created, and multiple DBWR can be created.
3) oracle prefers to write logs rather than data blocks. Because the unit of the log is an item (about 200 bytes), and the unit of the data block is a block.
4) The redo log buffer is either completely written or not written, while the database buffer cache is easy to write at a time.
5) When to write logs?
Write every 3 seconds
1/3 full write
Write at commit
Write data when n M is dirty
DBWR written before writing
6) When to write data blocks?
Full checkpoint event occurs
Timeout (incremental checkpoint)
Dirty blocks reach the Domain value (incremental checkpoint)
When there is no free buffer (supplement the above one)

6 oracle is a transaction system, and its transaction occurs in the database buffer cache.
Specific transactions:
"Read": server process queries data dictionary cache, reads data to database buffer cache, and constructs a cursor (result set pointer) in PGA ), each Pointer Points to a rowid. To sort, connect, and read consistently, you only need to operate the pointer. Therefore, PGA is the most direct user experience.
"Change": Apply for TADDR
Log recording
Apply a row lock to the transaction slots on both sides
"Write": The Checkpoint Process calculates the workload to determine the checkpoint. When the checkpoint event occurs, it forces DBWRn to write a part in the order of first dirty blocks when the checkpoint event occurs, as this part of dirty data is written out, checkpoints are generated in the log file.

7. There are log entries after RBA pointers, for two reasons:
1) The entire tablespace is deprecated.
2) write in the order of first dirty Blocks

8. the user does not directly deal with oracle server, but rather handles server process.
Analogy:
Server process shopping guide
User process guest

9 "one bone sticks to the meat"
This can be used to describe the relationship between server process and PGA.
Bone: server process
Meat: PGA
"Two grasshoppers on one rope"
Grasshopper: SADDR, TADDR
This means that when a new value is written, the old value will be written, breathing, and sharing fate. Therefore, if you read 8 k, write 16 k, and the total I/O is 24 k.

10 view the essence through Phenomena
The essence of commit: Release the lock, write the log, and the transaction slot enters the countdown
Nature of normal shutdown:
1) Close the JAVA Process (oracle vs. java)
2) Write checkpoint
A) Freeze current_scn
B) write down the data block
C) make checkpoint_change # equal to current_scn
Note:
Select resetlogs_change # a, checkpoint_change # B, current_scn c
From v $ database
Where, A: Time origin of the database creation
B: The writing block field. After writing, all data blocks in the memory are larger than B. Therefore, the incremental checkpoint is identified by latency because it is not all.

11 system tablespace
1) store the data dictionary table
2) pl/SQL objects such as packages, processes, functions, and triggers

12 sysaux tablespace
1) 90% is used to collect workload
2) 10% store sysman to something
Analogy:
In life, water meters, electric meters, and gas meters, the degrees on these tables are "the dead man". For comparison and reasonable expenses, meter reading is required.

13 four buffer states
Free: When writing
Clean: Just read
Pinned: special clean, added latch, to be used
Dirty: changed

14 fragment of RBA pointers
Direction: always move down seamlessly
Place of birth: control document
Location: Log File
Posting: the corresponding data block has been written to the data file.
Active: logs overwritten by RBA (only one RBA log exists)
The full checkpoint will directly dry the RBA to the last redo log group.

15 power-off nature: SGA suddenly disappeared and its strength collapsed
What is essentially consistent with power failure is:
Kill the SMON process (kill-9 PID)
Shutdown abort

16 In the mount stage, SMON reads control files and compares them:
1) The last shutdown of SCN
Checkpoint B that was shut down last time
2) record C of the last log Group
RBA pointer position D
If shutdown is normal, A = B C = D
Otherwise, A> B D> C
In this case, we need to send SMON to roll forward and repeat the record of redo logs in the memory until C = D.

For more information about Oracle, see the Oracle topic page? Tid = 12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.