Oracle Learning Notes
Storage and RAID Technology overview
This lesson is about storage and RAID technology in an environment where Oracle databases are running.
A) Oralce structure in the production environment
Let's talk about the environment where Oracle is located.
There is a structure:
Two servers, two fibre storage switches, two storage,
They are connected to each other through a network cable.
Each server is connected to a two switch,
Each switch is connected to two servers with two storage at a time,
Each storage and two switches have connectivity.
This is a relatively typical normal operating environment for Oracle databases.
Linux and Oracle database software are installed on each server,
The Oracle database is built on storage and two data are placed on two storage,
And the data on the two stores is exactly the same.
Local to the server is only installed with the operating system and Oracle database software, if the bad can be re-installed.
The entire system inside very important data carrier and storage media is stored,
The Oracle database data file is placed on the storage.
The primary function of storage is to store data,
The data is stored on the hard disk, and the storage contains a bunch of hard drives.
For the server generally only two local hard disk, hard disk space is relatively small, the real space requirements on the storage.
Here's an example:
There are two servers equipped with two Linux, two database software,
There are also two fibre storage switches, plus a lot of lines and two of storage.
Characteristics:
1, everywhere embodies the redundancy, one bad there is another, to prevent a single point of failure.
Redundancy is also called ha high availability.
In the computer system we design to prevent a single point of failure, to take redundancy, everywhere redundant.
2, we remove redundant words, we are redundant at the same time, let two servers simultaneously work,
One is broken, the other one can continue to work.
This achieves load balancing of lb (load balance).
One Oracle software runs on two servers,
For users, our performance has been increased by one-fold.
Our environment can implement ha and lb.
Oracle's hardware environment is this environment, many of which are basically the environment.
Another type of environment:
Two servers, one fibre storage switch, one storage.
There is a problem, if a single point of failure switch or storage is bad, the entire system can not be used.
There is also an environment:
Two servers two switches and one storage
The switch excludes a single point of failure, and the storage also has a single point of failure.
We try to use the first structure, but the second structure actually uses more.
In front of the main talk about the structure of the ORALCE production environment.
II) storage
Storage is used to store data.
Storage is a big iron cabinet with a bunch of hard drives,
Depending on the storage capacity and your needs, you can have a very large number of hard drives.
A shell is not enough to add some shell, shell inside and put the hard drive.
This will be a large amount of space.
This is the simplest metaphor for storing.
Observe the actual storage entity,
From the front of the storage there are many hard drives arranged neatly,
Like a row of 14 hard drives, altogether two rows, there is a total of 28 hard drives.
Piece of hard disk 300G,
The total is 300g*28=8400g about 8.2T
This overall is a 8 t storage.
8000G is enough for the general data.
This storage is counted as a small to medium storage.
Small storage puts fewer hard drives.
In order to cooperate with Oralce's study, it is necessary for us to describe the approximate knowledge of storage.
After the storage, you can see the controller, power,
Storage is generally dual-control dual-power, the storage itself is redundant.
The controller is stored in the heart and the power supply is powered.
Storage take the controller away, it's worthless.
Storage is expensive, mainly on the controller.
Controller from the outside can see a lot of interfaces,
Used to connect the fibre storage switch, the switch is connected to the server.
The server is connected to the fibre storage switch via the HBA card, the fiber optic cable,
The fiber optic storage switch is connected to the controller's port via the fiber optic cable, called the LC port.
The server is connected to the storage through this structure.
There are many kinds of fiber optic cables,
Plug it into the storage controller and plug it into the storage switch. The middle line can be very long.
Some of the fiber-optic cable mouth is very large and the mouth is very small.
LC Type Connection head with more, MTRJ also more.
SC-type connectors now use less, because the head is larger, occupying space.
Fiber optic cable has a single-mode multimode of the points,
Single mode transmission distance is far, multimode transmission distance near.
Within two hundred or three hundred meters with Multimode, single-mode a few kilometers can be.
But the transfer speed is the same.
The optical fiber transmission speed depends on the transfer speed of the HBA card.
The fiber itself has no transmission speed, depending on the card.
The controller and power supply are stored,
The controller has a fiber port,
HBA card with fiber port.
Storage is a large iron cabinet, behind the controller and Power, the front of a lot of hard disk.
Drive data, controller to the entire storage control, power supply.
The storage has a cache, a battery, and a CPU.
The storage also has the fiber interface, the management interface, all on the controller.
A lot of things, some need, and some do not.
In actual use, according to the different technology and high and low, not everything can be used.
Storage Features:
1, it put a lot of hard drives together, form a large hard disk.
such as a hard disk 300G, altogether 100 hard drives,
Storage can integrate these drives and let us use them.
Provides a space for aggregation.
2, speed up the reading and writing data from the storage hard disk.
Caching techniques are used to speed up read and write.
3, storage support RAID technology.
The controller grouped and integrated the hard drives.
Make different appearance, make different access way.
III) RAID
RAID is the controller to set a lot of hard disk, through a number of technologies to achieve the speed of access to the drive.
RAID is featured in several ways.
1. Provide redundancy
2. Improve Access speed
RAID technologies are commonly used for:
Raid0
Raid1
Raid5
Raid6
Raid10
Raid01
RAID0 RAID1 RAID5 These three technologies are now being used in fewer and smaller ways.
With less direct use, new technologies are largely unused.
But theoretically, the more basic the technology is, the better its practicality and durability.
Now Raid6 useful,
The most used are RAID10 and raid01.
1) RAID0
The following assumes that there are two hard disks in the array.
RAID first contains all the hard disk space to draw a stripe,
Strips have a piece on each hard drive,
These block spaces are the same size.
To save a file to the RAID0 disk,
It cuts the files into chunks and puts them in the block of the disk array sequentially,
This allows the file to be evenly placed on two hard drives.
Benefits of RAID0
Each hard drive has its own set of hard disk systems, such as a hard disk controller,
When a file is written to a RAID0 disk, parallel writes can be implemented.
Parallel reading can also be achieved when reading.
RAID0 can increase the speed at which we write data to disk and read, which is to increase our access to the hard disk.
The disadvantage of RAID0
The same file is distributed on two hard disks, and the more hard disks are the more likely the probability of a hard drive is broken.
There is only one hard disk damage chance and the chance of a hard drive with 100 hard drives is obviously the latter.
RAID0 any piece of hard drive is broken, the entire RAID0 file will be damaged.
RAID0 is very good at reading and writing performance,
But there's a very deadly place, without any redundancy,
The data is more susceptible to damage, and the damage is completely damaged.
The RAID0 is only suitable for work environments that require very high read and write speeds, but have little or no requirement for reliability and safety.
In this environment we can use RAID0, only increase the speed without redundancy.
RAID0 a minimum of two hard drives, three blocks of four pieces of five blocks, it is recommended not to exceed six blocks.
2) RAID1
Also called mirroring.
Suppose there are two hard disks in the array.
A file, to write on the RAID1,
When you write a piece of data to a hard disk, write exactly the same piece of data to another hard disk.
Each hard drive writes data, and another hard disk is written to the mirror.
Redundancy is provided at this time. A hard drive is broken, and a hard drive is not damaged.
RAID1 Features:
1. Provide redundancy
2, write performance slightly worse, because the same data at the same time to two hard disk write, at least in writing performance has not improved.
A file has two hard drives, which can be read from both hard drives while reading a file.
One hard drive reads part, another hard drive can read out another part.
This can be improved in reading performance.
RAID1 provides redundancy, but it wastes 50% of the space because it is a two-disk image. RAID0 didn't waste space.
RAID1 at least two hard drives, usually even.
RAID1 application of the occasion, the server local two hard disks, 99% of the environment two hard drives made into RAID1.
3) RAID5
Writing data is characteristic
If the RAID5 has four hard disks, each stripe will have four blocks of data.
A file to write in, a chunk to write,
Three pieces of data written to the file by three of the same strip,
Another piece of data that is not written to the file, but one that is computed by another three pieces of data.
The characteristics of this data storage, four pieces of data, any piece of data is broken, can be calculated by the other three pieces of data.
We are called parity check.
RAID5 Features:
1, there is redundancy. You can break up a hard disk, but waste 1/n space.
Wasted space: RAID1 for 50%,RAID0 no waste, RAID5 waste 1/n space.
RAID5 have redundancy can be bad piece, if the bad two blocks the entire array also broken.
2, read performance is very high, multiple hard drives can be read at the same time,
Read without calculation, and can read n-1 block data at the same time.
Write performance is poor, each write is the stripe of all the blocks simultaneously write,
And one piece needs to be calculated to get, so write performance is poor.
RAID5 and RAID0 are similar, but the RAID5 has redundancy, redundancy wastes space and results in poor write performance.
RAID5 is a technique that has been used often before. I don't want to use it now.
4) Raid6
Raid6 also uses parity, which also enables redundancy, but has two pieces of redundant data.
Raid6 can be bad for two hard drives at the same time than RAID5 improvements.
It has to write two copies of parity data at the same time, its write performance is worse than RAID5.
Although it can be bad at the same time two hard disk, but this technology is not very good, because read performance can also, write performance is really poor.
At the same time can be bad two pieces of hard disk is a benefit.
RAID5 can only break a hard drive.
If RAID5 a hard drive, read the data,
The bad disk data to the other three disk with the stripe data readout and calculation can be obtained, resulting in a sharp decline in reading performance.
RAID5 has such a characteristic and risk,
If a hard drive is broken, the performance of the overall RAID5 will drop sharply, almost unusable.
Raid6 better, it bad piece of hard disk is not very obvious, bad two block and RAID5 bad hard disk.
Raid6 currently in use, the teacher is not recommended to use.
5) Raid01 and RAID10
Teacher Lecture Time 2012, the most popular technology is RAID01 and RAID10.
Suppose you use four hard drives.
Two hard disk to do RAID0, two raid0 to do RAID1, four hard disk is raid01.
It uses RAID0 and has high read and write performance.
Two raid0 combined with RAID1, benefits improve read performance while providing redundancy.
Overall improve the read performance, there is RAID0 write performance is not bad.
Redundancy is 50% and redundancy is good.
There is a problem space waste is more serious, wasting 50%.
RAID10 and RAID01 are similar in performance.
Two hard drives do RAID1, two raid1 do RAID0 again.
RAID01 and RAID10 in Oracle database, we are all recommended to use, all good.
Although some people compare, but the teacher through their own projects in the actual project to do 01 and 10 performance can be.
The actual working environment of Oracle is RAID5,RAID6,RAID0,RAID1 on storage or recommended for less use.
5) RAID Technology experience
All RAID technologies have improved reading and only raid0 to write.
A situation similar to the physical conservation of energy was found:
Computer as a whole, its technology in improving the performance on the one hand, will consume another aspect of resources.
such as disk arrays, all technical categories improve performance by adding controllers and adding hard drives.
RAID0 improves write speed, but reduces security.
As long as a hard drive is damaged, the array is broken and all data is corrupted.
RAID1, when security is increased, it consumes multiple storage drives.
RAID5, RAID6 improves data security,
It consumes a portion of the CPU's processing performance and is used to operate. Its parity requires CPU processing.
Four
Today we've talked about some of the technologies for storage, RAID, HBA cards, and fiber optics.
It's a bit more sketchy, mainly for the next step in Oracle's class.
Complementary technologies:
Oralce server typical structure, a server access to a hard disk has two paths.
One server is connected to two switch two paths, and then the two paths have one path to each storage
Such a server accesses a store in a total of two paths
These two paths have the function of redundancy, one path is broken, you can go the other way.
Through the setup of some software, it not only has the function of redundancy, but also has the function of load balance,
When a server takes data from one store, the data can be divided into two parts, taking two paths respectively.
These two links not only implement Ha, but also load balancing.
This technique is called multi path.
In fact, when we do, on the server through a software to bind the two links into a link.
That is, the server sees only one chain passing by, in fact, the software is the link together.
This is called MPIO technology, Multi path IO technology
This is a very important technology in UNIX and Linux. Multi-Path technology is very important.
June 20, 2016
Yun Zheng
Oracle Learning Notebook Storage and RAID technology overview