Happy Life of the Old Wang family
Abstraction of Oracle's Structure System
An avid photographer-happy family of Old Wang
The first chapter of each Oracle book generally introduces the structure and system of Oracle. When this chapter is opened, readers will suddenly fall into an abyss full of obscure and unfamiliar concepts. I lost all of my interest in reading the database, and oracle was an esoteric and difficult-to-understand idea of a database. However, if you do not know the structure of Oracle, even if you have been using Oracle for many years, it is still in a low-grade application level. In order to help you understand the content of the structural system, I wrote an introduction to an avid photography enthusiast-happy family of Old Wang. Through comparison and association, we hope this will help you understand the structure and system of the Oracle database.
Family members and roles (note the alias of this family, which will appear in the attachment document)
Member |
Link |
Alias |
Role functions |
Old Wang |
One Master |
Sid |
Take a photo with a special camera (a photo and a negative film are generated without changing the film), place the photo in db_buffer_cache, give the negative film to the eldest son, and mark the SCN; |
Wang's wife |
Wife |
Dbwr |
Wang's wife is a traditional Chinese female. One of her jobs is to constantly check whether there are new photos on db_buffer_cache. If so, she is placed in the photo space (which consists of a photo album, a wall, and a photo album. The photo frame on the wall is the same size. Sometimes a frame has a picture, sometimes a frame has multiple photos, and sometimes a photo occupies multiple frames (photo links ), each frame is recorded with the SCN (System Change number). Each image has a unique ID (rowid), which contains information about the wall and frame, Sometimes, when he looks at the photo on the wall and feels unsatisfied, take it down and modify it. Then he copies the frame containing the photo (also called a snapshot ), and put the copy in a storage room called rollback. If you are satisfied with the modification and are confirmed, Wang will put the modified photo back to the original place of the wall, and put the new SCN on the frame. If you are not satisfied, the frame will be taken back from the storage room and placed on the wall. |
Wang Botang |
Eldest Son |
Ldwr |
While taking a picture, Old Wang produced a negative film. He put the film on a shelf in the kitchen at home. On the shelf, Old Wang pasted a label and marked the negative film, this label is called "log-buffer". When Wang bodang, the eldest son, finds a negative film on the shelf, he immediately puts it in a notebook. This notebook is called "redo notebook" and uses this name, this is because you can use the negative film to restore a picture. Wang Dangdang, the eldest son, put the negatives in order to "redo the notebook". Once the current notebook is full, he will change to another notebook and record it in the "alarm Diary. Note: not all photos are saved with negatives. Old Wang can specify those photos without logs. |
Wang Zhonghe |
Second Son |
Arch |
Even though he had done so, Old Wang was not at ease. He worried that if a fire or other accidents occurred, his photo negatives could still be damaged, he assigned his second son Zhong He a task. Once the eldest son changed his "redo notebook", he took out the negatives in the "redo notebook, put him in a safe place outside the house-in the basement of the backyard, and make a copy of "redo notebook". This copy is called "ARCHIVE redo notebook ", at the same time, he updates the "control notebook" and makes a record on the "alarm Diary. |
Wang xiaosan |
Youngest son |
Ckpt |
The youngest son, Wang xiaosan, is a fast-moving little guy. His task is to coordinate the pictures in every wall, photo album, and cut album with the numbers in the control notebook. When he gets instructions, he flew up, wrote numbers on every wall, and recorded the same numbers in the "control notebook" to coordinate everything. |
Wang butler |
Butler |
SMON |
Sometimes, when the family gets up in the morning, the house looks messy. This is because they didn't have time to clean up their affairs before the rest last night, SMON is responsible for pre-processing incomplete photos and rollback before opening the door (remove the photo frame from the back-to-storage room and put the old version back to the original wall) |
Wang guanzhu's wife |
Maids |
Pmon |
The Old Wang finished his day's work and was ready to take a rest. He asked his family to put everything in place, shut down or stop his work before the rest. There are four situations for guests visiting the room to leave: 1: Old Wang is patient and waits for all guests to leave and rest; 2: Old Wang was impatient. He personally supervised every guest, but after reading the photo, he pointed out the direction for the guest to go out; 3: Old Wang was impatient. He grabbed the guest's collar and sent out the door so that they could not finish their work; 4: Old Wang, pull down the electric gate and say, time is up. The house was in a mess. The next morning, Wang managed to clean up the house. When a guest leaves, Old Wang calls the maids. She monitors the activities of every guest. After these guests leave, the maids tirelessly sweep the garbage left by the guests into the garbage bins and take proper measures. If old Wang didn't pull the gate, everyone would turn on the light and clean up: Wang's wife would take all the photos from the db_buffer_cache shelf and put them on the right wall. Wang's eldest son confirmed that the log_buffer shelf was empty, all the negatives are in the "redo notebook". Wang xiaosan, the youngest son, circled the entire room and updated the walls and laptops with the highest and lowest directory number SCN; wang Zhonghe, the second child, put the last negative film in the "redo notebook" and put it in the basement of the backyard. Then, update the control and alarm notebook. After everything is done, Old Wang turns off the light and the family is resting. |
The following are some terms related to role activities, which are described here separately:
Control notebook: The main Member of the Old Wang family, who wants to make detailed notes (such as our weekly work report) for the well-organized photo and negative film processing ), everyone writes their affairs into this notebook, which is called "control notebook ". The "control notebook" records the list items of each wall, clipboard, and other household property. When Old Wang thinks that he wants to add a room to put more photos, he must add corresponding records in the "control notebook. When the boss changes "redo notebook", he needs to add corresponding records in "control notebook. When the second child copies a "redo notebook", he needs to add corresponding records in the "control notebook. When John runs a lap in the room, he needs to add corresponding records in the "control notebook. This special notebook dynamically stores asset conditions in all locations and the work processes represented in numbers in the house.
Alert notebook: each household member writes the problem in this log. If you need additional information in a certain situation, you need to "track the notebook", which is used with the alarm notebook, so that the alarm notebook will not be so messy.
Other questions of the Old Wang family:
If the following problems occur, Lao Wang cannot do his work for one day:
1: unable to find the work plan for the new day's work (initialization file)
2: The basement in the backyard is full. The second child has no space to place new negatives. The whole family has to wait;
3: The Old Wang's wife caught a cold, and he was very sad. He would close the door sadly and the whole family was shut down.
4: Sometimes old Wang needs to use a negative film in the basement of the backyard to restore a photo. If he loses a negative film or damages a negative film during restoration, he cannot recover all photos taken after the negative film is damaged.
5: Lao Wang is not careful at work. During work, the film in the camera is exposed. He will ask the camera manufacturer to provide a camera with two film warehouses, in case of film exposure in a film warehouse, he can still expect another film warehouse called an image ".
Oracle memory architecture SGA
When the database is started, the following main parameters are displayed:
Name |
Role functions |
Sharing pool (Shared Pool) |
Library cache, Dictionary, etc. Large pool: RMAN parallel processing of multi-thread server time-sharing memory Java pool: Java code data usage |
Buffer Storage Area (Buffer cache) |
New data or updated data is first cached and then written back to the disk. |
Redo log Buffer (Redo log buffer) |
After the data is updated, the changes made to them are saved in the redo log buffer. When the zone is full of 1/3 or has 1 MB of redo log records, the data in this area is written into the online redo log. |
Database architecture-comparison between Old Wang and the basic content of Oracle
Oracle concepts |
Comparison of Old Wang's family |
Oracle Database |
The Old Wang family saves photos and related laptops, walls, and storage rooms. |
Line |
A photo. Old Wang views, modifies, and deletes the photos. The database row stores the data, which can be viewed, modified, deleted, and added. |
Row ID) |
Photo ID |
Data Block |
Save the photo frame. |
Tablespace |
Room for saving photos |
System Change No. SCN |
The basis for the coordination between the walls and the content in each notebook |
Data Files |
Save the photo to every wall of the room |
Online redo log files |
|
Control File |
Control notebook content |
Parameter file |
Before starting a job, Lao Wang must read the activity guide for his daily work. |
Data writer |
Wife Wang took a picture from the shelf db_buffer_cache and put it on the wall. |
Log writer |
Wang bodang, the eldest son, put the negative film in his notebook. |
Archive |
The second son Zhong He took out the negatives in the "redo notebook" and put them in the "ARCHIVE redo notebook" (in the basement of the backyard) |
System Monitor |
Wang butler |
Process Monitor |
Nanny Wang Butler wife |
Open \ close \ Start Database |
Wang's house is open to guests, family breaks, regular morning procedures |
Transactions |
Process one or more photos |
Checkpoint |
Wang xiaosan synchronizes pictures on the wall and controls the notebook content |
Activity process:
1. Write a piece of data
Insertinto deptvalues (...) 2. Generate redo and save it in the redo Cache
3. generate an undo and save it in the rollback segment.
Generate redo regardless of whether submitted or not
Commit; 1. read consistency (Principle SCN)
2. Write the redo log buffer to the online redo log
Continue with other work. If an online redo log is full, lgwr closes the log and writes the next log. lgwr also notifies arch to write the completed redo log to the archived redo log.