《數(shù)據(jù)庫系統(tǒng)原理(英文)-11-11》由會(huì)員分享,可在線閱讀,更多相關(guān)《數(shù)據(jù)庫系統(tǒng)原理(英文)-11-11(44頁珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、,單擊此處編輯母版標(biāo)題樣式,單擊此處編輯母版文本樣式,第二級(jí),第三級(jí),第四級(jí),第五級(jí),April 2010,Database System Concepts-Chapter 11 Storage and File Structures-,*,PART 4,DATA STORAGE AND QUERY,Introduction to Chapter11 and Chapter12,In view of physical DB,two issues should be addressed,data organization,in DBS,i.e.,physical,storage structur
2、e of data Chapter11,data access in DBS Chapter12,April 2010,2,Database System Concepts-Chapter 11 Storage and File Structures-,Chapter 11 Storage and File Structure,Main Contents in This Chapter,11-I,.Physical storage media in DBS(11.111.4),storage-device hierarchy,disk,RAID,11-II,.Storage access,11
3、-III,.File organization,at physical level,11-IV,.Organization of records in files,at logical level,i.e.file structures,11-IV,.,Data-dictionary(11.8),April 2010,4,Database System Concepts-Chapter 11 Storage and File Structures-,11.1 Physical Storage Media,11-I-1.Storage-device hierarchy,(11.1),As sho
4、wn in Fig.11.1,Hierarchy,primary storage,secondary storage,tertiary storage,Performance index,reliability,speed,capacity,cost,April 2010,5,Database System Concepts-Chapter 11 Storage and File Structures-,Fig.11.1 Storage-device hierarchy,CPU,secondary,storage,slow,fast,Speed,Capacity,large,small,low
5、,high,Cost,Reliability,volatile,nonvolatile,tertiary,storage,Performance Index,:,Storage,primary,storage,April 2010,6,Database System Concepts-Chapter 11 Storage and File Structures-,The disk structure is shown in Fig.11.2,Access time,is taken as the performance measures of disks,the time it takes f
6、rom when a read or write request is issued to when data transfer begins,Access time,includes,seek time,time it takes to reposition the arm over the correct track.,4 to 10 milliseconds on typical disks,rotational latency,time it takes for the sector to be accessed to appear under the head.,4 to 11 mi
7、lliseconds on typical disks(5400 to 15000 r.p.m.),11-I-2 Magnetic Disk,April 2010,7,Database System Concepts-Chapter 11 Storage and File Structures-,11-I-2 Magnetic Disk,Fig.11.2 Moving-head disk mechanism,磁柱,seeking,rotation,(1),(4),(3),(2),(5),April 2010,8,Database System Concepts-Chapter 11 Stora
8、ge and File Structures-,Data-transfer rate,the rate at which data can be retrieved from or stored to the disk,e.g.,ATA-5:66 MB/second,SCSI-3:40 MB/s,fiber Channel:256 MB/s,Mean time to failure,(MTTF),the average time the disk is expected to run continuously without any failure.,typically 3 to 5 year
9、s,Data is transferred between disk and main memory in,blocks,sizes range from 512 bytes to several kilobytes,Fig.11.0.1,11-I-2 Magnetic Disk(cont.),April 2010,9,Database System Concepts-Chapter 11 Storage and File Structures-,11-I-2 Magnetic Disk(cont.),CPU and disk,driver,:,disk,controller,I/O regi
10、sters,Fig.11.0.1 Data transfer,between disk and main memory,buffer,disk,DBS application,input/output/status/control,April 2010,10,Database System Concepts-Chapter 11 Storage and File Structures-,RAID:Redundant Arrays of Independent Disks,disk organization techniques that manage a large numbers of di
11、sks,providing a view of a single disk of,high capacity,and,high speed,by using multiple disks in parallel,and,high reliability,by storing data redundantly,so that data can be recovered even if a disk fails,The chance that some disk out of a set of,N,disks will fail is much lower than the chance that
12、 a specific single disk will fail,11-I-3 RAID,April 2010,11,Database System Concepts-Chapter 11 Storage and File Structures-,11-II Storage Access,A database file is partitioned into fixed-length storage units called,blocks,the blocks are units of both storage allocation and data transfer.,To reduce
13、the number of disk accesses and minimize the number of block transfers between the disk and memory,as many blocks of DB files as possible should be kept in the,buffer,main memory.,Buffer,portion of main memory available to store copies of disk blocks,Buffer manager,subsystem responsible for allocati
14、ng buffer space in main memory.,April 2010,12,Database System Concepts-Chapter 11 Storage and File Structures-,Application programs call on the buffer manager when they need a block,to read or write,from disk,if the block is already in the buffer,the requesting program is given the address of the bl
15、ock in the buffer,if the block is not in the buffer,the buffer manager,allocates,space in the buffer for the block,replacing,(throwing out)some other block,if required,to make spare space for the new block,the block that is thrown out is written back to disk only if it was modified since the most re
16、cent time that it was written to/fetched from the disk,11-II Storage Access(cont.),April 2010,13,Database System Concepts-Chapter 11 Storage and File Structures-,the buffer manager reads the block from the disk to the buffer,and passes the buffer address of the block to requester,With respect to block replacing in buffer,most buffer manager replace the block,least recently used,(,LRU,strategy),11-II Storage Access(cont.),April 2010,14,Database System Concepts-Chapter 11 Storage and File Structur