Dbms by jeet goyal

299 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
299
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Dbms by jeet goyal

  1. 1. Storage Device Hierarchy Cache Main Memory Flash Memory Magnetic Disk Optical Disk DBMS, JVP Magnetic Tapes Cost Access Speed
  2. 2. • • • • • Fastest Most Costly Media Small & is managed by System H/W Generally is inbuilt on-chip memory For storage of important & critical instructions • If size of cache is increased – cost increased benefits of cache is lost DBMS, JVP
  3. 3. • Machine instructions are stored in main memory • Its is quite small for storing Database • Its Volatile i.e. data is lost on power failure or system crash DBMS, JVP
  4. 4. • • • • • EEPROM Read is Faster Write is very slow & complicated 4-10 microsec to write, can’t be overwritten To overwrite, has to erase entire data of memory • Used generally for hand-held & digital electronics devices DBMS, JVP
  5. 5. • Stores the Database, data moves between Main Memory & Disk • Size – Few GB upto 80GB • Size of Magnetic Disk needs increases as we have requirement for larger capacity disks • Can survive power failure & system crash, is non-volatile storage media • Disk Failure results in loss of data stored on disk. DBMS, JVP
  6. 6. • CD – holds about 640MB • DVD – holds 4.7 or 8.5GB per side to 17GB for two-sided disk • Data is stored optically on a disk, is read by laser • WORM-write once read many CDs & DVDs • CD-RW & DVD-RW : For multiple writes & read • CDs are magnetic-optical storage devices that use optical means to read magnetically encoded data. • DBMS, JVP archival storages Used for
  7. 7. • • • • • Used for Backup Storage Cheaper & Slower Access Sequential-access Storage Not direct access like CDs Used for holding large backup data of large organization DBMS, JVP
  8. 8. Spindle Track i Platter Disk Arm Arm Assembly Cylinder i DBMS, JVP R-W Head
  9. 9. • Access Time : Read Req. Issued – Actual Data Transfer Begin • Seek Time : Avg. Seek Time Time For Repositioning the arm • Rotational Latency Time : Avg. RLT Time waiting for sector to appear under head • A T = S T + RL T • Data Transfer Rate : rate of data read/write to disk • Mean Time To Failure (MTTF) Amount of time on avg. we expect system to work w/o DBMS, JVP failure, measure of reliability of disk
  10. 10. • Reliability of Disk : 1,00,000/100 = 1000 hours • Disk Failure leads to loss of data • So keep redundancy i.e. Mirroring of Disk • MTTF of mirrored disk depends on MTTR, time to replace failed disk & restore data • First write to one copy them to other so on power failure, blocks have complete data. DBMS, JVP
  11. 11. • Parallel access to disks • Improve the transfer rate by ‘Striping’ • Bit-level striping : splitting bits of each byte across multiple disks, array of 4,8,16… disks, increase R/W at 8 times • Block-level striping : divide data into blocks, each block in a disk. • ith block is in (i mod n + 1)th disk, n=total no. of disks in array. • Balances load across multiple disks so access is fast & o/p is high DBMS, JVP
  12. 12. C DBMS, JVP C C C
  13. 13. P DBMS, JVP P P
  14. 14. P P DBMS, JVP P P P P
  15. 15. P DBMS, JVP P P P P P
  16. 16. • • • • Monetary Cost of extra disk Performance – no. of I/O Operations Performance when Disk fails Performance to rebuild the Data RAID 0, 1, 5 are currently in use DBMS, JVP
  17. 17. • File is organized logically as a sequence of records. The records are stored in disk blocks. Fixed Length Records Variable Length Records DBMS, JVP
  18. 18. • Deposit = record acc_no:char(10); br_nm:char(22); bal:real; end Acc_n Br_nm o Bal R-1 A-104 Bombay 500 R-2 A-121 Delhi 781 R-3 A-393 Pune 900 R-4 A-129 Bombay 400 R-5 A-214 Chennai 164 Total = 40 bytes DBMS, JVP
  19. 19. Header A-104 Bombay 500 A-121 Delhi 781 A-393 Pune 900 A-129 Bombay 400 A-214 Chennai 164 DBMS, JVP
  20. 20. • Records has varying length • Account_list : record Br_nm:char(22); accounts :- array(1---infinite) acc_no:char(10); bal:real; end end DBMS, JVP
  21. 21. • Dis. Adv. – - Not easy to occupy space left by deleted record Leads to small fragments on disk - No space for records to grow Header has info : - No. of records - Free space pointer - Size of each record block DBMS, JVP
  22. 22. • Reserved Space • List Representation – Anchor Block – Over Flow Block DBMS, JVP
  23. 23. • Heap file organization • Sequential file organization – Search Key – Insert & Deleted using Overflow Block • Hashing file organization • Clustering file organization DBMS, JVP
  24. 24. • A database that maintains data about relations, stores information about the tables of the database. • E.g. Name of relations Names of Attributes Domains & Length Constraints DBMS, JVP
  25. 25. DBMS, JVP
  26. 26. • Ordered Indices • Hash Indices Aspects :- Access Type : by value or range - Access Time - Insertion Time - Deletion Time - Space Overhead DBMS, JVP
  27. 27. • Primary Index – Dense Index – Sparse Index Multilevel Indices Secondary Indices DBMS, JVP
  28. 28. • Hash File Organization - Hash Function Uniform Distribution Random Distribution - Bucket Bucket Overflow & Skew Overflow Chining • Hash Indices • Comparison of Indexing & Hashing DBMS, JVP
  29. 29. DBMS, JVP

×