Top Banner
31
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Dbms by jeet goyal
Page 2: Dbms by jeet goyal

DBMS, JVP Magnetic Tapes

Optical Disk

Magnetic Disk

Flash Memory

Main Memory

Cache

Storage Device Hierarchy

Cost

Access Speed

Page 3: Dbms by jeet goyal

DBMS, JVP

• 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

Page 4: Dbms by jeet goyal

DBMS, JVP

• 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

Page 5: Dbms by jeet goyal

DBMS, JVP

• 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

Page 6: Dbms by jeet goyal

DBMS, JVP

• 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.

Page 7: Dbms by jeet goyal

DBMS, JVP

• 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.

• Used for archival storages

Page 8: Dbms by jeet goyal

DBMS, JVP

• Used for Backup Storage

• Cheaper & Slower Access

• Sequential-access Storage

• Not direct access like CDs

• Used for holding large backup data of large organization

Page 9: Dbms by jeet goyal

DBMS, JVP

Track i

Platter

Cylinder i

Spindle

R-W Head

Disk Arm

Arm Assembly

Page 10: Dbms by jeet goyal

DBMS, JVP

• 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 failure, measure of reliability of disk

Page 11: Dbms by jeet goyal

DBMS, JVP

• 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.

Page 12: Dbms by jeet goyal

DBMS, JVP

• 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

Page 13: Dbms by jeet goyal
Page 14: Dbms by jeet goyal

DBMS, JVP

CCCC

Page 15: Dbms by jeet goyal

DBMS, JVP

PP P

Page 16: Dbms by jeet goyal

DBMS, JVP

P

P P P P

P

Page 17: Dbms by jeet goyal

DBMS, JVP

PP P

PP

P

Page 18: Dbms by jeet goyal

DBMS, JVP

• 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

Page 19: Dbms by jeet goyal

DBMS, JVP

• File is organized logically as a sequence of records. The records are stored in disk blocks.

Fixed Length RecordsVariable Length Records

Page 20: Dbms by jeet goyal

DBMS, JVP

• Deposit = record

acc_no:char(10);

br_nm:char(22);

bal:real;

end

Total = 40 bytes

Acc_no

Br_nm Bal

A-104 Bombay 500

A-121 Delhi 781

A-393 Pune 900

A-129 Bombay 400

A-214 Chennai 164

R-1

R-2

R-3

R-4

R-5

Page 21: Dbms by jeet goyal

DBMS, JVP

A-104 Bombay 500

A-121 Delhi 781

A-393 Pune 900

A-129 Bombay 400

A-214 Chennai 164

Header

Page 22: Dbms by jeet goyal

DBMS, JVP

• Records has varying length

• Account_list : record

Br_nm:char(22);

accounts :- array(1---infinite)

acc_no:char(10);

bal:real;

end

end

Page 23: Dbms by jeet goyal

DBMS, JVP

• 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

Page 24: Dbms by jeet goyal

DBMS, JVP

• Reserved Space

• List Representation– Anchor Block– Over Flow Block

Page 25: Dbms by jeet goyal

DBMS, JVP

• Heap file organization

• Sequential file organization– Search Key– Insert & Deleted using Overflow Block

• Hashing file organization

• Clustering file organization

Page 26: Dbms by jeet goyal

DBMS, JVP

• 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

Page 27: Dbms by jeet goyal

DBMS, JVP

Page 28: Dbms by jeet goyal

DBMS, JVP

• Ordered Indices

• Hash Indices

Aspects :-

- Access Type : by value or range

- Access Time

- Insertion Time

- Deletion Time

- Space Overhead

Page 29: Dbms by jeet goyal

DBMS, JVP

• Primary Index– Dense Index– Sparse Index

Multilevel Indices

Secondary Indices

Page 30: Dbms by jeet goyal

DBMS, JVP

• Hash File Organization

- Hash Function

- Uniform Distribution

- Random Distribution

- Bucket

Bucket Overflow & Skew

Overflow Chining

• Hash Indices

• Comparison of Indexing & Hashing

Page 31: Dbms by jeet goyal

DBMS, JVP